diff --git a/Source/Tools/LinuxEmulation/LinuxSyscalls/Syscalls/Thread.cpp b/Source/Tools/LinuxEmulation/LinuxSyscalls/Syscalls/Thread.cpp index f90a3bddca..1a2fd24a3d 100644 --- a/Source/Tools/LinuxEmulation/LinuxSyscalls/Syscalls/Thread.cpp +++ b/Source/Tools/LinuxEmulation/LinuxSyscalls/Syscalls/Thread.cpp @@ -246,13 +246,8 @@ uint64_t HandleNewClone(FEX::HLE::ThreadStateObject* Thread, FEXCore::Context::C return Thread->StatusCode; } -static int Clone3Fork(uint32_t flags) { - struct clone_args cl_args = { - .flags = (flags & (CLONE_FS | CLONE_FILES)), - .exit_signal = SIGCHLD, - }; - - return syscall(SYS_clone3, cl_args, sizeof(cl_args)); +static int CloneFork(uint32_t flags) { + return ::syscall(SYSCALL_DEF(clone), flags & (CLONE_FS | CLONE_FILES | CSIGNAL), nullptr, nullptr, nullptr, nullptr); } uint64_t ForkGuest(FEXCore::Core::InternalThreadState* Thread, FEXCore::Core::CpuStateFrame* Frame, uint32_t flags, void* stack, @@ -275,7 +270,7 @@ uint64_t ForkGuest(FEXCore::Core::InternalThreadState* Thread, FEXCore::Core::Cp // XXX: We don't currently support a real `vfork` as it causes problems. // Currently behaves like a fork (with wait after the fact), which isn't correct. Need to find where the problem is - Result = Clone3Fork(flags); + Result = CloneFork(flags); if (Result == 0) { // Close the read end of the pipe. @@ -286,7 +281,7 @@ uint64_t ForkGuest(FEXCore::Core::InternalThreadState* Thread, FEXCore::Core::Cp close(VForkFDs[1]); } } else { - Result = Clone3Fork(flags); + Result = CloneFork(flags); } const bool IsChild = Result == 0;