initial check-in, version 0.5.0

This commit is contained in:
Rich Felker 2011-02-12 00:22:29 -05:00
commit 0b44a0315b
1021 changed files with 45711 additions and 0 deletions

7
src/stat/chmod.c Normal file
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);
}

7
src/stat/fchmod.c Normal file
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);
}

7
src/stat/fchmodat.c Normal file
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);
}

10
src/stat/fstat.c Normal file
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_fstat64, fd, (long)buf);
}
LFS64(fstat);

10
src/stat/fstatat.c Normal file
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_fstatat64, fd, (long)path, (long)buf, flag);
}
LFS64(fstatat);

13
src/stat/fstatvfs.c Normal file
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_fstatfs64, fd, (long)buf);
}
weak_alias(fstatvfs, fstatfs);
LFS64(fstatvfs);
LFS64(fstatfs);

10
src/stat/lstat.c Normal file
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_lstat64, (long)path, (long)buf);
}
LFS64(lstat);

7
src/stat/mkdir.c Normal file
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);
}

7
src/stat/mkdirat.c Normal file
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);
}

6
src/stat/mkfifo.c Normal file
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);
}

6
src/stat/mkfifoat.c Normal file
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);
}

10
src/stat/mknod.c Normal file
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);
}

7
src/stat/mknodat.c Normal file
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);
}

10
src/stat/stat.c Normal file
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_stat64, (long)path, (long)buf);
}
LFS64(stat);

13
src/stat/statvfs.c Normal file
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_statfs64, (long)path, (long)buf);
}
weak_alias(statvfs, statfs);
LFS64(statvfs);
LFS64(statfs);

7
src/stat/umask.c Normal file
View file

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