1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:07:43 +00:00

Kernel: Pass characters+length to readlink()

Note that I'm developing some helper types in the Syscall namespace as
I go here. Once I settle on some nice types, I will convert all the
other syscalls to use them as well.
This commit is contained in:
Andreas Kling 2020-01-10 20:13:23 +01:00
parent 5c3c2a9bac
commit 0695ff8282
4 changed files with 37 additions and 12 deletions

View file

@ -326,7 +326,8 @@ int gethostname(char* buffer, size_t size)
ssize_t readlink(const char* path, char* buffer, size_t size)
{
int rc = syscall(SC_readlink, path, buffer, size);
Syscall::SC_readlink_params params { { path, strlen(path) }, { buffer, size } };
int rc = syscall(SC_readlink, &params);
__RETURN_WITH_ERRNO(rc, rc, -1);
}