1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:58:11 +00:00

Kernel: Add fchown() syscall.

This commit is contained in:
Andreas Kling 2019-06-01 20:31:36 +02:00
parent 51581c21fc
commit 93d3d1ede1
8 changed files with 30 additions and 2 deletions

View file

@ -1991,6 +1991,14 @@ int Process::sys$fchmod(int fd, mode_t mode)
return descriptor->fchmod(mode);
}
int Process::sys$fchown(int fd, uid_t uid, gid_t gid)
{
auto* descriptor = file_descriptor(fd);
if (!descriptor)
return -EBADF;
return descriptor->chown(uid, gid);
}
int Process::sys$chown(const char* pathname, uid_t uid, gid_t gid)
{
if (!validate_read_str(pathname))