Mail Archives: djgpp/1994/08/26/06:56:11
Well, thanks to gdb I finally managed to figure out why TZ=EST5EDT (or
any XXXNYYY setting) fails. Not a problem with the library itself, really:
Some support files are missing.
The tzset() function in libsrc/c/gen/ctime.c calls tzparse() which in
turn calls tzload(). tzload() is expected to load the timezone rules
file, from a file named /usr/share/zoneinfo/<timezone-name>. (The
directory is defined in include/tzfile.h, as TZDIR). Few people have a
file called /usr/share/zoneinfo/EST5EDT on a DOS system. so tzload()
fails.
tzparse() - which parses the TZ specification - does all the right things,
computing correct values for the standard offset and DST offset. It then
sees that tzload() failed, and aborts in line 773. Net result: All time
functions use localtime, as if TZ=GMT0.
I guess there isn't much that can be done about this. Distributing
zoneinfo files with DJGPP seems a bit much; picking a default rule to
apply when none is specified in the TZ setting is bound to fail on
some systems - the very reason for the zoneinfo files being that DST
changes are not universally coordinated.
Unfortunate, but I can live with having to use a POSIX TZ setting.
--
Henrik Storner | "Man is the best computer we can put aboard a space-
(storner AT olicom DOT dk) | craft ... and the only one that can be mass produced
System Engineering | with unskilled labor."
Olicom Denmark | Wernher von Braun
- Raw text -