Re: [HACKERS] Date/time on glibc2 linux

Поиск
Список
Период
Сортировка
От Thomas G. Lockhart
Тема Re: [HACKERS] Date/time on glibc2 linux
Дата
Msg-id 366F6011.AAA68CD5@alumni.caltech.edu
обсуждение исходный текст
Ответ на Re: [HACKERS] Date/time on glibc2 linux  (Oleg Broytmann <phd@sun.med.ru>)
Ответы Re: [HACKERS] Date/time on glibc2 linux  (Oleg Broytmann <phd@sun.med.ru>)
Re: [HACKERS] Date/time on glibc2 linux  (Oleg Broytmann <phd@sun.med.ru>)
Re: [HACKERS] Date/time on glibc2 linux  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] problem compiling with egcs 1.1.1
Следующее
От: The Hermit Hacker
Дата:
Сообщение: Re: [HACKERS] problem compiling with egcs 1.1.1