How to read cmos clock - what is gettimeofday reading?

phil hefferan wdef200 at
Fri Aug 20 07:55:45 UTC 2010

On Fri, Aug 20, 2010 at 5:17 AM, b. f. <bf1783 at> wrote:

> >To further confuse matters there appears to be a common misconception on
> the web
> >that the cmos time is automatically synced to system time on FreeBSD. This
> is
> >incorrect: see msg03414 on freebsd-hardware at
> The situation has changed in 8-STABLE and 9-CURRENT since the above
> message was written.  The timekeeping code was changed (by the person
> who wrote the message that you cited) to periodically (every
> machdep.rtc_save_period seconds) adjust the value of the rtc if ntp is
> used to update the system time, machdep.disable_rtc_set=0, and the rtc
> driver hasn't been disabled:
> atrtc_{get,set}time, now in /usr/src/sys/x86/isa/atrtc.c, could serve
> as a basis for your own code:
> There are of course *_rtc_{get,set}time variants for other
> architectures as well.
> Thanks for that.  I'll look at atrtc_gettime.

More information about the freebsd-hackers mailing list