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

Kernel: Pass a parameter struct to symlink()

This commit is contained in:
Andreas Kling 2020-01-11 10:31:33 +01:00
parent c97bfbd609
commit 46830a0c32
4 changed files with 23 additions and 8 deletions

View file

@ -361,7 +361,12 @@ int unlink(const char* pathname)
int symlink(const char* target, const char* linkpath)
{
int rc = syscall(SC_symlink, target, linkpath);
if (!target || !linkpath) {
errno = EFAULT;
return -1;
}
Syscall::SC_symlink_params params { { target, strlen(target) }, { linkpath, strlen(linkpath) } };
int rc = syscall(SC_symlink, &params);
__RETURN_WITH_ERRNO(rc, rc, -1);
}