[tz] NetBSD vs Darwin timezone API (was: tzdata2016g missing version info)

Guy Harris guy at alum.mit.edu
Fri Nov 11 02:47:47 UTC 2016

On Nov 10, 2016, at 2:44 PM, Paul Eggert <eggert at cs.ucla.edu> wrote:

> On 11/10/2016 02:04 PM, Guy Harris wrote:
>>> I don't see an easy way around this problem with the current Darwin API.
>> With the current*UNIX*  API.
> The NetBSD API gives applications a way to get an immutable time zone object, so that multiple operations like localtime_rz and mktime_z can use consistent rules. This was originally designed for multithreading (so that different threads can be in different time zones) but it also has the property that time zone rules don't change once determined (which helps performance). Emacs uses this API if available, so Emacs should be reasonably immune to these races on NetBSD.

Speaking of the NetBSD API, neither tzgetname() nor tzgetgmtoff() fully support the tzdb; they both appear to assume that, for any tzdb zone, there are such things as *the* abbreviation for standard or summer time and *the* offset from GMT for standard or summer time.

That's not the case for all tzdb zones - with the addition of all the Local Mean Time entries, is it true for *any* tzdb zones any more? - so if we were to provide similar APIs, they'd have to take something such as a time_t as an argument, rather than a "standard or summer time?" flag.

More information about the tz mailing list