add ere backref regression test
[libc-test] / src / api / sys_stat.c
index 2e6b6fa..632af80 100644 (file)
@@ -1,4 +1,5 @@
 #include <sys/stat.h>
+#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;}
 }