Re: [HACKERS] Date/time on glibc2 linux

From: "Thomas G(dot) Lockhart" <lockhart(at)alumni(dot)caltech(dot)edu>
To: phd(at)sun(dot)med(dot)ru
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Date/time on glibc2 linux
Date: 1998-12-10 05:45:53
Message-ID: 366F6011.AAA68CD5@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message The Hermit Hacker 1998-12-10 06:01:41 Re: [HACKERS] problem compiling with egcs 1.1.1
Previous Message Bruce Momjian 1998-12-10 04:01:58 Re: [HACKERS] problem compiling with egcs 1.1.1