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

Kernel: Pass a parameter struct to mknod()

This commit is contained in:
Andreas Kling 2020-01-11 10:27:37 +01:00
parent 6536a80aa9
commit c97bfbd609
5 changed files with 35 additions and 11 deletions

View file

@ -451,7 +451,12 @@ int access(const char* pathname, int mode)
int mknod(const char* pathname, mode_t mode, dev_t dev)
{
int rc = syscall(SC_mknod, pathname, mode, dev);
if (!pathname) {
errno = EFAULT;
return -1;
}
Syscall::SC_mknod_params params { { pathname, strlen(pathname) }, mode, dev };
int rc = syscall(SC_mknod, &params);
__RETURN_WITH_ERRNO(rc, rc, -1);
}