summaryrefslogtreecommitdiff
path: root/src/init/fs
diff options
context:
space:
mode:
authordzwdz2021-11-16 20:45:13 +0100
committerdzwdz2021-11-16 20:45:13 +0100
commitf9f1795a754c57d6d148e202dbc7864576cf2d47 (patch)
tree3b6129be8262164b4b2273187797601d5d18b469 /src/init/fs
parentf2591b500c19cddee59edcf80a5ccdffc3ba3585 (diff)
init: implement fork2_n_mount
Diffstat (limited to 'src/init/fs')
-rw-r--r--src/init/fs/misc.c8
-rw-r--r--src/init/fs/misc.h3
2 files changed, 11 insertions, 0 deletions
diff --git a/src/init/fs/misc.c b/src/init/fs/misc.c
index a8d9517..55d14fa 100644
--- a/src/init/fs/misc.c
+++ b/src/init/fs/misc.c
@@ -1,7 +1,15 @@
+#include <init/fs/misc.h>
#include <init/stdlib.h>
#include <shared/flags.h>
+#include <shared/mem.h>
#include <shared/syscalls.h>
+bool fork2_n_mount(const char *path) {
+ handle_t h = _syscall_fs_fork2();
+ if (h) _syscall_mount(h, path, strlen(path));
+ return h;
+}
+
void fs_passthru(void) {
struct fs_wait_response res;
int buf_size = 64;
diff --git a/src/init/fs/misc.h b/src/init/fs/misc.h
index c7ce7c7..87d5bdb 100644
--- a/src/init/fs/misc.h
+++ b/src/init/fs/misc.h
@@ -1,3 +1,6 @@
#pragma once
+#include <stdbool.h>
+
+bool fork2_n_mount(const char *path);
void fs_passthru(void);