Expected output of zdump(8)
Greetings, I was wondering why zdump(8) was so slow on one of my machines. It's a known issue, old zdump.c code. So I grabbed a copy of the new zdump.c from tzcode2008a. But it raised a couple of questions for me. On a 32 bit machine running FreeBSD 6.3 I get this: (/etc/localtime is /usr/share/zoneinfo/Australia/Sydney) [~/tzcode] edwin@k7>./zdump -v /etc/localtime /etc/localtime Fri Dec 13 20:45:52 1901 UTC = Sat Dec 14 06:45:52 1901 EST isdst=0 /etc/localtime Sat Dec 14 20:45:52 1901 UTC = Sun Dec 15 06:45:52 1901 EST isdst=0 /etc/localtime Sun Dec 31 14:00:59 1916 UTC = Mon Jan 1 00:00:59 1917 EST isdst=0 /etc/localtime Sun Dec 31 14:01:00 1916 UTC = Mon Jan 1 01:01:00 1917 EST isdst=1 [...] /etc/localtime Sat Oct 3 15:59:59 2037 UTC = Sun Oct 4 01:59:59 2037 EST isdst=0 /etc/localtime Sat Oct 3 16:00:00 2037 UTC = Sun Oct 4 03:00:00 2037 EST isdst=1 /etc/localtime Mon Jan 18 03:14:07 2038 UTC = Mon Jan 18 14:14:07 2038 EST isdst=1 /etc/localtime Tue Jan 19 03:14:07 2038 UTC = Tue Jan 19 14:14:07 2038 EST isdst=1 On a 64 bit machine running FreeBSD 6.3 I get this: [~/tzcode] edwin@mavetju.org>./zdump -v /etc/localtime /etc/localtime -9223372036854775808 = NULL /etc/localtime -9223372036854689408 = NULL /etc/localtime Sun Dec 31 14:00:59 1916 UTC = Mon Jan 1 00:00:59 1917 EST isdst=0 gmtoff=36000 /etc/localtime Sun Dec 31 14:01:00 1916 UTC = Mon Jan 1 01:01:00 1917 EST isdst=1 gmtoff=39600 [...] /etc/localtime Sat Oct 3 15:59:59 2037 UTC = Sun Oct 4 01:59:59 2037 EST isdst=0 gmtoff=36000 /etc/localtime Sat Oct 3 16:00:00 2037 UTC = Sun Oct 4 03:00:00 2037 EST isdst=1 gmtoff=39600 /etc/localtime 9223372036854689407 = NULL /etc/localtime 9223372036854775807 = NULL That big positive and negative number is the effect of gmtime(). I got the same results on the 64 bit version of Linux FC6. Now my question is... Is this behaviour "as expected" and the same on other 64 bit operating systems like Solaris, MacOS/X and others (if you have one name it :-) ? Edwin -- Edwin Groothuis | Personal website: http://www.mavetju.org edwin@mavetju.org | Weblog: http://www.mavetju.org/weblog/
This is the expected behavior on systems where time_t's are 64 bits and ints are 32 bits; the year associated with the most negative (or most positive) 64-bit value won't fit into 32 bits, eventually leading to the NULL result. --ado -----Original Message----- From: Edwin Groothuis [mailto:edwin@mavetju.org] Sent: Friday, March 28, 2008 7:53 AM To: tz@lecserver.nci.nih.gov Subject: Expected output of zdump(8) Greetings, I was wondering why zdump(8) was so slow on one of my machines. It's a known issue, old zdump.c code. So I grabbed a copy of the new zdump.c from tzcode2008a. But it raised a couple of questions for me. On a 32 bit machine running FreeBSD 6.3 I get this: (/etc/localtime is /usr/share/zoneinfo/Australia/Sydney) [~/tzcode] edwin@k7>./zdump -v /etc/localtime /etc/localtime Fri Dec 13 20:45:52 1901 UTC = Sat Dec 14 06:45:52 1901 EST isdst=0 /etc/localtime Sat Dec 14 20:45:52 1901 UTC = Sun Dec 15 06:45:52 1901 EST isdst=0 /etc/localtime Sun Dec 31 14:00:59 1916 UTC = Mon Jan 1 00:00:59 1917 EST isdst=0 /etc/localtime Sun Dec 31 14:01:00 1916 UTC = Mon Jan 1 01:01:00 1917 EST isdst=1 [...] /etc/localtime Sat Oct 3 15:59:59 2037 UTC = Sun Oct 4 01:59:59 2037 EST isdst=0 /etc/localtime Sat Oct 3 16:00:00 2037 UTC = Sun Oct 4 03:00:00 2037 EST isdst=1 /etc/localtime Mon Jan 18 03:14:07 2038 UTC = Mon Jan 18 14:14:07 2038 EST isdst=1 /etc/localtime Tue Jan 19 03:14:07 2038 UTC = Tue Jan 19 14:14:07 2038 EST isdst=1 On a 64 bit machine running FreeBSD 6.3 I get this: [~/tzcode] edwin@mavetju.org>./zdump -v /etc/localtime /etc/localtime -9223372036854775808 = NULL /etc/localtime -9223372036854689408 = NULL /etc/localtime Sun Dec 31 14:00:59 1916 UTC = Mon Jan 1 00:00:59 1917 EST isdst=0 gmtoff=36000 /etc/localtime Sun Dec 31 14:01:00 1916 UTC = Mon Jan 1 01:01:00 1917 EST isdst=1 gmtoff=39600 [...] /etc/localtime Sat Oct 3 15:59:59 2037 UTC = Sun Oct 4 01:59:59 2037 EST isdst=0 gmtoff=36000 /etc/localtime Sat Oct 3 16:00:00 2037 UTC = Sun Oct 4 03:00:00 2037 EST isdst=1 gmtoff=39600 /etc/localtime 9223372036854689407 = NULL /etc/localtime 9223372036854775807 = NULL That big positive and negative number is the effect of gmtime(). I got the same results on the 64 bit version of Linux FC6. Now my question is... Is this behaviour "as expected" and the same on other 64 bit operating systems like Solaris, MacOS/X and others (if you have one name it :-) ? Edwin -- Edwin Groothuis | Personal website: http://www.mavetju.org edwin@mavetju.org | Weblog: http://www.mavetju.org/weblog/
participants (2)
-
Edwin Groothuis -
Olson, Arthur David (NIH/NCI) [E]