From 8ee57c885a72854d1884a886de4db538a8468e07 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Fri, 6 May 2022 14:41:58 +0200 Subject: syscalls: merge fork() and fs_fork2() --- src/init/fs/misc.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/init/fs/misc.c') 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 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; -- cgit v1.2.3