Is standard C mktime thread safe on linux?
The man page of mktime didn't mention thread safety of mktime, but it did
mention this which make it look like thread unsafe:
Calling mktime() also sets the external variable tzname with information
about the current time zone.
I know on Linux mktime calls tzset to set tzname, which is a char*[]:
extern char *tzname[2];
and tzset will read environment variable TZ and file /etc/localtime. So
unless mktime uses a mutex to protect all these operations, I can't see
how it can be thread safe.
No comments:
Post a Comment