diff options
author | Liav A <liavalb@gmail.com> | 2020-03-26 02:51:16 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-04-02 12:03:08 +0200 |
commit | a60ea79a41845767ce40f225de20da7c99534ad1 (patch) | |
tree | 771b082c27a3cf8060fb23a8548be83ec8837677 /Libraries/LibC | |
parent | 6b59311d4bdc1447e085573f9bd2c42819e264dd (diff) | |
download | serenity-a60ea79a41845767ce40f225de20da7c99534ad1.zip |
Kernel & Userland: Allow to mount image files formatted with Ext2FS
Diffstat (limited to 'Libraries/LibC')
-rw-r--r-- | Libraries/LibC/unistd.cpp | 7 | ||||
-rw-r--r-- | Libraries/LibC/unistd.h | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/Libraries/LibC/unistd.cpp b/Libraries/LibC/unistd.cpp index cd17c7ae83..10fffdd1a1 100644 --- a/Libraries/LibC/unistd.cpp +++ b/Libraries/LibC/unistd.cpp @@ -582,14 +582,15 @@ int reboot() __RETURN_WITH_ERRNO(rc, rc, -1); } -int mount(const char* source, const char* target, const char* fs_type, int flags) +int mount(int source_fd, const char* target, const char* fs_type, int flags) { - if (!source || !target || !fs_type) { + if (!target || !fs_type) { errno = EFAULT; return -1; } + Syscall::SC_mount_params params { - { source, strlen(source) }, + source_fd, { target, strlen(target) }, { fs_type, strlen(fs_type) }, flags diff --git a/Libraries/LibC/unistd.h b/Libraries/LibC/unistd.h index 2566abfdfd..bf8e80068c 100644 --- a/Libraries/LibC/unistd.h +++ b/Libraries/LibC/unistd.h @@ -129,7 +129,7 @@ int fchown(int fd, uid_t, gid_t); int ftruncate(int fd, off_t length); int halt(); int reboot(); -int mount(const char* source, const char* target, const char* fs_type, int flags); +int mount(int source_fd, const char* target, const char* fs_type, int flags); int umount(const char* mountpoint); int pledge(const char* promises, const char* execpromises); int unveil(const char* path, const char* permissions); |