summaryrefslogtreecommitdiff
path: root/src/init/fs/misc.c
diff options
context:
space:
mode:
authordzwdz2022-05-06 14:41:58 +0200
committerdzwdz2022-05-06 14:41:58 +0200
commit8ee57c885a72854d1884a886de4db538a8468e07 (patch)
tree9c9f2eea8d7667ce7ed45dd71b6bbde40ce93f7e /src/init/fs/misc.c
parent53d21d1ccb75004d0085efedd688b695707a3138 (diff)
syscalls: merge fork() and fs_fork2()
Diffstat (limited to 'src/init/fs/misc.c')
-rw-r--r--src/init/fs/misc.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/init/fs/misc.c b/src/init/fs/misc.c
index ca3128d..f4965d5 100644
--- a/src/init/fs/misc.c
+++ b/src/init/fs/misc.c
@@ -6,9 +6,12 @@
#include <stdbool.h>
bool fork2_n_mount(const char *path) {
- handle_t h = _syscall_fs_fork2();
- if (h) _syscall_mount(h, path, strlen(path));
- return h;
+ handle_t h;
+ if (_syscall_fork(FORK_NEWFS, &h) > 0) { /* parent */
+ _syscall_mount(h, path, strlen(path));
+ return true;
+ }
+ return false;
}
static void fs_respond_delegate(struct fs_wait_response *res, handle_t delegate, const char *og_buf) {
@@ -53,7 +56,7 @@ static void fs_respond_delegate(struct fs_wait_response *res, handle_t delegate,
switch (res->op) {
case VFSOP_READ:
- if (_syscall_fork(FORK_NOREAP)) {
+ if (_syscall_fork(FORK_NOREAP, NULL)) {
// handle reads in a child
// this is a HORRIBLE workaround for making concurrent IO work without proper delegates
break;