mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 21:47:45 +00:00
Kernel+Userland: Split bind-mounting and re-mounting from mount syscall
These 2 are an actual separate types of syscalls, so let's stop using special flags for bind mounting or re-mounting and instead let userspace calling directly for this kind of actions.
This commit is contained in:
parent
04b44a827a
commit
0bbd9040ef
10 changed files with 204 additions and 42 deletions
|
@ -232,6 +232,33 @@ ErrorOr<void> ptrace_peekbuf(pid_t tid, void const* tracee_addr, Bytes destinati
|
|||
HANDLE_SYSCALL_RETURN_VALUE("ptrace_peekbuf", rc, {});
|
||||
}
|
||||
|
||||
ErrorOr<void> bindmount(int source_fd, StringView target, int flags)
|
||||
{
|
||||
if (target.is_null())
|
||||
return Error::from_errno(EFAULT);
|
||||
|
||||
Syscall::SC_bindmount_params params {
|
||||
{ target.characters_without_null_termination(), target.length() },
|
||||
source_fd,
|
||||
flags,
|
||||
};
|
||||
int rc = syscall(SC_bindmount, ¶ms);
|
||||
HANDLE_SYSCALL_RETURN_VALUE("bindmount", rc, {});
|
||||
}
|
||||
|
||||
ErrorOr<void> remount(StringView target, int flags)
|
||||
{
|
||||
if (target.is_null())
|
||||
return Error::from_errno(EFAULT);
|
||||
|
||||
Syscall::SC_remount_params params {
|
||||
{ target.characters_without_null_termination(), target.length() },
|
||||
flags
|
||||
};
|
||||
int rc = syscall(SC_remount, ¶ms);
|
||||
HANDLE_SYSCALL_RETURN_VALUE("remount", rc, {});
|
||||
}
|
||||
|
||||
ErrorOr<void> mount(int source_fd, StringView target, StringView fs_type, int flags)
|
||||
{
|
||||
if (target.is_null() || fs_type.is_null())
|
||||
|
|
|
@ -59,6 +59,8 @@ ErrorOr<void> sendfd(int sockfd, int fd);
|
|||
ErrorOr<int> recvfd(int sockfd, int options);
|
||||
ErrorOr<void> ptrace_peekbuf(pid_t tid, void const* tracee_addr, Bytes destination_buf);
|
||||
ErrorOr<void> mount(int source_fd, StringView target, StringView fs_type, int flags);
|
||||
ErrorOr<void> bindmount(int source_fd, StringView target, int flags);
|
||||
ErrorOr<void> remount(StringView target, 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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue