mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-24 14:00:48 +02:00
Noticed this while debugging Proton Experimental hanging and thought this could be related. Didn't solve that issue but this should be merged anyway. vfork doesn't fork the host's process space in to the child process. Saving Copy-On-Write overhead problems. It also puts the parent process to sleep until the fork terminates or executes. This is a major issue under FEX where we can't emulate vfork correctly because we need to do other work before this process terminates or executes a new process. We have been treating `vfork` as a `fork` this entire time. This can likely cause problems for applications that actually use vfork to wait for a process to complete. So let's actually emulate that feature by using a pipe with poll to determine when that FD gets removed. FEX can't use waitpid to wait for this process to terminate since we would affect the guest also wanted to use a waitpid.