X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fapi%2Fsys_stat.c;h=632af80ec975a8283e025a38b745ec14f32cc5f6;hb=1a68cdaedf8e9d379dc742f8a9c6198c0cb99dc5;hp=2e6b6fa73ae67c54ee5ff9bee85d3b44fd02c0f7;hpb=6a2161f389e6115bb3b948d71c56c8c882eaeda6;p=libc-test diff --git a/src/api/sys_stat.c b/src/api/sys_stat.c index 2e6b6fa..632af80 100644 --- a/src/api/sys_stat.c +++ b/src/api/sys_stat.c @@ -1,4 +1,5 @@ #include +#include "options.h" #define T(t) (t*)0; #define F(t,n) {t *y = &x.n;} #define C(n) switch(n){case n:;} @@ -14,8 +15,11 @@ T(uid_t) T(gid_t) T(off_t) T(time_t) -T(struct timespec) - +{ +struct timespec x; +F(time_t,tv_sec) +F(long,tv_nsec) +} { struct stat x; F(dev_t, st_dev) @@ -73,26 +77,28 @@ struct stat x = {0}; {int i = S_TYPEISMQ(&x);} {int i = S_TYPEISSEM(&x);} {int i = S_TYPEISSHM(&x);} +#ifdef POSIX_TYPED_MEMORY_OBJECTS {int i = S_TYPEISTMO(&x);} +#endif } C(UTIME_NOW) C(UTIME_OMIT) -int(*p_chmod)(const char*,mode_t) = chmod; -int(*p_fchmod)(int,mode_t) = fchmod; -int(*p_fchmodat)(int,const char*,mode_t,int) = fchmodat; -int(*p_fstat)(int,struct stat*) = fstat; -int(*p_fstatat)(int,const char*restrict,struct stat*restrict,int) = fstatat; -int(*p_futimens)(int,const struct timespec[]) = futimens; -int(*p_lstat)(const char*restrict,struct stat*restrict) = lstat; -int(*p_mkdir)(const char*,mode_t) = mkdir; -int(*p_mkdirat)(int,const char*,mode_t) = mkdirat; -int(*p_mkfifo)(const char*,mode_t) = mkfifo; -int(*p_mkfifoat)(int,const char*,mode_t) = mkfifoat; +{int(*p)(const char*,mode_t) = chmod;} +{int(*p)(int,mode_t) = fchmod;} +{int(*p)(int,const char*,mode_t,int) = fchmodat;} +{int(*p)(int,struct stat*) = fstat;} +{int(*p)(int,const char*restrict,struct stat*restrict,int) = fstatat;} +{int(*p)(int,const struct timespec[]) = futimens;} +{int(*p)(const char*restrict,struct stat*restrict) = lstat;} +{int(*p)(const char*,mode_t) = mkdir;} +{int(*p)(int,const char*,mode_t) = mkdirat;} +{int(*p)(const char*,mode_t) = mkfifo;} +{int(*p)(int,const char*,mode_t) = mkfifoat;} #ifdef _XOPEN_SOURCE -int(*p_mknod)(const char*,mode_t,dev_t) = mknod; -int(*p_mknodat)(int,const char*,mode_t,dev_t) = mknodat; +{int(*p)(const char*,mode_t,dev_t) = mknod;} +{int(*p)(int,const char*,mode_t,dev_t) = mknodat;} #endif -int(*p_stat)(const char*restrict,struct stat*restrict) = stat; -mode_t(*p_umask)(mode_t) = umask; -int(*p_utimensat)(int,const char*,const struct timespec[],int) = utimensat; +{int(*p)(const char*restrict,struct stat*restrict) = stat;} +{mode_t(*p)(mode_t) = umask;} +{int(*p)(int,const char*,const struct timespec[],int) = utimensat;} }