timezone code - re-entrancy issue
John Dlugosz
JDlugosz at TradeStation.com
Wed Jan 7 00:35:17 UTC 2009
At the bottom of localsub,
tzname[tmp->tm_isdst] = &sp->chars[ttisp->tt_abbrind];
I think this is to update the tzname string to the last time zone abbr.
actually used in to produce the tm values.
It is not re-entrant. This is called even by localtime_r, which may be
changing the values even as another thread (who called plain localtime)
is reading it. It also changes all the time as the "binary search" is
being done by mktime. That violates the "behaves as if never called"
rule, and putting it in a subroutine doesn't help there.
Am I missing something?
--John
More information about the tz
mailing list