mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-18 12:16:31 +00:00
🆕 fat32文件系统的mkdir
This commit is contained in:
@ -1,8 +1,11 @@
|
||||
|
||||
all: wait.o
|
||||
all: wait.o stat.o
|
||||
|
||||
CFLAGS += -I .
|
||||
|
||||
|
||||
wait.o: wait.c
|
||||
gcc $(CFLAGS) -c wait.c -o wait.o
|
||||
|
||||
stat.o: stat.c
|
||||
gcc $(CFLAGS) -c stat.c -o stat.o
|
7
user/libs/libc/sys/stat.c
Normal file
7
user/libs/libc/sys/stat.c
Normal file
@ -0,0 +1,7 @@
|
||||
#include "stat.h"
|
||||
#include<libsystem/syscall.h>
|
||||
|
||||
int mkdir(const char *path, mode_t mode)
|
||||
{
|
||||
return syscall_invoke(SYS_MKDIR, (uint64_t)path, (uint64_t)mode, 0,0,0,0,0,0);
|
||||
}
|
4
user/libs/libc/sys/stat.h
Normal file
4
user/libs/libc/sys/stat.h
Normal file
@ -0,0 +1,4 @@
|
||||
#pragma once
|
||||
#include <libc/sys/types.h>
|
||||
|
||||
int mkdir(const char *path, mode_t mode);
|
@ -21,6 +21,7 @@
|
||||
#define SYS_EXECVE 14 // 执行新的应用程序
|
||||
#define SYS_WAIT4 15 // 等待进程退出
|
||||
#define SYS_EXIT 16 // 进程退出
|
||||
#define SYS_MKDIR 17 // 创建文件夹
|
||||
|
||||
/**
|
||||
* @brief 用户态系统调用函数
|
||||
|
Reference in New Issue
Block a user