Kalle,

Calling settimeofday() is completely transparent to the kernel and ntpd state variables, including the UNSYNC bit; however, the actions in Linux might violate this design. Setting the RTC is a byproduct of settimeofday(), but in general setting the time to the current time is a no-op, at least to within 800 microseconds in a 1986 SPARC IPC running SunOS 4, but much less in modern times. See the comments at about line 228 in ntp_util.c; note the code is enabled by the DOSYNCTODR define.

If there is a more generic way to set the RTC over all or most operating systems, it should be reconsidered. The Linux folks are invited to contribute #ifdefs as necessary. As it is, the current code goes back to SunOS circa 1986.

Dave

Kalle Pokki wrote:

On Sat, Jun 26, 2010 at 11:48, David Woolley
<da...@ex.djwhome.demon.invalid> wrote:

I think you missed Dave Mills' point that ntpd does this every 60 minutes,
so will also break mechanisms for compensating for RTC drift whilst the
processor is powered down.

I don't understand.

Settimeofday() isn't about updating the RTC. It updates the system
clock. Why would ntpd call that regularly and cause unnecessary jumps
in system time?

Calling settimeofday() also clears all NTP state variables inside the
kernel and sets the UNSYNC bit.
_______________________________________________
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions

_______________________________________________
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions

Reply via email to