1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:47:44 +00:00

Kernel+LibC+LibCore+UserspaceEmulator: Implement faccessat(2)

Co-Authored-By: Daniel Bertalan <dani@danielbertalan.dev>
This commit is contained in:
sin-ack 2022-10-01 12:24:56 +00:00 committed by Andrew Kaster
parent fa692e13f9
commit 2a502fe232
13 changed files with 89 additions and 39 deletions

View file

@ -1372,7 +1372,13 @@ ErrorOr<void> access(StringView pathname, int mode)
return Error::from_syscall("access"sv, -EFAULT);
#ifdef AK_OS_SERENITY
int rc = ::syscall(Syscall::SC_access, pathname.characters_without_null_termination(), pathname.length(), mode);
Syscall::SC_faccessat_params params {
.dirfd = AT_FDCWD,
.pathname = { pathname.characters_without_null_termination(), pathname.length() },
.mode = mode,
.flags = 0,
};
int rc = ::syscall(Syscall::SC_faccessat, &params);
HANDLE_SYSCALL_RETURN_VALUE("access", rc, {});
#else
DeprecatedString path_string = pathname;