1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 12:55:09 +00:00

Kernel+Userland: Add the rename() syscall along with a basic /bin/mv.

This commit is contained in:
Andreas Kling 2019-04-07 23:35:26 +02:00
parent 71b6436552
commit 37ae00a4dd
11 changed files with 99 additions and 2 deletions

View file

@ -2445,3 +2445,12 @@ int Process::sys$donate(int tid)
Scheduler::donate_to(beneficiary, "sys$donate");
return 0;
}
int Process::sys$rename(const char* oldpath, const char* newpath)
{
if (!validate_read_str(oldpath))
return -EFAULT;
if (!validate_read_str(newpath))
return -EFAULT;
return VFS::the().rename(String(oldpath), String(newpath), cwd_inode());
}