mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:18:11 +00:00
Kernel+LibC+LibCore+UE: Implement fchmodat(2)
This function is an extended version of `chmod(2)` that lets one control whether to dereference symlinks, and specify a file descriptor to a directory that will be used as the base for relative paths.
This commit is contained in:
parent
5f71925aa4
commit
182016d7c0
10 changed files with 64 additions and 14 deletions
|
@ -386,7 +386,13 @@ ErrorOr<void> chmod(StringView pathname, mode_t mode)
|
|||
return Error::from_syscall("chmod"sv, -EFAULT);
|
||||
|
||||
#ifdef __serenity__
|
||||
int rc = syscall(SC_chmod, pathname.characters_without_null_termination(), pathname.length(), mode);
|
||||
Syscall::SC_chmod_params params {
|
||||
AT_FDCWD,
|
||||
{ pathname.characters_without_null_termination(), pathname.length() },
|
||||
mode,
|
||||
true
|
||||
};
|
||||
int rc = syscall(SC_chmod, ¶ms);
|
||||
HANDLE_SYSCALL_RETURN_VALUE("chmod"sv, rc, {});
|
||||
#else
|
||||
String path = pathname;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue