4 ms·
The post is about getaddrinfo() specifically. It just struck me as odd to call that one out when there are far more common C library calls that use getenv().
by kentonv 3y ago
The post is about getaddrinfo() specifically. It just struck me as odd to call that one out when there are far more common C library calls that use getenv().
- j16sdiz 3y agoThey did a post on mktime() But, yes, in general for libc, if the manpage didn't say it's thread-safe, it is unsafe.
- defrost 3y agoThere's a strong tendency to think of network calls as entirely universal and not tied in any way to to locale settings in the environment. Time, date, physical spellings, ... many things are locale dependant, but socket stuff?. It comes as a Surprise!!, and not the good kind, to many a network programmer with just a few years under their belt to discover threaded networking can segfault because of this. Once you know, you know and don't forget (until next time), but I suspect this was the motivation behind the blog posting, the principal of potentially most surprise.