2019-06-07 09:49:03 +00:00
|
|
|
#include <Kernel/Syscall.h>
|
2019-02-08 01:38:21 +00:00
|
|
|
#include <assert.h>
|
2019-06-07 09:49:03 +00:00
|
|
|
#include <errno.h>
|
2019-02-08 01:38:21 +00:00
|
|
|
#include <stdio.h>
|
2019-06-07 09:49:03 +00:00
|
|
|
#include <sys/stat.h>
|
2018-11-06 14:45:16 +00:00
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
|
|
|
|
mode_t umask(mode_t mask)
|
|
|
|
{
|
2018-12-21 02:02:06 +00:00
|
|
|
return syscall(SC_umask, mask);
|
2018-11-06 14:45:16 +00:00
|
|
|
}
|
|
|
|
|
2018-11-18 13:57:41 +00:00
|
|
|
int mkdir(const char* pathname, mode_t mode)
|
|
|
|
{
|
2018-12-21 02:02:06 +00:00
|
|
|
int rc = syscall(SC_mkdir, pathname, mode);
|
2018-11-18 13:57:41 +00:00
|
|
|
__RETURN_WITH_ERRNO(rc, rc, -1);
|
|
|
|
}
|
|
|
|
|
2019-01-29 03:55:08 +00:00
|
|
|
int chmod(const char* pathname, mode_t mode)
|
|
|
|
{
|
|
|
|
int rc = syscall(SC_chmod, pathname, mode);
|
|
|
|
__RETURN_WITH_ERRNO(rc, rc, -1);
|
|
|
|
}
|
|
|
|
|
2019-02-08 01:38:21 +00:00
|
|
|
int fchmod(int fd, mode_t mode)
|
|
|
|
{
|
2019-03-01 09:39:19 +00:00
|
|
|
int rc = syscall(SC_fchmod, fd, mode);
|
|
|
|
__RETURN_WITH_ERRNO(rc, rc, -1);
|
2019-02-08 01:38:21 +00:00
|
|
|
}
|
2018-11-06 14:45:16 +00:00
|
|
|
}
|