Kernel+LibC: Add support for mount flags

At the moment, the actual flags are ignored, but we correctly propagate them all
the way from the original mount() syscall to each custody that resides on the
mounted FS.
This commit is contained in:
Sergey Bugaev 2020-01-11 18:25:26 +03:00 committed by Andreas Kling
commit 4566c2d811
Notes: sideshowbarker 2024-07-19 10:11:57 +09:00
10 changed files with 54 additions and 34 deletions

View file

@ -610,13 +610,18 @@ int reboot()
__RETURN_WITH_ERRNO(rc, rc, -1);
}
int mount(const char* source, const char* target, const char* fs_type)
int mount(const char* source, const char* target, const char* fs_type, int flags)
{
if (!source || !target || !fs_type) {
errno = EFAULT;
return -1;
}
Syscall::SC_mount_params params { { source, strlen(source) }, { target, strlen(target) }, { fs_type, strlen(fs_type) } };
Syscall::SC_mount_params params {
{ source, strlen(source) },
{ target, strlen(target) },
{ fs_type, strlen(fs_type) },
flags
};
int rc = syscall(SC_mount, &params);
__RETURN_WITH_ERRNO(rc, rc, -1);
}