[tz] NetBSD and Android bionic APIs for tz values

Christos Zoulas christos at zoulas.com
Sun Aug 17 05:57:12 UTC 2014

On Aug 16,  6:07pm, eggert at cs.ucla.edu (Paul Eggert) wrote:
-- Subject: NetBSD and Android bionic APIs for tz values

| * The NetBSD API's declarations confused about 'const'.  Several 
| functions take arguments of type 'const timezone_t' but the const does 
| not have the intended meaning: it declares the argument to be a constant 
| pointer to non-constant data, which means the 'const' is irrelevant to 
| the caller and is ignored by the API.  The simplest fix is to remove the 
| 'const's from the API's declarations.
I agree.

| * The arguments of localtime_rz and mktime_z should all be 
| restrict-qualified, for the same reason that localtime_r's arguments are 
| restrict-qualified.


| * ctime and ctime_r have been deprecated by POSIX due to their security 
| issues, and ctime_rz has the same issues, so I suggest deprecating 
| ctime_rz in NetBSD, and the tz code should not support it.  Callers can 
| use strftime instead.

Yes, and we could supply a constant that has the traditional ctime semantics.

| * tzgetname doesn't work for time zones that have three or more 
| abbreviations.  Plus, tzgetname is redundant since callers can instead 
| use localtime_rz + strftime %Z, an approach that works even with three 
| or more abbreviations.  Again, I suggest deprecating tzgetname in 
| NetBSD, and the tz code should not support it.

Or fix it...

| I don't know whether these NetBSD issues are something Christos can fix 
| directly or whether we need to file NetBSD bug reports or whatever.

I can fix those directly. Would you like to supply patches?



More information about the tz mailing list