diff options
Diffstat (limited to 'src/stat')
-rw-r--r-- | src/stat/chmod.c | 7 | ||||
-rw-r--r-- | src/stat/fchmod.c | 7 | ||||
-rw-r--r-- | src/stat/fchmodat.c | 7 | ||||
-rw-r--r-- | src/stat/fstat.c | 10 | ||||
-rw-r--r-- | src/stat/fstatat.c | 10 | ||||
-rw-r--r-- | src/stat/fstatvfs.c | 13 | ||||
-rw-r--r-- | src/stat/lstat.c | 10 | ||||
-rw-r--r-- | src/stat/mkdir.c | 7 | ||||
-rw-r--r-- | src/stat/mkdirat.c | 7 | ||||
-rw-r--r-- | src/stat/mkfifo.c | 6 | ||||
-rw-r--r-- | src/stat/mkfifoat.c | 6 | ||||
-rw-r--r-- | src/stat/mknod.c | 10 | ||||
-rw-r--r-- | src/stat/mknodat.c | 7 | ||||
-rw-r--r-- | src/stat/stat.c | 10 | ||||
-rw-r--r-- | src/stat/statvfs.c | 13 | ||||
-rw-r--r-- | src/stat/umask.c | 7 |
16 files changed, 137 insertions, 0 deletions
diff --git a/src/stat/chmod.c b/src/stat/chmod.c new file mode 100644 index 00000000..cb310fec --- /dev/null +++ b/src/stat/chmod.c @@ -0,0 +1,7 @@ +#include <sys/stat.h> +#include "syscall.h" + +int chmod(const char *path, mode_t mode) +{ + return syscall2(__NR_chmod, (long)path, mode); +} diff --git a/src/stat/fchmod.c b/src/stat/fchmod.c new file mode 100644 index 00000000..91897383 --- /dev/null +++ b/src/stat/fchmod.c @@ -0,0 +1,7 @@ +#include <sys/stat.h> +#include "syscall.h" + +int fchmod(int fd, mode_t mode) +{ + return syscall2(__NR_fchmod, fd, mode); +} diff --git a/src/stat/fchmodat.c b/src/stat/fchmodat.c new file mode 100644 index 00000000..f4f22b2c --- /dev/null +++ b/src/stat/fchmodat.c @@ -0,0 +1,7 @@ +#include <sys/stat.h> +#include "syscall.h" + +int fchmodat(int fd, const char *path, mode_t mode, int flag) +{ + return syscall4(__NR_fchmodat, fd, (long)path, mode, flag); +} diff --git a/src/stat/fstat.c b/src/stat/fstat.c new file mode 100644 index 00000000..5f643301 --- /dev/null +++ b/src/stat/fstat.c @@ -0,0 +1,10 @@ +#include <sys/stat.h> +#include "syscall.h" +#include "libc.h" + +int fstat(int fd, struct stat *buf) +{ + return syscall2(__NR_fstat64, fd, (long)buf); +} + +LFS64(fstat); diff --git a/src/stat/fstatat.c b/src/stat/fstatat.c new file mode 100644 index 00000000..22bc2934 --- /dev/null +++ b/src/stat/fstatat.c @@ -0,0 +1,10 @@ +#include <sys/stat.h> +#include "syscall.h" +#include "libc.h" + +int fstatat(int fd, const char *path, struct stat *buf, int flag) +{ + return syscall4(__NR_fstatat64, fd, (long)path, (long)buf, flag); +} + +LFS64(fstatat); diff --git a/src/stat/fstatvfs.c b/src/stat/fstatvfs.c new file mode 100644 index 00000000..83bd7486 --- /dev/null +++ b/src/stat/fstatvfs.c @@ -0,0 +1,13 @@ +#include <sys/statvfs.h> +#include "syscall.h" +#include "libc.h" + +int fstatvfs(int fd, struct statvfs *buf) +{ + return syscall2(__NR_fstatfs64, fd, (long)buf); +} + +weak_alias(fstatvfs, fstatfs); + +LFS64(fstatvfs); +LFS64(fstatfs); diff --git a/src/stat/lstat.c b/src/stat/lstat.c new file mode 100644 index 00000000..afdb5538 --- /dev/null +++ b/src/stat/lstat.c @@ -0,0 +1,10 @@ +#include <sys/stat.h> +#include "syscall.h" +#include "libc.h" + +int lstat(const char *path, struct stat *buf) +{ + return syscall2(__NR_lstat64, (long)path, (long)buf); +} + +LFS64(lstat); diff --git a/src/stat/mkdir.c b/src/stat/mkdir.c new file mode 100644 index 00000000..8295cad5 --- /dev/null +++ b/src/stat/mkdir.c @@ -0,0 +1,7 @@ +#include <sys/stat.h> +#include "syscall.h" + +int mkdir(const char *path, mode_t mode) +{ + return syscall2(__NR_mkdir, (long)path, mode); +} diff --git a/src/stat/mkdirat.c b/src/stat/mkdirat.c new file mode 100644 index 00000000..1fb38250 --- /dev/null +++ b/src/stat/mkdirat.c @@ -0,0 +1,7 @@ +#include <sys/stat.h> +#include "syscall.h" + +int mkdirat(int fd, const char *path, mode_t mode) +{ + return syscall3(__NR_mkdirat, fd, (long)path, mode); +} diff --git a/src/stat/mkfifo.c b/src/stat/mkfifo.c new file mode 100644 index 00000000..60efcf73 --- /dev/null +++ b/src/stat/mkfifo.c @@ -0,0 +1,6 @@ +#include <sys/stat.h> + +int mkfifo(const char *path, mode_t mode) +{ + return mknod(path, mode | S_IFIFO, 0); +} diff --git a/src/stat/mkfifoat.c b/src/stat/mkfifoat.c new file mode 100644 index 00000000..d3a1f970 --- /dev/null +++ b/src/stat/mkfifoat.c @@ -0,0 +1,6 @@ +#include <sys/stat.h> + +int mkfifoat(int fd, const char *path, mode_t mode) +{ + return mknodat(fd, path, mode | S_IFIFO, 0); +} diff --git a/src/stat/mknod.c b/src/stat/mknod.c new file mode 100644 index 00000000..0123eeef --- /dev/null +++ b/src/stat/mknod.c @@ -0,0 +1,10 @@ +#include <sys/stat.h> +#include "syscall.h" + +int mknod(const char *path, mode_t mode, dev_t dev) +{ + /* since dev_t is system-specific anyway we defer to the idiotic + * legacy-compatible bitfield mapping of the type.. at least we've + * made it large enough to leave space for future expansion.. */ + return syscall3(__NR_mknod, (long)path, mode, dev & 0xffff); +} diff --git a/src/stat/mknodat.c b/src/stat/mknodat.c new file mode 100644 index 00000000..b5687e47 --- /dev/null +++ b/src/stat/mknodat.c @@ -0,0 +1,7 @@ +#include <sys/stat.h> +#include "syscall.h" + +int mknodat(int fd, const char *path, mode_t mode, dev_t dev) +{ + return syscall4(__NR_mknodat, fd, (long)path, mode, dev & 0xffff); +} diff --git a/src/stat/stat.c b/src/stat/stat.c new file mode 100644 index 00000000..67640cc1 --- /dev/null +++ b/src/stat/stat.c @@ -0,0 +1,10 @@ +#include <sys/stat.h> +#include "syscall.h" +#include "libc.h" + +int stat(const char *path, struct stat *buf) +{ + return syscall2(__NR_stat64, (long)path, (long)buf); +} + +LFS64(stat); diff --git a/src/stat/statvfs.c b/src/stat/statvfs.c new file mode 100644 index 00000000..55a05d52 --- /dev/null +++ b/src/stat/statvfs.c @@ -0,0 +1,13 @@ +#include <sys/statvfs.h> +#include "syscall.h" +#include "libc.h" + +int statvfs(const char *path, struct statvfs *buf) +{ + return syscall2(__NR_statfs64, (long)path, (long)buf); +} + +weak_alias(statvfs, statfs); + +LFS64(statvfs); +LFS64(statfs); diff --git a/src/stat/umask.c b/src/stat/umask.c new file mode 100644 index 00000000..49cb48a6 --- /dev/null +++ b/src/stat/umask.c @@ -0,0 +1,7 @@ +#include <sys/stat.h> +#include "syscall.h" + +mode_t umask(mode_t mode) +{ + return syscall1(__NR_umask, mode); +} |