summaryrefslogtreecommitdiff
path: root/userland/libc
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2023-10-23 22:13:19 +0200
committerAnton Kling <anton@kling.gg>2023-10-23 23:36:34 +0200
commite05d72ba8f09866b768f3da7776b807072ed7b9b (patch)
treedc9a1ec45802df7c74ddc9fdd78436b23122e44a /userland/libc
parent6458875860cde6421a06031702788d9969e0a5db (diff)
VFS/libc: Create a syscall for mkdir and add the function to libc
Diffstat (limited to 'userland/libc')
-rw-r--r--userland/libc/include/syscall.h1
-rw-r--r--userland/libc/sys/stat/mkdir.c7
2 files changed, 3 insertions, 5 deletions
diff --git a/userland/libc/include/syscall.h b/userland/libc/include/syscall.h
index caa7779..b3863d2 100644
--- a/userland/libc/include/syscall.h
+++ b/userland/libc/include/syscall.h
@@ -31,6 +31,7 @@
#define SYS_STAT 23
#define SYS_MSLEEP 24
#define SYS_UPTIME 25
+#define SYS_MKDIR 26
int syscall(uint32_t eax, uint32_t ebx, uint32_t ecx, uint32_t edx,
uint32_t esi, uint32_t edi);
diff --git a/userland/libc/sys/stat/mkdir.c b/userland/libc/sys/stat/mkdir.c
index c057fa7..927afd8 100644
--- a/userland/libc/sys/stat/mkdir.c
+++ b/userland/libc/sys/stat/mkdir.c
@@ -1,9 +1,6 @@
#include <sys/stat.h>
-#include <assert.h>
+#include <syscall.h>
int mkdir(const char *path, mode_t mode) {
- (void)path;
- (void)mode;
- assert(0); // TODO: Implement
- return 0;
+ return syscall(SYS_MKDIR, (void *)path, (void *)mode, 0, 0, 0);
}