diff --git a/Userland/Libraries/LibCore/System.cpp b/Userland/Libraries/LibCore/System.cpp index d360c4d4f57..68f0b36cccb 100644 --- a/Userland/Libraries/LibCore/System.cpp +++ b/Userland/Libraries/LibCore/System.cpp @@ -122,6 +122,15 @@ ErrorOr mount(int source_fd, StringView target, StringView fs_type, int fl HANDLE_SYSCALL_RETURN_VALUE("mount", rc, {}); } +ErrorOr 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 ptrace(int request, pid_t tid, void* address, void* data) { auto rc = ::ptrace(request, tid, address, data); diff --git a/Userland/Libraries/LibCore/System.h b/Userland/Libraries/LibCore/System.h index 60ffea982bb..0bba07f5bc9 100644 --- a/Userland/Libraries/LibCore/System.h +++ b/Userland/Libraries/LibCore/System.h @@ -40,6 +40,7 @@ ErrorOr recvfd(int sockfd, int options); ErrorOr ptrace_peekbuf(pid_t tid, void const* tracee_addr, Bytes destination_buf); ErrorOr setgroups(Span); ErrorOr mount(int source_fd, StringView target, StringView fs_type, int flags); +ErrorOr umount(StringView mount_point); ErrorOr ptrace(int request, pid_t tid, void* address, void* data); ErrorOr disown(pid_t pid); #endif