1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:17:35 +00:00

LibCore: Add syscall wrapper for fchmod()

This commit is contained in:
Andreas Kling 2021-12-16 21:12:23 +01:00
parent aa7e8b5797
commit fb4ffe22c8
2 changed files with 8 additions and 0 deletions

View file

@ -330,6 +330,13 @@ ErrorOr<void> chmod(StringView pathname, mode_t mode)
#endif
}
ErrorOr<void> fchmod(int fd, mode_t mode)
{
if (::fchmod(fd, mode) < 0)
return Error::from_syscall("fchmod"sv, -errno);
return {};
}
ErrorOr<void> chown(StringView pathname, uid_t uid, gid_t gid)
{
if (!pathname.characters_without_null_termination())

View file

@ -66,5 +66,6 @@ ErrorOr<void> symlink(StringView target, StringView link_path);
ErrorOr<void> mkdir(StringView path, mode_t);
ErrorOr<pid_t> fork();
ErrorOr<int> mkstemp(Span<char> pattern);
ErrorOr<void> fchmod(int fd, mode_t mode);
}