"Rich Felker, May 24, 2015:
Some interesting preliminary timing of
@musllibc
's posix_spawn vs fork+exec shows it ~25x faster for large parent processes. (~360us vs 9ms). #glibc has a vfork-based posix_spawn but it's only usable for trivial cases; others use fork.
@musllibc
posix_spawn always uses CLONE_VM. This also means
@musllibc
posix_spawn will fill the fork gap on NOMMU systems cleanly/safely (unlike vfork) once we get NOMMU working."
You can use the posix_spawn function in glibc, which uses a vfork or clone syscall just like on Linux.