mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:17:36 +00:00
Kernel: Make access() take path+length
Also, let's return EFAULT for nullptr at the LibC layer. We can't do all bad addresses this way, but we can at least do null. :^)
This commit is contained in:
parent
ad4284428a
commit
642137f014
3 changed files with 10 additions and 6 deletions
|
@ -389,7 +389,11 @@ int setgid(uid_t gid)
|
|||
|
||||
int access(const char* pathname, int mode)
|
||||
{
|
||||
int rc = syscall(SC_access, pathname, mode);
|
||||
if (!pathname) {
|
||||
errno = EFAULT;
|
||||
return -1;
|
||||
}
|
||||
int rc = syscall(SC_access, pathname, strlen(pathname), mode);
|
||||
__RETURN_WITH_ERRNO(rc, rc, -1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue