mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:48:12 +00:00
Kernel: Pass a parameter struct to rename()
This commit is contained in:
parent
46830a0c32
commit
e380142853
4 changed files with 23 additions and 8 deletions
|
@ -510,7 +510,12 @@ int fclose(FILE* stream)
|
|||
|
||||
int rename(const char* oldpath, const char* newpath)
|
||||
{
|
||||
int rc = syscall(SC_rename, oldpath, newpath);
|
||||
if (!oldpath || !newpath) {
|
||||
errno = EFAULT;
|
||||
return -1;
|
||||
}
|
||||
Syscall::SC_rename_params params { { oldpath, strlen(oldpath) }, { newpath, strlen(newpath) } };
|
||||
int rc = syscall(SC_rename, ¶ms);
|
||||
__RETURN_WITH_ERRNO(rc, rc, -1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue