aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/include/syscall.h1
-rw-r--r--src/lib/libkogata/syscall.c14
2 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/include/syscall.h b/src/lib/include/syscall.h
index ddc0e18..b94c7fd 100644
--- a/src/lib/include/syscall.h
+++ b/src/lib/include/syscall.h
@@ -45,6 +45,7 @@ void fs_remove(const char* name);
pid_t new_proc();
bool bind_fs(pid_t pid, const char* new_name, const char* fs);
bool bind_subfs(pid_t pid, const char* new_name, const char* fs, const char* root, int ok_modes);
+bool bind_make_fs(pid_t pid, const char* name, const char* driver, fd_t source, const char* options);
bool bind_fd(pid_t pid, fd_t new_fd, fd_t fd);
bool proc_exec(pid_t pid, const char* file);
bool proc_status(pid_t pid, proc_status_t *s);
diff --git a/src/lib/libkogata/syscall.c b/src/lib/libkogata/syscall.c
index 4b31ab3..37b2a1a 100644
--- a/src/lib/libkogata/syscall.c
+++ b/src/lib/libkogata/syscall.c
@@ -99,6 +99,7 @@ bool make_fs(const char* name, const char* driver, fd_t source, const char* opti
.source_fd = source,
.opts = options,
.opts_strlen = strlen(options),
+ .bind_to_pid = 0,
};
return call(SC_MAKE_FS, (uint32_t)&args, 0, 0, 0, 0);
}
@@ -141,6 +142,19 @@ bool bind_subfs(pid_t pid, const char* new_name, const char* orig_fs, const char
};
return call(SC_BIND_SUBFS, (uint32_t)&args, 0, 0, 0, 0);
}
+bool bind_make_fs(pid_t pid, const char* name, const char* driver, fd_t source, const char* options) {
+ sc_make_fs_args_t args = {
+ .driver = driver,
+ .driver_strlen = strlen(driver),
+ .fs_name = name,
+ .fs_name_strlen = strlen(name),
+ .source_fd = source,
+ .opts = options,
+ .opts_strlen = strlen(options),
+ .bind_to_pid = pid,
+ };
+ return call(SC_BIND_MAKE_FS, (uint32_t)&args, 0, 0, 0, 0);
+}
bool bind_fd(pid_t pid, fd_t new_fd, fd_t fd) {
return call(SC_BIND_FD, new_fd, fd, 0, 0, 0);
}