On 2024-06-06 14:30, Bruno Haible wrote:
OK. But how about the Linux man-pages?
*https://man7.org/linux/man-pages/man3/tzset.3p.html
is derived from POSIX and will be updated forPOSIX:2024, but
POSIX:2024 (p. 2310-2311) does not warn against these 3 variables.
*https://man7.org/linux/man-pages/man3/tzset.3.html
does not warn against these 3 variables either.
*https://man7.org/linux/man-pages/man3/tm.3type.html
says that "The tm_gmtoff field provides an alternative"
for systems without the 'timezone' variable. (Yes! Not the
other way around.)
Will you also write tolinux-...@vger.kernel.org ?
Done, and it's been fixed in man-pages 6.9, which now says this in
tzset.3 in a new CAVEATS section:
"Because the values of tzname, timezone, and daylight are often
unspecified, and accessing them can lead to undefined behavior in
multithreaded applications, code should instead obtain time zone offset
and abbreviations from the tm_gmtoff and tm_zone members of the
broken-down time structure tm(3type)."
I didn't see a need to update tm(3type), since this is in its VERSIONS
section which is talking about ancient history, but if you can see for
some improved wording there please feel free to follow up.
I added similar wording to the tzcode man pages, and this should appear
in the next TZDB release:
https://github.com/eggert/tz/commit/03fd9e45197e546652933981fc563267c2a0bb5b
I also updated the glibc manual to contain similar wording, and these
changes should appear in the next glibc release:
https://github.com/bminor/glibc/commit/ee768a30fe9099972dad04c49972c2508a208b9b