mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
1b16a29044
/bin/cp will now copy the permission bits from source to destination. :^)
33 lines
580 B
C++
33 lines
580 B
C++
#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);
|
|
}
|
|
|
|
}
|
|
|