|
|
|
|
|
by hodgesrm
3401 days ago
|
|
Interesting article but I can't reproduce the behavior on Ubuntu 16.01 LTS. I don't have TZ set (or anything locale-related for that matter). Here are the library dependencies: $ ldd test
linux-vdso.so.1 => (0x00007ffd80baf000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f8844bf7000)
/lib64/ld-linux-x86-64.so.2 (0x00007f8844fbc000)
Any thoughts why the behavior would be different? |
|
The former is the "traditional" function which returns a pointer to a statically allocated, global "struct_tm". The latter is the thread-safe version receiving a pointer to a use-supplied "struct tm" as it's second argument.
with TZ set to Europe/Berlin, set to :/etc/localtime, or unset I never get a stat on anything. If I change it to tm = localtime()... One more reason to switch to the reentrant/thread-safe versions of those ugly library functions :-).Note, this is using glibc 2.24 under Arch.