zlacker

[parent] [thread] 3 comments
1. bitwiz+(OP)[view] [source] 2022-09-10 21:36:38
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.

replies(2): >>matu3b+sc >>sylwar+8j
2. matu3b+sc[view] [source] 2022-09-10 23:52:35
>>bitwiz+(OP)
so 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).
replies(1): >>lgg+sl
3. sylwar+8j[view] [source] 2022-09-11 01:05:46
>>bitwiz+(OP)
linux clone?
◧◩
4. lgg+sl[view] [source] [discussion] 2022-09-11 01:36:15
>>matu3b+sc
Yeah, 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.
[go to top]