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:
parent
416c7ac2b5
commit
485443bfca
5 changed files with 35 additions and 7 deletions
|
@ -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, ¶ms);
|
||||
__RETURN_WITH_ERRNO(rc, rc, -1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue