From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <98570527412995.tru64-unix-managers.marc@archive.invalid> From: Arrigo Triulzi Date: Tue, 27 Mar 2001 15:00:52 +0000 To: tru64-unix-managers Subject: BUG: 4.0F/4.0G Libc tzset(3) X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=98570527412995 Dear all, there appears to be a bug in the libc definition of tzset(), both under 4.0F (PK#2 + NHDv3) and 4.0G (PK#2). According to the documentation for tzset(3) [man 3 tzset]: `` The external variable timezone is set to the difference, in seconds, between Coordinated Universal Time (UTC) and local standard time. For example: TZ timezone EST 5*60*60 GMT 0*60*60 JST -9*60*60 MET -1*60*60 MST 7*60*60 PST 8*60*60 '' This does not appear to be the case: /* tzset-test.c */ #include #include #include main() { char *timezone="TZ=GMT0"; putenv(timezone); tzset(); printf("daylight=%d\ntimezone=%ld\ntzname[0]=%s\ntzname[1]=%s\n", daylight, timezone, (tzname[0] ? tzname[0] : "NULL"), (tzname[1] ? tzname[0] : "NULL")); exit(0); } terracotta:/tmp$ ./tzset-test daylight=0 timezone=5368709312 tzname[0]=GMT tzname[1]=GMT The timezone value should be 0 according to the man page. The remaining values are correct. Linux appears to have the same problem. umbra:/tmp$ ./tzset-test daylight=0 timezone=134514176 tzname[0]=GMT tzname[1]=GMT Does this mean that the timezone variable should not be trusted? Best Regards, Arrigo Triulzi -- Arrigo Triulzi Albourne Partners Ltd. - London, UK