diff --git a/External/FEXCore/Source/Interface/HLE/Syscalls/FD.cpp b/External/FEXCore/Source/Interface/HLE/Syscalls/FD.cpp index dd998313b..62a58569d 100644 --- a/External/FEXCore/Source/Interface/HLE/Syscalls/FD.cpp +++ b/External/FEXCore/Source/Interface/HLE/Syscalls/FD.cpp @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include @@ -149,19 +148,6 @@ namespace FEXCore::HLE { SYSCALL_ERRNO(); }); - REGISTER_SYSCALL_IMPL(getdents, [](FEXCore::Core::InternalThreadState *Thread, int fd, void *dirp, uint32_t count) -> uint64_t { - #ifdef SYS_getdents - uint64_t Result = syscall(SYS_getdents, - static_cast(fd), - reinterpret_cast(dirp), - static_cast(count)); - SYSCALL_ERRNO(); - #else - // XXX: Emulate - return -EFAULT; - #endif - }); - REGISTER_SYSCALL_IMPL(fchmod, [](FEXCore::Core::InternalThreadState *Thread, int fd, int mode) -> uint64_t { uint64_t Result = ::fchmod(fd, mode); SYSCALL_ERRNO(); @@ -172,14 +158,6 @@ namespace FEXCore::HLE { SYSCALL_ERRNO(); }); - REGISTER_SYSCALL_IMPL(getdents64, [](FEXCore::Core::InternalThreadState *Thread, int fd, void *dirp, uint32_t count) -> uint64_t { - uint64_t Result = syscall(SYS_getdents64, - static_cast(fd), - reinterpret_cast(dirp), - static_cast(count)); - SYSCALL_ERRNO(); - }); - REGISTER_SYSCALL_IMPL(fadvise64, [](FEXCore::Core::InternalThreadState *Thread, int fd, off_t offset, off_t len, int advice) -> uint64_t { uint64_t Result = ::posix_fadvise64(fd, offset, len, advice); SYSCALL_ERRNO(); diff --git a/External/FEXCore/Source/Interface/HLE/x64/FD.cpp b/External/FEXCore/Source/Interface/HLE/x64/FD.cpp index d69ad941b..40808e1ab 100644 --- a/External/FEXCore/Source/Interface/HLE/x64/FD.cpp +++ b/External/FEXCore/Source/Interface/HLE/x64/FD.cpp @@ -5,6 +5,8 @@ #include #include #include +#include +#include namespace FEXCore::HLE::x64 { struct __attribute__((packed)) guest_stat { @@ -173,5 +175,26 @@ namespace FEXCore::HLE::x64 { uint64_t Result = ::ppoll(fds, nfds, timeout_ts, sigmask); SYSCALL_ERRNO(); }); + + REGISTER_SYSCALL_IMPL_X64(getdents, [](FEXCore::Core::InternalThreadState *Thread, int fd, void *dirp, uint32_t count) -> uint64_t { + #ifdef SYS_getdents + uint64_t Result = syscall(SYS_getdents, + static_cast(fd), + reinterpret_cast(dirp), + static_cast(count)); + SYSCALL_ERRNO(); + #else + // XXX: Emulate + return -EFAULT; + #endif + }); + + REGISTER_SYSCALL_IMPL_X64(getdents64, [](FEXCore::Core::InternalThreadState *Thread, int fd, void *dirp, uint32_t count) -> uint64_t { + uint64_t Result = syscall(SYS_getdents64, + static_cast(fd), + reinterpret_cast(dirp), + static_cast(count)); + SYSCALL_ERRNO(); + }); } }