syscalls/x64: Add fchdir

This commit is contained in:
Stefanos Kornilios Mitsis Poiitidis committed 2020-06-03 16:01:06 +03:00
1 parent 7717425201
commit 2c8fccdcf2
4 files changed
+11

No files matched your search

+5
View File
@@ -23,6 +23,11 @@ namespace FEXCore::HLE {
SYSCALL_ERRNO();
}
uint64_t Fchdir(FEXCore::Core::InternalThreadState *Thread, int fd) {
uint64_t Result = ::fchdir(fd);
SYSCALL_ERRNO();
}
uint64_t Rename(FEXCore::Core::InternalThreadState *Thread, const char *oldpath, const char *newpath) {
uint64_t Result = ::rename(oldpath, newpath);
SYSCALL_ERRNO();
+1
View File
@@ -11,6 +11,7 @@ struct InternalThreadState;
namespace FEXCore::HLE {
uint64_t Getcwd(FEXCore::Core::InternalThreadState *Thread, char *buf, size_t size);
uint64_t Chdir(FEXCore::Core::InternalThreadState *Thread, const char *path);
uint64_t Fchdir(FEXCore::Core::InternalThreadState *Thread, int fd);
uint64_t Rename(FEXCore::Core::InternalThreadState *Thread, const char *oldpath, const char *newpath);
uint64_t Mkdir(FEXCore::Core::InternalThreadState *Thread, const char *pathname, mode_t mode);
uint64_t Rmdir(FEXCore::Core::InternalThreadState *Thread, const char *pathname);
@@ -310,6 +310,9 @@ void x64SyscallHandler::Strace(FEXCore::HLE::SyscallArguments *Args, uint64_t Re
case SYSCALL_CHDIR:
LogMan::Msg::D("chdir(\"%s\") = %ld", reinterpret_cast<char const*>(Args->Argument[1]), Ret);
break;
case SYSCALL_CHDIR:
LogMan::Msg::D("fchdir(\"%d\") = %ld", reinterpret_cast<int>(Args->Argument[1]), Ret);
break;
case SYSCALL_RENAME:
LogMan::Msg::D("rename(\"%s\", \"%s\") = %ld", reinterpret_cast<char const*>(Args->Argument[1]), reinterpret_cast<char const*>(Args->Argument[2]), Ret);
break;
@@ -833,6 +836,7 @@ void x64SyscallHandler::RegisterSyscallHandlers() {
{SYSCALL_GETDENTS, cvt(&FEXCore::HLE::Getdents), 3},
{SYSCALL_GETCWD, cvt(&FEXCore::HLE::Getcwd), 2},
{SYSCALL_CHDIR, cvt(&FEXCore::HLE::Chdir), 1},
{SYSCALL_FCHDIR, cvt(&FEXCore::HLE::Fchdir), 1},
{SYSCALL_RENAME, cvt(&FEXCore::HLE::Rename), 2},
{SYSCALL_MKDIR, cvt(&FEXCore::HLE::Mkdir), 2},
{SYSCALL_RMDIR, cvt(&FEXCore::HLE::Rmdir), 1},
+1
View File
@@ -92,6 +92,7 @@ enum Syscalls {
SYSCALL_GETDENTS = 78, ///< __NR_getdents
SYSCALL_GETCWD = 79, ///< __NR_getcwd
SYSCALL_CHDIR = 80, ///< __NR_chdir
SYSCALL_FCHDIR = 81, ///< __NR_fchdir
SYSCALL_RENAME = 82, ///< __NR_rename
SYSCALL_MKDIR = 83, ///< __NR_mkdir
SYSCALL_RMDIR = 84, ///< __NR_rmdir