Steps realtime clock by specified delta.
Requested by: cy
Differential D27571
CLOCK_ADJUST_REALTIME kib on Dec 11 2020, 3:11 PM. Authored by Tags None Referenced Files
Subscribers None
Diff Detail
Event Timeline
Comment Actions nwtime.org need it to return the current time, i.e. clock_gettime() output atomically to avoid the expense of making another system call. Adding a clock_id satisfies one of the two requirements. I suppose current time could be returned in *ts upon return.
Comment Actions Ok I did this hack, the time fetched right after tc_windup(), under the same spinlock region, is copyied out to *tp. One wrinkle is that clock_settime() takes const struct timespec *, not sure how wrong it feels.
Comment Actions I expect Harlan Stenn and Juergen Perlinger to be satisfied with this. I'll check in with them and cc you.
Comment Actions Thanks kib! I think I'm happy with this now. I think cy is right, but I'll let him chase down the ntp folks. Comment Actions I started a new thread with the participants of the original email thread and added kib@ to it. Waiting for their replies. Comment Actions Add clock_settime_adjust(3). It is a trick to hide constness of the struct timespec * argument of clock_settime(2). It is implemented as a trivial wrapper over clock_settime(CLOCK_ADJUST_REALTIME). Comment Actions Extract the limit checks into steplimit() and apply them in the relative case as well. Comment Actions Looks good. But I suggest holding off committing this until Juergen or Harlan sign off on this. They're the people who asked for it. They're trying to work around issues where VMware VMs are starved of resources and ntp needs to make big adjustments to catch up the clock after a VM has not executed for a number of seconds or minutes. Comment Actions CLOCK_ADJUST_REALTIME now returns clamped adjustment instead of abs time. |