diff --git a/Source/Tests/LinuxSyscalls/x32/EPoll.cpp b/Source/Tests/LinuxSyscalls/x32/EPoll.cpp index adfbdad3a..7a97931ca 100644 --- a/Source/Tests/LinuxSyscalls/x32/EPoll.cpp +++ b/Source/Tests/LinuxSyscalls/x32/EPoll.cpp @@ -15,6 +15,8 @@ $end_info$ #include #include #include +#include +#include ARG_TO_STR(FEX::HLE::x32::compat_ptr, "%lx") @@ -23,7 +25,7 @@ namespace FEX::HLE::x32 { REGISTER_SYSCALL_IMPL_X32(epoll_wait, [](FEXCore::Core::CpuStateFrame *Frame, int epfd, compat_ptr events, int maxevents, int timeout) -> uint64_t { std::vector Events; Events.resize(maxevents); - uint64_t Result = epoll_wait(epfd, &Events.at(0), maxevents, timeout); + uint64_t Result = ::syscall(SYS_epoll_pwait, epfd, &Events.at(0), maxevents, timeout, nullptr); if (Result != -1) { for (size_t i = 0; i < Result; ++i) { @@ -35,23 +37,24 @@ namespace FEX::HLE::x32 { REGISTER_SYSCALL_IMPL_X32(epoll_ctl, [](FEXCore::Core::CpuStateFrame *Frame, int epfd, int op, int fd, epoll_event_x86 *event) -> uint64_t { struct epoll_event Event = *event; - uint64_t Result = epoll_ctl(epfd, op, fd, &Event); + uint64_t Result = ::syscall(SYS_epoll_ctl, epfd, op, fd, &Event); if (Result != -1) { *event = Event; } SYSCALL_ERRNO(); }); - REGISTER_SYSCALL_IMPL_X32(epoll_pwait, [](FEXCore::Core::CpuStateFrame *Frame, int epfd, compat_ptr events, int maxevent, int timeout, const void* sigmask) -> uint64_t { + REGISTER_SYSCALL_IMPL_X32(epoll_pwait, [](FEXCore::Core::CpuStateFrame *Frame, int epfd, compat_ptr events, int maxevent, int timeout, const uint64_t* sigmask, size_t sigsetsize) -> uint64_t { std::vector Events; Events.resize(maxevent); - uint64_t Result = epoll_pwait( + uint64_t Result = ::syscall(SYS_epoll_pwait, epfd, &Events.at(0), maxevent, timeout, - reinterpret_cast(sigmask)); + sigmask, + sigsetsize); if (Result != -1) { for (size_t i = 0; i < Result; ++i) { diff --git a/Source/Tests/LinuxSyscalls/x64/EPoll.cpp b/Source/Tests/LinuxSyscalls/x64/EPoll.cpp index bb54f8ca2..941d5cdf1 100644 --- a/Source/Tests/LinuxSyscalls/x64/EPoll.cpp +++ b/Source/Tests/LinuxSyscalls/x64/EPoll.cpp @@ -15,13 +15,15 @@ $end_info$ #include #include #include +#include +#include namespace FEX::HLE::x64 { void RegisterEpoll() { REGISTER_SYSCALL_IMPL_X64(epoll_wait, [](FEXCore::Core::CpuStateFrame *Frame, int epfd, epoll_event_x86 *events, int maxevents, int timeout) -> uint64_t { std::vector Events; Events.resize(maxevents); - uint64_t Result = epoll_wait(epfd, &Events.at(0), maxevents, timeout); + uint64_t Result = ::syscall(SYS_epoll_pwait, epfd, &Events.at(0), maxevents, timeout, nullptr, 8); if (Result != -1) { for (size_t i = 0; i < Result; ++i) { @@ -38,23 +40,24 @@ namespace FEX::HLE::x64 { Event = *event; EventPtr = &Event; } - uint64_t Result = epoll_ctl(epfd, op, fd, EventPtr); + uint64_t Result = ::syscall(SYS_epoll_ctl, epfd, op, fd, EventPtr); if (Result != -1 && event) { *event = Event; } SYSCALL_ERRNO(); }); - REGISTER_SYSCALL_IMPL_X64(epoll_pwait, [](FEXCore::Core::CpuStateFrame *Frame, int epfd, epoll_event_x86 *events, int maxevent, int timeout, const void* sigmask) -> uint64_t { + REGISTER_SYSCALL_IMPL_X64(epoll_pwait, [](FEXCore::Core::CpuStateFrame *Frame, int epfd, epoll_event_x86 *events, int maxevent, int timeout, const uint64_t* sigmask, size_t sigsetsize) -> uint64_t { std::vector Events; Events.resize(maxevent); - uint64_t Result = epoll_pwait( + uint64_t Result = ::syscall(SYS_epoll_pwait, epfd, &Events.at(0), maxevent, timeout, - reinterpret_cast(sigmask)); + sigmask, + sigsetsize); if (Result != -1) { for (size_t i = 0; i < Result; ++i) {