From e05d72ba8f09866b768f3da7776b807072ed7b9b Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Mon, 23 Oct 2023 22:13:19 +0200 Subject: VFS/libc: Create a syscall for mkdir and add the function to libc --- userland/libc/include/syscall.h | 1 + userland/libc/sys/stat/mkdir.c | 7 ++----- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'userland') 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 -#include +#include 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); } -- cgit v1.2.3