mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:47:34 +00:00
LibCore: Implement System::fchown
This commit is contained in:
parent
285b2fba96
commit
37658e6fa6
2 changed files with 8 additions and 0 deletions
|
@ -529,6 +529,13 @@ ErrorOr<void> fchmod(int fd, mode_t mode)
|
|||
return {};
|
||||
}
|
||||
|
||||
ErrorOr<void> fchown(int fd, uid_t uid, gid_t gid)
|
||||
{
|
||||
if (::fchown(fd, uid, gid) < 0)
|
||||
return Error::from_syscall("fchown"sv, -errno);
|
||||
return {};
|
||||
}
|
||||
|
||||
ErrorOr<void> lchown(StringView pathname, uid_t uid, gid_t gid)
|
||||
{
|
||||
if (!pathname.characters_without_null_termination())
|
||||
|
|
|
@ -114,6 +114,7 @@ ErrorOr<void> chdir(StringView path);
|
|||
ErrorOr<pid_t> fork();
|
||||
ErrorOr<int> mkstemp(Span<char> pattern);
|
||||
ErrorOr<void> fchmod(int fd, mode_t mode);
|
||||
ErrorOr<void> fchown(int fd, uid_t, gid_t);
|
||||
ErrorOr<void> rename(StringView old_path, StringView new_path);
|
||||
ErrorOr<void> unlink(StringView path);
|
||||
ErrorOr<void> utime(StringView path, Optional<struct utimbuf>);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue