lkml.org 
[lkml]   [2011]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH V8 02/13] ntp: add ADJ_SETOFFSET mode bit
Fromjohn stultz <>
DateMon, 10 Jan 2011 13:06:37 -0800
On Tue, 2011-01-11 at 05:45 +0900, Kuwahara,T. wrote:
> On Tue, Jan 11, 2011 at 1:49 AM, john stultz <johnstul@us.ibm.com> wrote:
> > Leapsecond processing is done via an absolute hrtimer. Thus when the
> > time offset is set, the hrtimers that should have expired will fire
> > (just like with settimeofday) and the adjustment will then be made.
>
> How do you convert relative time to absolute time? It's not trivial
> because TAI offset is also a variable.

I don't believe I understand what you're getting at.

The proposed interface is almost identical in functionality to a
userland application doing the following:

offset = my_calculate_offset();
clock_gettime(CLOCK_REALTIME, &now);
newtime = my_add_ts(now, offset);
settimeofday(&newtime, 0);

The only difference is that you avoid the error from the delay between
the gettime call and the settime call. It just adds the offset directly
to the CLOCK_REALTIME.


thanks
-john





\
 
 \ /
  Last update: 2011-01-10 22:09    [from the cache]
©2003-2010