3 ms·
I think setenv() will use malloc() (it might use mutexes), same for error printing if it uses printf() or perror(). Also, this is all mess if fork() is called
by jagrsw 5y ago
I think setenv() will use malloc() (it might use mutexes), same for error printing if it uses printf() or perror().
Also, this is all mess if fork() is called from a multi-threaded context. Esp. via clone(), which up to certain glibc() version cached getpid() result, and returned parent'd PID in the child (for performance reasons of course ;).