All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Cochran <richardcochran@gmail.com>
To: Bert Wesarg <bert.wesarg@googlemail.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] posix clocks: introduce syscall for clock tuning.
Date: Mon, 23 Aug 2010 10:55:26 +0200	[thread overview]
Message-ID: <20100823085526.GB18510@riccoc20.at.omicron.at> (raw)
In-Reply-To: <AANLkTi=Fa38ufwR8PDc+HBHmLT53eWRA0ofrobm0n9-w@mail.gmail.com>

On Mon, Aug 23, 2010 at 10:25:35AM +0200, Bert Wesarg wrote:
> On Mon, Aug 23, 2010 at 10:16, Richard Cochran <richardcochran@gmail.com> wrote:
> > diff --git a/kernel/compat.c b/kernel/compat.c
> > index 5adab05..df1e469 100644
> > --- a/kernel/compat.c
> > +++ b/kernel/compat.c
> > @@ -628,6 +628,26 @@ long compat_sys_clock_gettime(clockid_t which_clock,
> >        return err;
> >  }
> >
> > +long compat_sys_clock_adjtime(clockid_t which_clock, int ppb,
> > +               struct compat_timespec __user *tp)
> > +{
> > +       long err;
> > +       mm_segment_t oldfs;
> > +       struct timespec ts, *ptr = NULL;
> 
> Shouldn't ptr be initialized with tp?

It could be, but the logic turns out the same either way. The
semantics of the call is, if 'tp' is NULL, then adjust the frequency
by 'ppb', otherwise adjust clock time by 'tp'.

> 
> > +
> > +       if (tp) {
> > +               if (get_compat_timespec(&ts, tp))
> > +                       return -EFAULT;
> > +               ptr = &ts;
> > +       }
> > +       oldfs = get_fs();
> > +       set_fs(KERNEL_DS);
> > +       err = sys_clock_adjtime(which_clock, ppb,
> > +                               (struct timespec __user *) ptr);
> > +       set_fs(oldfs);
> > +       return err;
> > +}
> > +
> >  long compat_sys_clock_getres(clockid_t which_clock,
> >                struct compat_timespec __user *tp)
> >  {

  reply	other threads:[~2010-08-23  8:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-23  8:15 [PATCH RFC 0/1] introduce a syscall for posix clock tuning Richard Cochran
2010-08-23  8:16 ` [PATCH 1/1] posix clocks: introduce syscall for " Richard Cochran
2010-08-23  8:22   ` Mike Frysinger
2010-08-23  8:52     ` Richard Cochran
2010-08-23  8:25   ` Bert Wesarg
2010-08-23  8:55     ` Richard Cochran [this message]
2010-08-23 12:57   ` Arnd Bergmann
2010-08-23 12:57     ` Arnd Bergmann
2010-08-23 13:43     ` Matthew Wilcox
2010-08-23 13:43       ` Matthew Wilcox
2010-08-23 14:46       ` Arnd Bergmann
2010-08-23 14:46         ` Arnd Bergmann
2010-08-23 16:57         ` Roland McGrath
2010-08-23 20:41     ` john stultz
2010-08-27 11:24       ` Richard Cochran
2010-08-27 11:24         ` Richard Cochran
2010-08-27 20:48         ` John Stultz
2010-08-27 20:48           ` John Stultz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100823085526.GB18510@riccoc20.at.omicron.at \
    --to=richardcochran@gmail.com \
    --cc=bert.wesarg@googlemail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.