mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:58:12 +00:00
Kernel+LibC+LibCore: Implement renameat(2)
Now with the ability to specify different bases for the old and new paths.
This commit is contained in:
parent
eb5389e933
commit
d5fbdf1866
7 changed files with 17 additions and 6 deletions
|
@ -17,7 +17,7 @@ ErrorOr<FlatPtr> Process::sys$rename(Userspace<Syscall::SC_rename_params const*>
|
|||
auto params = TRY(copy_typed_from_user(user_params));
|
||||
auto old_path = TRY(get_syscall_path_argument(params.old_path));
|
||||
auto new_path = TRY(get_syscall_path_argument(params.new_path));
|
||||
TRY(VirtualFileSystem::the().rename(credentials(), old_path->view(), new_path->view(), current_directory()));
|
||||
TRY(VirtualFileSystem::the().rename(credentials(), TRY(custody_for_dirfd(params.olddirfd)), old_path->view(), TRY(custody_for_dirfd(params.newdirfd)), new_path->view()));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue