mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 01:20:25 +00:00
LibCore: Add syscall wrapper for umount()
This commit is contained in:
parent
96d2c3a827
commit
2291ef6c3c
Notes:
sideshowbarker
2024-07-17 20:27:21 +09:00
Author: https://github.com/guerinoni Commit: https://github.com/SerenityOS/serenity/commit/2291ef6c3ce Pull-request: https://github.com/SerenityOS/serenity/pull/12012 Reviewed-by: https://github.com/IdanHo ✅ Reviewed-by: https://github.com/Rummskartoffel ✅
2 changed files with 10 additions and 0 deletions
|
@ -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);
|
||||
|
|
|
@ -40,6 +40,7 @@ ErrorOr<int> recvfd(int sockfd, int options);
|
|||
ErrorOr<void> ptrace_peekbuf(pid_t tid, void const* tracee_addr, Bytes destination_buf);
|
||||
ErrorOr<void> setgroups(Span<gid_t const>);
|
||||
ErrorOr<void> mount(int source_fd, StringView target, StringView fs_type, int flags);
|
||||
ErrorOr<void> umount(StringView mount_point);
|
||||
ErrorOr<long> ptrace(int request, pid_t tid, void* address, void* data);
|
||||
ErrorOr<void> disown(pid_t pid);
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue