GMTIME ()localtime () Are Not thread-Safe

xiaoxiao2021-03-06  42

man 3 localtimeNOTES The four functions acstime (), ctime (), gmtime () and localtime () return a pointer to static data and hence are not thread-safe. Thread-safe versions acstime_r (), ctime_r (), gmtime_r () And localtime_r () Are specified by Susv2, And Available Since Libc 5.2.5.

The Glibc Version of Struct TM Has Additional Fields

Long TM_GMTOFF; / * SECONDS EAST OF UTC * / Const Char * TM_TM_ZONE; / * TIMEZONE ABBREVIATION * /

转载请注明原文地址:https://www.9cbs.com/read-55274.html

New Post(0)