diff options
Diffstat (limited to 'src/user/lib/fs/misc.c')
-rw-r--r-- | src/user/lib/fs/misc.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/user/lib/fs/misc.c b/src/user/lib/fs/misc.c index 95fef60..e47d930 100644 --- a/src/user/lib/fs/misc.c +++ b/src/user/lib/fs/misc.c @@ -202,3 +202,19 @@ void fs_dir_inject(const char *path) { } exit(0); } + +bool mount_at_pred(const char *path) { + // TODO preprocess path - simplify & ensure trailing slash + if (!fork2_n_mount(path)) { + /* child -> go into the for body */ + _klogf("%s: impl", path); + return true; + } + + if (strcmp("/", path) && !fork2_n_mount("/")) { + _klogf("%s: dir", path); + fs_dir_inject(path); + exit(1); + } + return false; /* continue after the for loop */ +} |