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

Kernel: Pass characters+length to link()

This commit is contained in:
Andreas Kling 2020-01-10 21:26:47 +01:00
parent 416c7ac2b5
commit 485443bfca
5 changed files with 35 additions and 7 deletions

View file

@ -339,7 +339,12 @@ off_t lseek(int fd, off_t offset, int whence)
int link(const char* old_path, const char* new_path)
{
int rc = syscall(SC_link, old_path, new_path);
if (!old_path || !new_path) {
errno = EFAULT;
return -1;
}
Syscall::SC_link_params params { { old_path, strlen(old_path) }, { new_path, strlen(new_path) } };
int rc = syscall(SC_link, &params);
__RETURN_WITH_ERRNO(rc, rc, -1);
}