3 ms·
You shouldn't call setenv in the first place. Instead, use a new environment when you call execle/execvpe. This avoids problems with multiple threads.
by amelius 3y ago
You shouldn't call setenv in the first place. Instead, use a new environment when you call execle/execvpe. This avoids problems with multiple threads.
- pdw 3y agoSome APIs require the use of setenv. For example, you need to setenv("TZ", ...) if you want to use multiple timezones.
- amelius 3y agoYou mean linked libraries you don't have the source of? Yes, in that case set the environment vars as early as possible (if possible before starting any thread).