Re: updating the RTC automagically

Ulrich Windl (ulrich.windl@rz.uni-regensburg.de)
Mon, 22 Nov 1999 16:02:26 +0200


On 22 Nov 99, at 15:05, Marc Lehmann wrote:

> On Mon, Nov 22, 1999 at 08:11:30AM +0200, Ulrich Windl <ulrich.windl@rz.uni-regensburg.de> wrote:
> >
> > For most machines it is sufficient to update the timezone information
> > twice a year.
>
> Yes, that's what the userspace deamon is for, namely finding out _when_ to
> switch the timezone.
>
> Or you do it in the kernel, which requires an elaborate setup (including
> the tzcode for example :()

Maybe some of the confusion arises, because the are actually two
timezones: Userland, to convert UTC to localtime, and kernelland to
convert UTC to RTC ;-) Both are "a bit related". I don't see why a
user program should have to mess with the RTC stuff, but we exchanged
arguments already.

[...]
> Yes, but most people I know just set their clock to utc. The time windows
> gets is usallly not important.

But many systems set the RTC while running Win*ooze. That will affect
Linux time then.

>
> Putting more than a hundred gzipped source into the kernel just to get the
> current timezone is out of the question (lest, you have to update that code
> regularly).

Never intended.

>
> Doing it that way is absolutely wrong. Write a userspace deamon to change
> the timezone, so people that really need the bloat can install it.

That was what I had in mind roughly.

>
> > > Now the question would be "how to inform the kernel about the timezone"?
> > > (And keep the info updated).
> >
> > sysctl, what else.
>
> Last I looked, sysctl is not able to recalculcate timezone offsets
> regularly and schedule a timer for the next update. AFAIK it can only set
> and get values in the kernel, no complex formulas.

Hmm.. signed offset of RTC from UTC, wouldn't that be enough?

>
> Oh sorry, I asked "timezone" not "timezone offset". However, as many
> people have pointed out, this would require the whole tzcode + tzdata in
> the kernel.

The offset is a plain number every instant of time. Occasionally it
changes, but this is not the kernels task to do that (the change).
The kernel just does what is has been told to do (update the RTC or
not, but do that correctly).

[...]

Ulrich

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/