News for hackers. Stuff that matters.
Re:C stdlib isn't threadsafe and even safe Rust didn't save us by alkonaut on Thursday January 23, 2025 @04:50AM (#42802459)
There has to be some sort of nuance regarding why this seemingly simple fix hasn't been made yet. Changing from crashing to blocking doesn't seem like a big breaking change.
Re:C stdlib isn't threadsafe and even safe Rust didn't save us by account42 on Thursday January 23, 2025 @06:36AM (#42803021)
Because it doesn't actually solve anything: You're still replacing whatever getenv returned from under the nose the program code - if that happens in another thread or in a signal handler in the same thread doesn't make any difference.

And that's before you even get to the `extern char *environ` global.

Re:C stdlib isn't threadsafe and even safe Rust didn't save us by xxs on Thursday January 23, 2025 @06:50AM (#42803104)
B/c you never need setenv outside a single threaded command line utilities, and even then it's questionable.