This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC [PATCH] BZ#1077902: New API gettimezone


Carlos O'Donell wrote:
What's the problem and do we have a BZ open for this?

I don't know of a BZ.

The problem is that you're running a multithreaded server and you want to output a time stamp in the client's time zone. With glibc, that's a pain, since the TZ setting is process-wide, and if one of your threads sets TZ='Europe/Moscow' (say), then all your threads are affected.

NetBSD addresses this by having functions like localtime_rz, which is like localtime_r except with an extra timezone_t argument. There are extra functions like tzalloc to create timezone_t objects. I don't know of any other system with these primitives other than Minix 3, which uses this part of NetBSD userland. See:

http://netbsd.gw.com/cgi-bin/man-cgi?localtime_r++NetBSD-current

It's been proposed to add these functions to the public-domain timezone code hosted by IANA, but nobody's gotten around to doing that yet.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]