Evan Jones personal blog

Setenv Is Not Thread Safe and C Doesn't Want to Fix It

You can't safely use the C setenv() or unsetenv() functions in a program that uses threads. Those functions modify global state, and can cause other threads calling getenv() to crash. This also causes crashes in other languages that use those C standard library functions, such as Go's os.Setenv ( Go issue ) and Rust's…
Points
204
HN comments
326
Submissions
1
Cited by
4 commenters

Software EngineeringSystems & Performance2023

On Hacker News

SubmittedTitle on HNPointsComments
Nov 20, 2023Setenv Is Not Thread Safe and C Doesn't Want to Fix It by r4um204326

Cited in comments

Linked from 4 Hacker News comments by 4 different people, from Nov 2024 to May 2025.

Most recent:

Search every comment that links here →

More from Evan Jones

All 11 posts →

Related posts from the same era