Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's the entire point of the post and the earlier posts it links to.


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().


There'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.


They did a post on mktime()

But, yes, in general for libc, if the manpage didn't say it's thread-safe, it is unsafe.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: