3 ms·
I'm really curious why they're using setenv(3) so much. The main usages that I can think of is setting an environment variable before calling something like exe
by WhyNotHugo 2y ago
I'm really curious why they're using setenv(3) so much. The main usages that I can think of is setting an environment variable before calling something like exec(3). That doesn't seem to be the case here.
The article mentions that they use exevpe for spawning children processes. So what usages of setenv(3) would remain?
- Tobu 2y agoIt is possible to check for setenv/unsetenv/putenv with nm -D, and a quick sample of my ~/.cargo/bin/* shows far too many programs using those. Yeah they could be single threaded, but who can guarantee they will remain so? Come to think of it listing symbols could detect pthread_create as well. I'd be interested in a way to do static binary analysis to get from those symbols to a call tree, as well. I don't see a way to check for **environ usage though, the compiler could turn this one into anything.