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:
parent
fa692e13f9
commit
2a502fe232
13 changed files with 89 additions and 39 deletions
|
@ -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, ¶ms);
|
||||
HANDLE_SYSCALL_RETURN_VALUE("access", rc, {});
|
||||
#else
|
||||
DeprecatedString path_string = pathname;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue