Blame src/api/sys_stat.c

nsz f81126
#include <sys/stat.h>
Szabolcs Nagy 87b251
#include "options.h"
nsz f81126
#define T(t) (t*)0;
nsz f81126
#define F(t,n) {t *y = &x.;;}
nsz f81126
#define C(n) switch(n){case n:;}
nsz f81126
static void f()
nsz f81126
{
nsz f81126
T(blkcnt_t)
nsz f81126
T(blksize_t)
nsz f81126
T(dev_t)
nsz f81126
T(ino_t)
nsz f81126
T(mode_t)
nsz f81126
T(nlink_t)
nsz f81126
T(uid_t)
nsz f81126
T(gid_t)
nsz f81126
T(off_t)
nsz f81126
T(time_t)
Szabolcs Nagy 7ab89d
{
Szabolcs Nagy 7ab89d
struct timespec x;
Szabolcs Nagy 7ab89d
F(time_t,tv_sec)
Szabolcs Nagy 7ab89d
F(long,tv_nsec)
Szabolcs Nagy 7ab89d
}
nsz f81126
{
nsz f81126
struct stat x;
nsz f81126
F(dev_t, st_dev)
nsz f81126
F(ino_t, st_ino)
nsz f81126
F(mode_t, st_mode)
nsz f81126
F(nlink_t, st_nlink)
nsz f81126
F(uid_t, st_uid)
nsz f81126
F(gid_t, st_gid)
nsz f81126
F(dev_t, st_rdev)
nsz f81126
F(off_t, st_size)
nsz f81126
F(struct timespec, st_atim)
nsz f81126
F(struct timespec, st_mtim)
nsz f81126
F(struct timespec, st_ctim)
nsz f81126
F(blksize_t, st_blksize)
nsz f81126
F(blkcnt_t, st_blocks)
nsz f81126
nsz f81126
F(time_t, st_atime)
nsz 6a2161
F(time_t, st_mtime)
nsz 6a2161
F(time_t, st_ctime)
nsz f81126
}
nsz f81126
C(S_IRWXU)
nsz f81126
C(S_IRUSR)
nsz f81126
C(S_IWUSR)
nsz f81126
C(S_IXUSR)
nsz f81126
C(S_IRWXG)
nsz f81126
C(S_IRGRP)
nsz f81126
C(S_IWGRP)
nsz f81126
C(S_IXGRP)
nsz f81126
C(S_IRWXO)
nsz f81126
C(S_IROTH)
nsz f81126
C(S_IWOTH)
nsz f81126
C(S_IXOTH)
nsz f81126
C(S_ISUID)
nsz f81126
C(S_ISGID)
nsz f81126
#ifdef _XOPEN_SOURCE
nsz f81126
C(S_ISVTX)
nsz f81126
C(S_IFMT)
nsz f81126
C(S_IFBLK)
nsz f81126
C(S_IFCHR)
nsz f81126
C(S_IFIFO)
nsz f81126
C(S_IFREG)
nsz f81126
C(S_IFDIR)
nsz f81126
C(S_IFLNK)
nsz f81126
C(S_IFSOCK)
nsz f81126
#endif
nsz f81126
C(S_ISBLK(0))
nsz f81126
C(S_ISCHR(0))
nsz f81126
C(S_ISDIR(0))
nsz f81126
C(S_ISFIFO(0))
nsz f81126
C(S_ISREG(0))
nsz f81126
C(S_ISLNK(0))
nsz f81126
C(S_ISSOCK(0))
nsz f81126
{
nsz f81126
struct stat x = {0};
nsz f81126
{int i = S_TYPEISMQ(&x);}
nsz f81126
{int i = S_TYPEISSEM(&x);}
nsz f81126
{int i = S_TYPEISSHM(&x);}
Szabolcs Nagy 87b251
#ifdef POSIX_TYPED_MEMORY_OBJECTS
nsz f81126
{int i = S_TYPEISTMO(&x);}
Szabolcs Nagy 87b251
#endif
nsz f81126
}
nsz f81126
C(UTIME_NOW)
nsz f81126
C(UTIME_OMIT)
nsz 0ef264
{int(*p)(const char*,mode_t) = chmod;}
nsz 0ef264
{int(*p)(int,mode_t) = fchmod;}
nsz 0ef264
{int(*p)(int,const char*,mode_t,int) = fchmodat;}
nsz 0ef264
{int(*p)(int,struct stat*) = fstat;}
nsz 0ef264
{int(*p)(int,const char*restrict,struct stat*restrict,int) = fstatat;}
nsz 0ef264
{int(*p)(int,const struct timespec[]) = futimens;}
nsz 0ef264
{int(*p)(const char*restrict,struct stat*restrict) = lstat;}
nsz 0ef264
{int(*p)(const char*,mode_t) = mkdir;}
nsz 0ef264
{int(*p)(int,const char*,mode_t) = mkdirat;}
nsz 0ef264
{int(*p)(const char*,mode_t) = mkfifo;}
nsz 0ef264
{int(*p)(int,const char*,mode_t) = mkfifoat;}
nsz f81126
#ifdef _XOPEN_SOURCE
nsz 0ef264
{int(*p)(const char*,mode_t,dev_t) = mknod;}
nsz 0ef264
{int(*p)(int,const char*,mode_t,dev_t) = mknodat;}
nsz f81126
#endif
nsz 0ef264
{int(*p)(const char*restrict,struct stat*restrict) = stat;}
nsz 0ef264
{mode_t(*p)(mode_t) = umask;}
nsz 0ef264
{int(*p)(int,const char*,const struct timespec[],int) = utimensat;}
nsz f81126
}