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

LibCore: Add syscall wrapper for umount()

This commit is contained in:
Federico Guerinoni 2022-01-21 23:10:59 +01:00 committed by Idan Horowitz
parent 96d2c3a827
commit 2291ef6c3c
2 changed files with 10 additions and 0 deletions

View file

@ -122,6 +122,15 @@ ErrorOr<void> mount(int source_fd, StringView target, StringView fs_type, int fl
HANDLE_SYSCALL_RETURN_VALUE("mount", rc, {});
}
ErrorOr<void> umount(StringView mount_point)
{
if (mount_point.is_null())
return Error::from_errno(EFAULT);
int rc = syscall(SC_umount, mount_point.characters_without_null_termination(), mount_point.length());
HANDLE_SYSCALL_RETURN_VALUE("umount", rc, {});
}
ErrorOr<long> ptrace(int request, pid_t tid, void* address, void* data)
{
auto rc = ::ptrace(request, tid, address, data);