Kernel: Pass a parameter struct to chown()

This commit is contained in:
Andreas Kling 2020-01-11 10:17:08 +01:00
commit 6536a80aa9
Notes: sideshowbarker 2024-07-19 10:12:40 +09:00
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);
}