Why does localtime() call tzset() but localtime_r() not?

Jonathan Leffler jonathan.leffler at gmail.com
Fri Jan 11 05:46:24 UTC 2008


Actually, the subject pretty much says it all.
In tzcode2007k (also in 2007h), the code in localtime.c is:

struct tm *
localtime(const time_t *const timep)
{
    tzset();
    return localsub(timep, 0L, &tm);
}

struct tm *
localtime_r(const time_t *const timep, struct tm *tmp)
{
    return localsub(timep, 0L, tmp);
}

I can't immediately see a justification for the asymmetry in the POSIX
specification of these functions, but I could be missing something.

-- 
Jonathan Leffler <jonathan.leffler at gmail.com>  #include <disclaimer.h>
Guardian of DBD::Informix - v2007.0914 - http://dbi.perl.org
"Blessed are we who can laugh at ourselves, for we shall never cease to be
amused."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm.icann.org/pipermail/tz/attachments/20080110/b6488c5d/attachment-0001.html 


More information about the tz mailing list