mirror of
https://github.com/FEX-Emu/FEX.git
synced 2025-01-11 00:26:15 +00:00
Adds support for faccessat2 to FileManager
This commit is contained in:
parent
74a00fee0f
commit
ac92a103df
@ -95,6 +95,18 @@ uint64_t FileManager::FAccessat(int dirfd, const char *pathname, int mode) {
|
||||
return ::syscall(SYS_faccessat, dirfd, pathname, mode);
|
||||
}
|
||||
|
||||
uint64_t FileManager::FAccessat2(int dirfd, const char *pathname, int mode, int flags) {
|
||||
const uint32_t SYS_faccessat2 = 439;
|
||||
auto Path = GetEmulatedPath(pathname);
|
||||
if (!Path.empty()) {
|
||||
uint64_t Result = ::syscall(SYS_faccessat2, dirfd, Path.c_str(), mode, flags);
|
||||
if (Result != -1)
|
||||
return Result;
|
||||
}
|
||||
|
||||
return ::syscall(SYS_faccessat2, dirfd, pathname, mode, flags);
|
||||
}
|
||||
|
||||
uint64_t FileManager::Readlink(const char *pathname, char *buf, size_t bufsiz) {
|
||||
if (strcmp(pathname, "/proc/self/exe") == 0 || strcmp(pathname, PidSelfPath.c_str()) == 0) {
|
||||
auto App = Filename();
|
||||
|
@ -28,6 +28,7 @@ public:
|
||||
uint64_t Lstat(const char *path, void *buf);
|
||||
uint64_t Access(const char *pathname, int mode);
|
||||
uint64_t FAccessat(int dirfd, const char *pathname, int mode);
|
||||
uint64_t FAccessat2(int dirfd, const char *pathname, int mode, int flags);
|
||||
uint64_t Readlink(const char *pathname, char *buf, size_t bufsiz);
|
||||
uint64_t Chmod(const char *pathname, mode_t mode);
|
||||
uint64_t Readlinkat(int dirfd, const char *pathname, char *buf, size_t bufsiz);
|
||||
|
Loading…
x
Reference in New Issue
Block a user