Messages in this thread | | | Date | Thu, 18 Sep 1997 09:52:47 -0400 | From | Philip Gladstone <> | Subject | Re: Two bugs in kernel time code |
| |
Rogier Wolff wrote: > > Philip Gladstone wrote: > > My revolting approach to this is to have a sysconfig variable that gives > > the offset of the CMOS clock from UTC. This defaults to 'unknown'. If it > > is known, then the CMOS clock is updated with the correct hour (etc) > > values. > > How about just calculating the difference between the unix clock and > the CMOS clock. If that's within 10 minutes of a whole number of hours, > then you can safely round it to "a whole number of hours".
My goal was to eliminate the 'clock -w' that you have to do occasionally.
There are two steps to this:
1) Fix settimeofday to set the CMOS clock. I do this if I know the cmos clock offset (in my systems, we run CMOS=GMT). Set all the fields in the clock.
[I use a minute offset field, with -1 being the 'unknown' value]
2) Do something mysterious with the clock warping code for backwards compatibility. [not done]
I could provide these patches if anybody is interested.
Philip
-- Philip Gladstone +1 617 487 7700 Raptor Systems, Waltham, MA http://www.raptor.com/
| |