summaryrefslogtreecommitdiff
path: root/src/user/fs/misc.h
diff options
context:
space:
mode:
authordzwdz2022-07-11 21:54:51 +0200
committerdzwdz2022-07-11 21:54:51 +0200
commit2e79a2e5af3affa7a6a3becdffb1c91d89af90af (patch)
treec253761c4ec010ad14b08f9ee8dfc1a50411b30f /src/user/fs/misc.h
parent6c01d9a7e34e1fccc2775b0e2187ac5e50dd4392 (diff)
user: reorganize the userland sources
Diffstat (limited to 'src/user/fs/misc.h')
-rw-r--r--src/user/fs/misc.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/user/fs/misc.h b/src/user/fs/misc.h
new file mode 100644
index 0000000..3a8b071
--- /dev/null
+++ b/src/user/fs/misc.h
@@ -0,0 +1,16 @@
+#pragma once
+#include <user/lib/stdlib.h>
+#include <stdbool.h>
+
+bool fork2_n_mount(const char *path);
+
+void fs_passthru(const char *prefix);
+void fs_whitelist(const char **list);
+
+void fs_dir_inject(const char *path);
+
+/** Mounts something and injects its path into the fs */
+// TODO path needs to have a trailing slash
+#define MOUNT(path, impl) \
+ if (!fork2_n_mount(path)) {_klogf("impl %s", path); impl;} \
+ if (!fork2_n_mount("/")) {_klogf("dir for %s", path); fs_dir_inject(path);}