mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:17:35 +00:00
Kernel: Pass a parameter struct to mount()
This was the last remaining syscall that took a null-terminated string and figured out how long it was by walking it in kernelspace *shudder*.
This commit is contained in:
parent
e380142853
commit
f5092b1c7e
5 changed files with 43 additions and 24 deletions
|
@ -610,9 +610,14 @@ int reboot()
|
|||
__RETURN_WITH_ERRNO(rc, rc, -1);
|
||||
}
|
||||
|
||||
int mount(const char* device, const char* mountpoint, const char* fstype)
|
||||
int mount(const char* source, const char* target, const char* fs_type)
|
||||
{
|
||||
int rc = syscall(SC_mount, device, mountpoint, fstype);
|
||||
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) } };
|
||||
int rc = syscall(SC_mount, ¶ms);
|
||||
__RETURN_WITH_ERRNO(rc, rc, -1);
|
||||
}
|
||||
|
||||
|
|
|
@ -111,7 +111,7 @@ int fchown(int fd, uid_t, gid_t);
|
|||
int ftruncate(int fd, off_t length);
|
||||
int halt();
|
||||
int reboot();
|
||||
int mount(const char* device, const char* mountpoint, const char* fstype);
|
||||
int mount(const char* source, const char* target, const char* fs_type);
|
||||
int umount(const char* mountpoint);
|
||||
|
||||
enum {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue