Proposal: API for thread-safe time zone functions

Garrett Wollman wollman at khavrinen.lcs.mit.edu
Thu Jun 7 17:11:34 UTC 2001


<<On Thu, 7 Jun 2001 17:30:58 +0100 (BST), "Joseph S. Myers" <jsm28 at cam.ac.uk> said:

> * Design the proposal as an amendment for ISO C rather than POSIX.
> * Don't touch how timestamps are represented [...]
> * Provide a struct tm replacement with [...]
> * Use an C99 snprintf-style return value [...]

All of these suggestions are essentially orthogonal to the main issue
of re-entrant, thread-specific time conversions.  I suggest that
Mr. Lennox's proposal is much more likely to be gain concensus than
any changes to the underlying interfaces.

> * Provide four conversion functions: between time_t and broken down times,
> in either direction, and equivalents of strftime and wcsftime.

This seems to be sound advice.  This interface should also include the
equivalent of strptime() as well, assuming it can be adequately
specified.  Only the timezone code has adequate access to the
localization information needed to parse such times.

> * Provide specified timezone names for both the user's local timezone and
> the system's local timezone.

In the context of POSIX, there is no such distinction.  (Of course,
the timezone library is able to make a distinction.)

-GAWollman




More information about the tz mailing list