Re: Linux 2.0 & DST: RTC needs update!

Harald Koenig (koenig@tat.physik.uni-tuebingen.de)
Mon, 30 Mar 1998 18:10:54 +0200


On Mar 30, Ulrich Windl wrote:

> If your RTC (real time clock) runs local time (as opposed to UTC),
> there is a problem now that DST is active (at least here in Europe):
>
> The RTC still runs one hour behind (see cat /proc/rtc), even if your
> system time is correct. After a reboot your time will be one hour
> behind.
>
> Even if your clock is synchronized with xntpd (NTP), your hour is
> exactly one hour off, because the kernel code does not update the
> hour of the RTC. (see
> /usr/src/linux/arch/i386/kernel/time.c:set_rtc_mmss).
>
> Running "clock -w" helps.
>
> I hope that was not too old news for you. (I'm not subscribed)

since Ulrich didn't ask, I have to:

what about changing settimeofday() to set the RTC too ?

I thought of this before and the only problem/argument I could find
was that in kernel we don't know if the RTC runs localtime or UTC,
and if localtime which offset from UTC we need to set RTC correctly.

my idea is that we should use the 2nd argument of settimeofday():

we'd need one global kernel flag to specify if RTC runs UTC or localtime
(this can be set with sysctl, /proc/... or whatever), and then we could
use tz_minuteswest as offset for RTC whenever settimeofday() is used.

Harald

--
All SCSI disks will from now on                     ___       _____
be required to send an email notice                0--,|    /OOOOOOO\
24 hours prior to complete hardware failure!      <_/  /  /OOOOOOOOOOO\
                                                    \  \/OOOOOOOOOOOOOOO\
                                                      \ OOOOOOOOOOOOOOOOO|//
Harald Koenig,                                         \/\/\/\/\/\/\/\/\/
Inst.f.Theoret.Astrophysik                              //  /     \\  \
koenig@tat.physik.uni-tuebingen.de                     ^^^^^       ^^^^^

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu