On 2012-06-28 12:09, Mark Benson wrote:
That's a UNIX tradition I think, lot of UNIXs I have used (IRIX,
Solaris, NetBSD to name a few) return the 'preposterous value in Time
if Day clock' or similar error if the date wrong. I think it's
triggered if the system date is prior to the kernel's date :)
It is triggered by the setting of the todr at boot time. In principle, it picks the mtime
of / to get a rough estimate of what time it is at boot time. It's done in inittodr,
which is called from ufs_mount.
inittodr checks if the date is before 1975, and if it is, the it's preposterous.
So, a simple way to trigger this error message would be to just set the date to sometime
in 1972, shut down the system, and then reboot.
The initial time for a booted system should thus always be just following the last time
the machine was shut down. This is then updated by the todr, if it exists, and have a
valid value. But since the todr only is a running time that covers about 1.5 years, it
cannot really tell the full time. But assuming you got it almost right (within 6 months or
so), todr can then adjust the rest.
The code in current NetBSD is i principle identical to Ultrix, so the same is probably
still true for all modern Unixes (I don't know about Linux though).
Johnny
--
Johnny Billquist || "I'm on a bus
|| on a psychedelic
trip
email: bqt at softjar.se || Reading murder books
pdp is alive! || tryin' to stay hip" -
B. Idol
Show replies by date