1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:38:11 +00:00

Kernel+LibC: Implement readlinkat(2)

Co-Authored-By: Daniel Bertalan <dani@danielbertalan.dev>
This commit is contained in:
sin-ack 2022-10-01 11:20:08 +00:00 committed by Andrew Kaster
parent 9850a69cd1
commit 6445a706cf
6 changed files with 16 additions and 6 deletions

View file

@ -17,7 +17,7 @@ ErrorOr<FlatPtr> Process::sys$readlink(Userspace<Syscall::SC_readlink_params con
auto params = TRY(copy_typed_from_user(user_params));
auto path = TRY(get_syscall_path_argument(params.path));
auto description = TRY(VirtualFileSystem::the().open(credentials(), path->view(), O_RDONLY | O_NOFOLLOW_NOERROR, 0, current_directory()));
auto description = TRY(VirtualFileSystem::the().open(credentials(), path->view(), O_RDONLY | O_NOFOLLOW_NOERROR, 0, TRY(custody_for_dirfd(params.dirfd))));
if (!description->metadata().is_symlink())
return EINVAL;