Re: time_t timezone

From: Reini Urban <rurban(at)x-ray(dot)at>
To: pgsql-patches(at)postgresql(dot)org
Subject: Re: time_t timezone
Date: 2004-09-01 14:47:16
Message-ID: 4135E0F4.3050101@x-ray.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-cygwin pgsql-patches

Bruce Momjian schrieb:
> I am inclined to leave the #ifdef Cygwin test in the code rather than
> add a configure check.

No,
There are a lot of other systems with time_t timezone!

newlib explains it like this:
/* defines for the opengroup specifications Derived from Issue 1 of the
SVID. */
extern __IMPORT time_t _timezone;
extern __IMPORT int _daylight;
extern __IMPORT char *_tzname[2];

SVID (System V Interface Definition) seems to be an interesting spec,
which I found here:
http://www.caldera.com/developers/devspecs/vol1a.pdf
(nothing about the type of timezone though)

But the time_t timezone issue is here:
"XSHd7 Aardvark Change Request Report"
http://www.opengroup.org/austin/docs/austin_97.txt
(ERN 20 Accept as marked, page 1177)

SUSV2 only defines it as long int
http://www.opengroup.org/onlinepubs/007908799/xsh/timezone.html

Caldera, redhat and IRIX 6.2 at least use time_t
http://uw713doc.sco.com/en/man/html.3C/ctime.3C.html

http://www.opensource.apple.com/darwinsource/10.0.4/tcl-3.1/tcl/unix/tcl.m4

Please google for "time_t timezone" and the accompanying autoconf .m4
files. tcl.m4 could be quite useful, if you don't like my hack.
php also uses time_t and not long int.

PS: For compatibility newlib has:
#ifdef __CYGWIN__
#ifdef timezonevar
#ifndef timezone
#define timezone ((long int) _timezone)
#endif
#endif

Looks like we only have to define timezonevar in our hint,
eh Makefile.port, but then the other platforms will loose.

> ---------------------------------------------------------------------------
>
> Reini Urban wrote:
>>Tom Lane schrieb:
>>>Reini Urban <rurban(at)x-ray(dot)at> writes:
>>>
>>>>Added configure time_t timezone check for the SUSV definition.
>>>
>>>Kindly do not claim that this is per SUS spec.
>>>http://www.opengroup.org/onlinepubs/007908799/xsh/timezone.html
>>
>>oops! sorry :(
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/

In response to

Responses

Browse pgsql-cygwin by date

  From Date Subject
Next Message Tom Lane 2004-09-01 15:03:57 Re: time_t timezone
Previous Message Bruce Momjian 2004-09-01 13:05:34 Re: time_t timezone

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2004-09-01 15:03:57 Re: time_t timezone
Previous Message Bruce Momjian 2004-09-01 13:05:34 Re: time_t timezone