Subject: Re: Q for i386 FAQ
To: None <port-i386@netbsd.org>
From: William O Ferry <WOFerry+@CMU.EDU>
List: port-i386
Date: 10/27/1998 11:31:35
Excerpts from internet.computing.netbsd.port-i386: 27-Oct-98 Q for i386
FAQ by Joel Reicher@panacea.nul 
> su to root
> gdb --write /netbsd (or whatever the kernel is called)
> set rtc_offset <new_offset>
> quit

    Excellent.  I'd definitely say throw this in the FAQ.  I did not
know you could set this variable (more or less) on the fly, and never
remember to rebuild the kernel on DST changes, so my Windows clock just
tends to be all over the place.  Now my clocks finally match...  =)

    Two related questions:  First off, I presume there's some reason why
NetBSD/i386 couldn't just keep the clock in the local time, and
back-calculate GMT from it? (even as a kernel option, for those of us
who use multiple OSes on our i386s and would rather not have to change
any values at all)  Second, on the reference to using sysctl to set the
value (which, BTW, the rtc_offset isn't listed in the sysctl(8) or
sysctl(3) manpages), do sysctl changes actually survive reboots?  I
guess I figured it played with the in-memory values, not actually
changing what was on disk.

    If sysctl's changes are permanent, I have the start of a C program
to set the sysctl variable based on the GMT offset of the current
timezone.  (i.e. if I run it now from my system in California, it would
set the offset to 480.  If I ran it a week ago it would set it to 420. 
I *think* these are the correct values...  =)

    Thanks.

                                                          Will Ferry