mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 22:57:44 +00:00
LibCore: Add syscall wrapper for fchmod()
This commit is contained in:
parent
aa7e8b5797
commit
fb4ffe22c8
2 changed files with 8 additions and 0 deletions
|
@ -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())
|
||||
|
|
|
@ -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);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue