mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-27 23:00:09 +01:00
Merge pull request #536 from Sonicadvance1/move_getdents_x64
Moves the getdents implementations for x64
This commit is contained in:
2 files changed
+23
-22
No files matched your search
@@ -9,7 +9,6 @@
|
||||
#include <sys/eventfd.h>
|
||||
#include <sys/inotify.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/syscall.h>
|
||||
#include <sys/timerfd.h>
|
||||
#include <poll.h>
|
||||
#include <stddef.h>
|
||||
@@ -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<uint64_t>(fd),
|
||||
reinterpret_cast<uint64_t>(dirp),
|
||||
static_cast<uint64_t>(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<uint64_t>(fd),
|
||||
reinterpret_cast<uint64_t>(dirp),
|
||||
static_cast<uint64_t>(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();
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
#include <fcntl.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/syscall.h>
|
||||
#include <unistd.h>
|
||||
|
||||
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<uint64_t>(fd),
|
||||
reinterpret_cast<uint64_t>(dirp),
|
||||
static_cast<uint64_t>(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<uint64_t>(fd),
|
||||
reinterpret_cast<uint64_t>(dirp),
|
||||
static_cast<uint64_t>(count));
|
||||
SYSCALL_ERRNO();
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user