Proposal: API for thread-safe time zone functions

Paul Eggert eggert at twinsun.com
Thu Jun 7 20:44:48 UTC 2001


> From: Jonathan Lennox <lennox at cs.columbia.edu>
> Date: Thu, 7 Jun 2001 15:15:59 -0400 (EDT)
> 
> > * Frankly, I don't know how POSIX functions like localtime_r are
> >   supposed to interact with setting the TZ variable.  It seems to me
> >   that the POSIX spec is unclear here.  This murk is not your fault,
> >   but it seems to me that if you want to address the thread problem
> >   that this issue should be made crystal clear in any thread-safe spec.
> 
> Hm.  What does tzcode do?

It doesn't worry about threads, so it mishandles this case: two
different threads can clobber the same internal structure.

I don't offhand know what other systems do.

> > * 'strptime_z' should be marked as being POSIX-only; it needn't be
> >   available on ISO-C-only systems.
> 
> Is strptime actually even POSIX?  I thought it was an extension.  Or has the
> Austin group added it?

Yes, it's in the latest draft.



More information about the tz mailing list