← Back to context

Comment by cryptonector

4 years ago

Shells should really use `vfork()` to exec, and `fork()` for subshells (maybe).

Except that the set of things you are allowed to do after vfork() and before exec() is extremely small. I agree that things should use vfork or posix_spawn when possible, but it wouldn't surprise me at all if there's a similar list of cases when a vfork() path wouldn't be possible.