PatchworkOS  dbbdc99
A non-POSIX operating system.
Loading...
Searching...
No Matches
mkdir.c
Go to the documentation of this file.
1#include <stdarg.h>
2#include <stdio.h>
3#include <stdlib.h>
4#include <string.h>
5#include <sys/fs.h>
6
8
9uint64_t mkdir(const char* path)
10{
11 fd_t fd = open(F("%s:create:directory", path));
12 if (fd == ERR)
13 {
14 return ERR;
15 }
16 close(fd);
17 return 0;
18}
fd_t open(const char *path)
System call for opening files.
Definition open.c:8
uint64_t close(fd_t fd)
System call for closing files.
Definition close.c:8
#define F(format,...)
Allocates a formatted string on the stack.
Definition fs.h:67
uint64_t mkdir(const char *path)
Wrapper for creating a directory.
Definition mkdir.c:9
#define ERR
Integer error value.
Definition ERR.h:17
__UINT64_TYPE__ fd_t
File descriptor type.
Definition fd_t.h:10
__UINT64_TYPE__ uint64_t
Definition stdint.h:17