conclusion

This commit is contained in:
pommicket 2022-02-20 13:18:21 -08:00
parent 0f97a589b8
commit 9bc8a11afe
1069 changed files with 48694 additions and 11 deletions

View file

@ -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);
}

View file

@ -0,0 +1,7 @@
#include <sys/stat.h>
#include "syscall.h"
int fchmod(int fd, mode_t mode)
{
return syscall2(__NR_fchmod, fd, mode);
}

View file

@ -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);
}

View file

@ -0,0 +1,10 @@
#include <sys/stat.h>
#include "syscall.h"
#include "libc.h"
int fstat(int fd, struct stat *buf)
{
return syscall2(__NR_fstat, fd, (long)buf);
}
LFS64(fstat);

View file

@ -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_fstatat, fd, (long)path, (long)buf, flag);
}
LFS64(fstatat);

View file

@ -0,0 +1,13 @@
#include <sys/statvfs.h>
#include "syscall.h"
#include "libc.h"
int fstatvfs(int fd, struct statvfs *buf)
{
return syscall2(__NR_fstatfs, fd, (long)buf);
}
weak_alias(fstatvfs, fstatfs);
LFS64(fstatvfs);
LFS64(fstatfs);

View file

@ -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_lstat, (long)path, (long)buf);
}
LFS64(lstat);

View file

@ -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);
}

View file

@ -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);
}

View file

@ -0,0 +1,6 @@
#include <sys/stat.h>
int mkfifo(const char *path, mode_t mode)
{
return mknod(path, mode | S_IFIFO, 0);
}

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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_stat, (long)path, (long)buf);
}
LFS64(stat);

View file

@ -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_statfs, (long)path, (long)buf);
}
weak_alias(statvfs, statfs);
LFS64(statvfs);
LFS64(statfs);

View file

@ -0,0 +1,7 @@
#include <sys/stat.h>
#include "syscall.h"
mode_t umask(mode_t mode)
{
return syscall1(__NR_umask, mode);
}