Greetings, I've checked the past few versions of tzcode1998?.tar.gz and all seem to code localtime_r() without a call to tzset(). This doesn't seem right. don.
Date: Wed, 07 Oct 1998 14:23:03 -0700 From: Donald Johnson <djohnson@mdsi.bc.ca> I've checked the past few versions of tzcode1998?.tar.gz and all seem to code localtime_r() without a call to tzset(). This doesn't seem right. localtime_r is thread-safe, tzset isn't. This is why the POSIX.1-1996 standard (section 8.3.7.2 page 223 line 654) says that localtime_r needn't set tzname, and why it says (section 8.1.1 page 207 line 115) that localtime must invoke tzset, but localtime_r doesn't need to. That being said, it is a bit odd that localtime_r doesn't invoke tzset if tzset has never been invoked before. I suspect that this is because doing it in a thread-safe way requires that localtime_r's invocation of tzset be surrounded by a mutex, and there's no mutex interface currently in the code.
participants (2)
-
Donald Johnson -
Paul Eggert