Re: [HACKERS] Date/time on glibc2 linux - Mailing list pgsql-hackers

From Thomas G. Lockhart
Subject Re: [HACKERS] Date/time on glibc2 linux
Date
Msg-id 366F6011.AAA68CD5@alumni.caltech.edu
Whole thread Raw
In response to Re: [HACKERS] Date/time on glibc2 linux  (Oleg Broytmann <phd@sun.med.ru>)
Responses Re: [HACKERS] Date/time on glibc2 linux
Re: [HACKERS] Date/time on glibc2 linux
Re: [HACKERS] Date/time on glibc2 linux
List pgsql-hackers
> I am sure this is related. When I edited config.h and commented out
> DATEDEBUG the sources compiled just fine.

So send my your config.h if you want someone to look at it.

> Any use for daylight or tzname or timezone (global vars) produces
> incorrect results.
> It looks like glibc2 defines these vars incorrectly. Correct values 
> are in struct tm (including tmzone and gmtoff).
> Do you think it is local problem? I am pretty sure it is 
> "system-wide".

The glibc2 is a thread-safe library, and I would expect that the *only*
place with reliable timezone info is in the tm structure. Global
variables are not to be trusted since they are not available in a
reentrant way.

If the tm structure contains the timezone info (as it claims to on my
RH5.1 glibc2 system) then for testing try to #undef HAVE_INT_TIMEZONE in
config.h and see how it goes. If I have a chance tomorrow I'll try doing
the same at work. I'm guessing that our configure tests look for the
global variable version first, and that the glibc2 passes that test even
though the other mechanism is the right one.
                     - Tom


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] problem compiling with egcs 1.1.1
Next
From: The Hermit Hacker
Date:
Subject: Re: [HACKERS] problem compiling with egcs 1.1.1