Comment by ComputerGuru

5 years ago

posix_spawn is just a wrapper that takes care of setting common parameters for newly forked instances (eg pgrp) and prevents you from doing things that might be overly unsafe or could break vfork from being used in its optimized form. It’s implanted at the libc level, so it’s not a magic syscall that moves the burden of process spawning to the kernel.

This doesn’t change your core point but just to be thorough, it’s actually a system call on a few systems, notably macOS.