1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:17:44 +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())