lkml.org 
[lkml]   [2011]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 12/28] posix-timers: Convert clock_gettime() to clockid_to_kclock()
On Wed, 2 Feb 2011, Richard Cochran wrote:

> On Tue, Feb 01, 2011 at 01:51:50PM -0000, Thomas Gleixner wrote:
> > --- linux-2.6-tip.orig/kernel/posix-timers.c
> > +++ linux-2.6-tip/kernel/posix-timers.c
>
> > @@ -956,18 +955,21 @@ SYSCALL_DEFINE2(clock_settime, const clo
> > SYSCALL_DEFINE2(clock_gettime, const clockid_t, which_clock,
> > struct timespec __user *,tp)
> > {
> > + struct k_clock *kc = clockid_to_kclock(which_clock);
> > struct timespec kernel_tp;
> > int error;
> >
> > - if (invalid_clockid(which_clock))
> > + if (!kc)
> > return -EINVAL;
> > - error = CLOCK_DISPATCH(which_clock, clock_get,
> > - (which_clock, &kernel_tp));
> > + if (!kc->clock_get)
> > + return -EOPNOTSUPP;
>
> An unreadable clock?
>
> I would think that we can require k_clocks to provide the read
> function. This could be checked and enforced in register_posix_clock().

Fair enough. Though, we should do that in a separate step.

Thanks,

tglx


\
 
 \ /
  Last update: 2011-02-02 10:57    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site