PatchworkOS
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/io.h
>
6
7
#include "
common/print.h
"
8
#include "
user/common/syscalls.h
"
9
10
uint64_t
mkdir
(
const
char
* path)
11
{
12
fd_t
fd =
openf
(
"%s:create:dir"
, path);
13
if
(fd ==
ERR
)
14
{
15
return
ERR
;
16
}
17
close
(fd);
18
return
0;
19
}
close
uint64_t close(fd_t fd)
System call for closing files.
Definition
close.c:9
mkdir
uint64_t mkdir(const char *path)
Wrapper for creating a directory.
Definition
mkdir.c:10
openf
fd_t openf(const char *_RESTRICT format,...)
Wrapper for opening files with a formatted path.
Definition
openf.c:9
ERR
#define ERR
Integer error value.
Definition
ERR.h:17
fd_t
__UINT64_TYPE__ fd_t
A file descriptor.
Definition
fd_t.h:12
io.h
print.h
syscalls.h
stdarg.h
uint64_t
__UINT64_TYPE__ uint64_t
Definition
stdint.h:17
stdio.h
stdlib.h
string.h
src
libstd
user
functions
io
mkdir.c
Generated by
1.9.8