1
Fork 0
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:
Andreas Kling 2020-01-05 22:02:31 +01:00
parent 152a83fac5
commit f231e9ea76
3 changed files with 16 additions and 10 deletions

View file

@ -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);
}