boottime & basetime

Paul Herman pherman at frenchfries.net
Sat Nov 27 14:20:04 PST 2004


Hey guys,

This issue is related to <20040403034659.GA14486 at xxxxxxxxxx> posted 
to bugs@ in April.  This morning, 13 minutes after rebooting:

   su-2.05b# date && uptime && sysctl kern.boottime kern.basetime
   Sat Nov 27 10:01:33 PST 2004
   10:01AM  up 13 mins, 2 users, load averages: 0.00, 0.00, 0.00
   kern.boottime: { sec = 1101577730, usec = 0 } Sat Nov 27 09:48:50 2004
   kern.basetime: { sec = 1101577740, usec = 56529645 } Sat Nov 27 09:49:00 2004
   su-2.05b# date && ntpdate -b 192.168.1.11 && uptime
   Sat Nov 27 10:01:34 PST 2004
   27 Nov 10:01:34 ntpdate[668]: step time server 192.168.1.11 offset -0.003243 sec
   10:01AM  up 25 mins, 2 users, load averages: 0.00, 0.00, 0.00
   su-2.05b# date && uptime && sysctl kern.boottime kern.basetime
   Sat Nov 27 10:01:35 PST 2004
   10:01AM  up 25 mins, 2 users, load averages: 0.00, 0.00, 0.00
   kern.boottime: { sec = 1101576985, usec = 0 } Sat Nov 27 09:36:25 2004
   kern.basetime: { sec = 1101577740, usec = 53271761 } Sat Nov 27 09:49:00 2004
In other words, calling set_timeofday() (re)sets boottime to
"now - 2*uptime".  In other other words, uptime will show double 
your real uptime after settimeofday() is called.

Reverting kern_clock.c:1.19 solves this, but then basetime is 
allways boottime... which 1.19 changed.  I guess the question is: 
what *are* basetime and boottime (supposed to be)?

-Paul.





More information about the Bugs mailing list