summaryrefslogtreecommitdiff
path: root/LibC/stat.cpp
blob: 8c1f84458fcf05c7a63570cd469d479babaa5e4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <sys/stat.h>
#include <errno.h>
#include <assert.h>
#include <stdio.h>
#include <Kernel/Syscall.h>

extern "C" {

mode_t umask(mode_t mask)
{
    return syscall(SC_umask, mask);
}

int mkdir(const char* pathname, mode_t mode)
{
    int rc = syscall(SC_mkdir, pathname, mode);
    __RETURN_WITH_ERRNO(rc, rc, -1);
}

int chmod(const char* pathname, mode_t mode)
{
    int rc = syscall(SC_chmod, pathname, mode);
    __RETURN_WITH_ERRNO(rc, rc, -1);
}

int fchmod(int fd, mode_t mode)
{
    int rc = syscall(SC_fchmod, fd, mode);
    __RETURN_WITH_ERRNO(rc, rc, -1);
}

}