If you need to spawn child worker processes sharing state with the parent, then pass that state via pipe and tell the child about it via a command-line option. Or something like that.
fork(2) should absolutely be deprecated.
vfork(2) can stay. It's hard to use, but not actually harder to use safely than fork(2), and has much better performance (no copies, no CoW). vfork(2)'s reputation as nasty is undeserved.
fork(2) is evil. It is no longer needed.
Use posix_spawn().
If you need to spawn child worker processes sharing state with the parent, then pass that state via pipe and tell the child about it via a command-line option. Or something like that.
fork(2) should absolutely be deprecated.
vfork(2) can stay. It's hard to use, but not actually harder to use safely than fork(2), and has much better performance (no copies, no CoW). vfork(2)'s reputation as nasty is undeserved.