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

Kernel: Pass a parameter struct to chown()

This commit is contained in:
Andreas Kling 2020-01-11 10:17:08 +01:00
parent 29b3d95004
commit 6536a80aa9
4 changed files with 21 additions and 6 deletions

View file

@ -27,7 +27,12 @@ int systrace(pid_t pid)
int chown(const char* pathname, uid_t uid, gid_t gid)
{
int rc = syscall(SC_chown, pathname, uid, gid);
if (!pathname) {
errno = EFAULT;
return -1;
}
Syscall::SC_chown_params params { { pathname, strlen(pathname) }, uid, gid };
int rc = syscall(SC_chown, &params);
__RETURN_WITH_ERRNO(rc, rc, -1);
}