3 ms·
The point was about adding a mutex inside libc in getenv and setenv. That way, every codebase in existence automatically gets this safety. The poster I was repl
by tsimionescu 2y ago
The point was about adding a mutex inside libc in getenv and setenv. That way, every codebase in existence automatically gets this safety. The poster I was replying to claimed that this wouldn't help, because it would still not offer thread safety when doing multiple operations.
I pointed out that, in addition to libc setenv/getenv using a mutex internally, they could also expose new functions to allow transactional access for anyone that really needs it - though I suspect that is a vanishingly small minority.
- sunshowers 2y agoAh I see — in that case you might be interested in the lockless illumos impl https://github.com/illumos/illumos-gate/blob/master/usr/src/lib/libc/port/gen/getenv.c https://github.com/illumos/illumos-gate/blob/master/usr/src/...