Subject: Re: settimeofday() versus interval tim{ers,ing}
To: Jonathan Stone <jonathan@dsg.stanford.edu>
From: Jim Reid <jim.reid@eurocontrol.be>
List: tech-kern
Date: 10/01/1996 13:09:31
>>>>> "Jonathan" == Jonathan Stone <jonathan@DSG.Stanford.EDU> writes:

    Jonathan> I'm still not really clear if Dennis Ferguson's original
    Jonathan> proposal was intended to address such a situation, or if
    Jonathan> it's intended to (for example) behave robustly when
    Jonathan> someone is calling settimeofday() on an continual basis,
    Jonathan> to tweak the system clock into agreement with
    Jonathan> UTC. (Like, oh, the HP-UX adjtime daemon is reported to
    Jonathan> do)

The HP adjtimed doesn't call settimeofday(). It pokes around /dev/kmem
patching an undocumented clock tick variable that the real time clock
interrupt routine uses to maintain the time of day. Patching the
variable on the fly allows the tick value to be changed so that the
TOD clock can be advanced or retarded as necessary. The adjtime()
system call does the same thing, only with a bit more subtlety...