The only thing I don’t like about vfork+execve is the weird way that vfork tries...

@david_chisnall@infosec.exchange

The only thing I don’t like about vfork+execve is the weird way that vfork tries to pretend that it’s fork. When you call execve, it returns a second time, which is painful in any language that isn’t C and can cause memory leaks in C. I would like it if a vfork analogue set up the new kernel context, you modified it as with vfork, and then execve or exit in this context both returned like normal, either detaching or exiting the child. This would make it very easy to use RAII or GC for temporary resources created during the setup process.