Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reland "macos: use posix_spawn instead of fork" (libuv#3257)
Fixes: libuv#3050 Refs: libuv#3086 Refs: libuv#3064 Refs: libuv#3107 Refs: libuv#3064 This reverts commit 217fdf4, then fixes several issues with it: * remove error fast-cleanup code that triggers a nodejs bug Refs: libuv#3107 (comment) * protect posix_spawn from EINTR This is not a documented valid error, but seems to have been observed. * ignore setuid/setgid syscall This kernel function is not permitted unless the process is setuid root, so disable this syscall. Falling back to fork/exec should be okay for the rare cases that the user decides they need to do setuid(getuid()) or setuid(geteuid()) for the child. Refs: libuv#3107 (comment) * improve posix_spawn path search Ports the improvements in musl back to this function * fix some additional problems and formatting issues We previously might fail to start a watcher, in rare failure cases, resulting in a zombie that we would fail to kill. Also avoid creating the signal-pipe unless required (addresses a review comment from Apple) * fix fd->fd mapping reuse There was a chance that when duplicating the fd's into stdio_count+fd we might be closing a currently opened fd with that value.
- Loading branch information