2 ms·
Something like windows CreateProcess or posix_spawn(). fork() plays havoc with threads. If you want to start a new process, specify a fresh process image.
by bitwize 4y ago
Something like windows CreateProcess or posix_spawn().
fork() plays havoc with threads. If you want to start a new process, specify a fresh process image.
- matu3ba 4y agoso does posix_spawn, since you can leak file descriptors into parallel spawning threads/processes before the execve (where they are closed if having O_CLEXEC).
- lgg 4y agoYeah, that is a problem, and it is totally fixable. Checkout `POSIX_SPAWN_CLOEXEC_DEFAULT` on macOS for an example. Again, just because there are API deficiencies doesn't mean that the idea is wrong.
- sylware 4y agolinux clone?