[tz] Thread-safe localtime(3) (was Re: Reading binary files)

walter harms wharms at bfs.de
Thu Nov 3 08:21:47 UTC 2011

Am 02.11.2011 21:20, schrieb Alan Barrett:
> On Wed, 02 Nov 2011, Bennett Todd wrote:
>> That sounds all superb, and excellent. The one question I'd ask is,
>> would it be practical and reasonable to lose the _z and _rz suffixes,
>> and make the timezone arg an optional extra arg to localtime/mktine,
>> with varargs?
> There's a long history of using "_r" a suffix for "re-entrant" or
> "thread safe" versions of functions.  Using "_z" for functions that take
> an explicit timezone argument is new, but seems to fit the established
> pattern.
> varargs functions need a way of knowing whether or not more arguments
> are present.  How would you do that?
> --apb (Alan Barrett)

glibc already has localtime_r() also the other functions are covered.
NTL it would be nice to have a reference implemtation, here also.
Since POSIX has defined an API (http://pubs.opengroup.org/onlinepubs/9699919799/functions/localtime.html).
The party is over.

What still is needed are localtime zones.


More information about the tz mailing list