3 ms·
vfork() is even harder to use correctly than fork(). posix_spawn() is not a silver bullet either. Its API is cumbersome, it severly limits what you could do in
by jwilk 8y ago
vfork() is even harder to use correctly than fork().
posix_spawn() is not a silver bullet either. Its API is cumbersome, it severly limits what you could do in the child process before exec(), and has no sane way to handle errors in the pre-exec() stage.
And AFACIS the glibc implementation of posix_spawn() doesn't even fix the memory duplication problem out of the box. It uses vfork() only if you use the non-standard POSIX_SPAWN_USEVFORK flag.