ladybird/LibC/stat.cpp

32 lines
578 B
C++
Raw Normal View History

2019-06-07 09:49:03 +00:00
#include <Kernel/Syscall.h>
#include <assert.h>
2019-06-07 09:49:03 +00:00
#include <errno.h>
#include <stdio.h>
2019-06-07 09:49:03 +00:00
#include <sys/stat.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);
}
}