Re: clockspeed and system time
[email protected] Fri, 21 Jan 2005 09:38:19 +0100
| Newsgroups | gmane.comp.lib.libtai |
|---|---|
| Message-ID | <[email protected]> |
On Thu, Jan 20, 2005 at 08:26:24PM -0500, Paul Jarc wrote:
> Use of a right/ timezone should correspond with the existence of
> /etc/leapsecs.dat. If you have /etc/leapsecs.dat, then clockspeed
> will give you a TAI clock, and you should use a right/ timezone to
> properly interpret the results of time().
Is this the reason for the "+22 seconds" hack you use in
<URL:http://multivac.cwru.edu./svscan-1/init>?
util-linux-2.12q, hwclock/hwclock.c
#v+
[...]
/* We use the C library function mktime(), but since it only works on
local time zone input, we may have to fake it out by temporarily
changing the local time zone to UTC.
*/
zone = getenv("TZ"); /* remember original time zone */
if (universal) {
/* Set timezone to UTC */
setenv("TZ", "", TRUE);
/* Note: tzset() gets called implicitly by the time code, but only the
first time. When changing the environment variable, better call
tzset() explicitly.
*/
tzset();
}
[...]
#v-
(Non-Linux system's hwclock equivavlents probably do similar things.)
TZ is set to '' (i.e. 'UTC'), whereas it should have been set to
'right/UTC'?
Wouldn't putting 'right/*' into '.../zoneinfo/' solve this problem and
the problems any other programs are having when using 'TZ=...', without
taking into consideration that 'TZ=right/...' should be used instead?
Why would one still need POSIX timezone data files if you use a TAI
clock?
Regards,
Thomas