From 9f3fdb830f61cd8c8c1f1db9d03cba1c546c1a7e Mon Sep 17 00:00:00 2001 From: dzwdz Date: Sun, 24 Jul 2022 15:07:57 +0200 Subject: user: change the directory structure to prepare for multiple binaries --- src/user/lib/fs/misc.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/user/lib/fs/misc.h (limited to 'src/user/lib/fs/misc.h') diff --git a/src/user/lib/fs/misc.h b/src/user/lib/fs/misc.h new file mode 100644 index 0000000..3a8b071 --- /dev/null +++ b/src/user/lib/fs/misc.h @@ -0,0 +1,16 @@ +#pragma once +#include +#include + +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);} -- cgit v1.2.3