2 ms·
Click bait title? GLibC is very clear about what is and what is not thread-safe. I looked at the article: They fell victim to the classic getenv()/setenv() tr
by throwaway2037 2y ago
Click bait title? GLibC is very clear about what is and what is not thread-safe. I looked at the article: They fell victim to the classic getenv()/setenv() trap. This has been blogged about many times. If you look at the man page for setenv():
Ref: https://man7.org/linux/man-pages/man3/setenv.3.html https://man7.org/linux/man-pages/man3/setenv.3.html
... it clearly says: "MT-Unsafe"
Also, there is a whole section about get/set env thread safety here (under "Other safety remarks -> env"):
https://man7.org/linux/man-pages/man7/attributes.7.html https://man7.org/linux/man-pages/man7/attributes.7.html