summaryrefslogtreecommitdiff
path: root/src/libc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libc')
-rw-r--r--src/libc/camellia.c11
-rw-r--r--src/libc/include/camellia.h2
-rw-r--r--src/libc/syscall.c4
3 files changed, 17 insertions, 0 deletions
diff --git a/src/libc/camellia.c b/src/libc/camellia.c
index 4e092e4..bc38e77 100644
--- a/src/libc/camellia.c
+++ b/src/libc/camellia.c
@@ -28,3 +28,14 @@ hid_t camellia_open(const char *path, int flags) {
return ret;
}
+
+int camellia_procfs(const char *path) {
+ hid_t hid = _sys_getprocfs(0);
+ if (hid < 0) {
+ errno = -hid;
+ return -1;
+ }
+ _sys_mount(hid, path, strlen(path));
+ close(hid);
+ return 0;
+}
diff --git a/src/libc/include/camellia.h b/src/libc/include/camellia.h
index 2e4998b..49298bd 100644
--- a/src/libc/include/camellia.h
+++ b/src/libc/include/camellia.h
@@ -3,3 +3,5 @@
#include <camellia/types.h>
hid_t camellia_open(const char *path, int flags);
+
+int camellia_procfs(const char *path);
diff --git a/src/libc/syscall.c b/src/libc/syscall.c
index b920e14..706aec6 100644
--- a/src/libc/syscall.c
+++ b/src/libc/syscall.c
@@ -90,6 +90,10 @@ int _sys_wait2(int pid, int flags, struct sys_wait2 __user *out) {
return (int)_syscall(_SYS_WAIT2, (long)pid, (long)flags, (long)out, 0, 0);
}
+hid_t _sys_getprocfs(int flags) {
+ return (hid_t)_syscall(_SYS_GETPROCFS, (long)flags, 0, 0, 0, 0);
+}
+
long _sys_execbuf(void __user *buf, size_t len) {
return _syscall(_SYS_EXECBUF, (long)buf, (long)len, 0, 0, 0);
}