2 ms·
environment variables can change while the process is running and are not memory safe (though I suspect node tries to wrap it with a lock). Meaning if you check
by withinboredom 6mo ago
environment variables can change while the process is running and are not memory safe (though I suspect node tries to wrap it with a lock). Meaning if you check a variable at point A, enter a branch and check it again at point B ... it's not guaranteed that they will be the same value. This can cause you to enter "impossible conditions".
- efskap 6mo agoWait, is it expected for them to be able to change? According to this SO answer [0] it's only really possible through GDB or "nasty hacks" as there's no API for it. [0] https://unix.stackexchange.com/questions/38205/change-environment-of-a-running-process https://unix.stackexchange.com/questions/38205/change-enviro...
- withinboredom 6mo agoThe process itself (including other threads) can call setenv whenever it wants.