mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-23 17:52:26 -05:00
c30e2c8d44
Only raw octal modes are supported right now. This patch also changes mode_t from 32-bit to 16-bit to match the on-disk type used by Ext2FS. I also ran into EPERM being errno=0 which was confusing, so I inserted an ESUCCESS in its place.
25 lines
424 B
C++
25 lines
424 B
C++
#include <sys/stat.h>
|
|
#include <errno.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);
|
|
}
|
|
|
|
}
|
|
|