cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: systems with 64bit time_t?

From: Tor Arntsen <tor_at_spacetec.no>
Date: Tue, 8 Mar 2005 16:52:48 +0100

On Mar 8, 14:18, Daniel Stenberg wrote:
>I found it very strange that the 64bit build you provided at
>
> http://curl.haxx.se/auto/log.cgi?id=20050308114018-24521
>
>... gets a -1 in the final date conversion. The x86_64 fix Gwenole Beauchesne
>did assume that it would instead return 3939840000 - since there's no year
>2038 limit when time_t is > 32 bits.
>
>So, if you manage to get the builds sorted out, it would be very interesting
>to know if you can figure out why curl_getdate() returns -1 when passed in
>"2096 Nov 6" ...

The mktime() function returns (time_t)-1 in this case, no matter what
(32-bit or 64-bit mode). The AIX manpage doesn't mention 64-bit mode at all,
it simply says:

    Note: The mktime subroutine cannot convert time values before 00:00:00 UTC,
    January 1, 1970 and after 03:14:07 UTC, January 19, 2038.

I have tested and verified that this holds true in 32- as well as 64-bit mode,
and that sizeof(time_t) is 8 bytes in 64-bit mode.

It looks like there's no saving from the 2038 meltdown even with 64 bits..

-Tor
Received on 2005-03-08