3 ms·
no, fork creates a new address space, vfork doesn't the posix_spawn mentioned in the article is effectively the equivalent of CreateProcess
by remexre 4y ago
no, fork creates a new address space, vfork doesn't
the posix_spawn mentioned in the article is effectively the equivalent of CreateProcess
- medoc 4y agoLast time I looked, posix_spawn() just called fork/exec
- int_19h 4y agoThat's an implementation detail at this point. The idea is to have a single syscall that takes all the information needed to spawn the process, and does so atomically, without the need to spread it across several calls. On Win32, that's CreateProcess(). On POSIX, the equivalent is posix_spawn().
- cryptonector 4y agoIn glibc it uses vfork() in some cases. In Solaris/Illumos it uses vfork() or vforkx(). In principle posix_spawn() can be a system call.
- comex 4y agoOn macOS it is a system call.