mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 14:15:07 +00:00
Kernel: Pass path+length to the stat() and lstat() syscalls
It's not pleasant having to deal with null-terminated strings as input to syscalls, so let's get rid of them one by one.
This commit is contained in:
parent
152a83fac5
commit
f231e9ea76
3 changed files with 16 additions and 10 deletions
|
@ -227,13 +227,13 @@ pid_t waitpid(pid_t waitee, int* wstatus, int options)
|
|||
|
||||
int lstat(const char* path, struct stat* statbuf)
|
||||
{
|
||||
int rc = syscall(SC_lstat, path, statbuf);
|
||||
int rc = syscall(SC_lstat, path, strlen(path), statbuf);
|
||||
__RETURN_WITH_ERRNO(rc, rc, -1);
|
||||
}
|
||||
|
||||
int stat(const char* path, struct stat* statbuf)
|
||||
{
|
||||
int rc = syscall(SC_stat, path, statbuf);
|
||||
int rc = syscall(SC_stat, path, strlen(path), statbuf);
|
||||
__RETURN_WITH_ERRNO(rc, rc, -1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue