4 ms·
It's not just that "libc refuses to provide thread-safety" ... the POSIX standard specifies that these functions are non-reentrant.
by PaulDavisThe1st 2y ago
It's not just that "libc refuses to provide thread-safety" ... the POSIX standard specifies that these functions are non-reentrant.
- saagarjha 2y agoA conformant implementation can make a non-reentrant function actually safe under the hood for people that call into it erroneously. Unfortunately, there is no way to do this for getenv/setenv, because of the API they expose (specifically, when environ is accessed directly).