1570af302Sopenharmony_ci#include <sys/stat.h>
2570af302Sopenharmony_ci#include "options.h"
3570af302Sopenharmony_ci#define T(t) (t*)0;
4570af302Sopenharmony_ci#define F(t,n) {t *y = &x.n;}
5570af302Sopenharmony_ci#define C(n) switch(n){case n:;}
6570af302Sopenharmony_cistatic void f()
7570af302Sopenharmony_ci{
8570af302Sopenharmony_ciT(blkcnt_t)
9570af302Sopenharmony_ciT(blksize_t)
10570af302Sopenharmony_ciT(dev_t)
11570af302Sopenharmony_ciT(ino_t)
12570af302Sopenharmony_ciT(mode_t)
13570af302Sopenharmony_ciT(nlink_t)
14570af302Sopenharmony_ciT(uid_t)
15570af302Sopenharmony_ciT(gid_t)
16570af302Sopenharmony_ciT(off_t)
17570af302Sopenharmony_ciT(time_t)
18570af302Sopenharmony_ci{
19570af302Sopenharmony_cistruct timespec x;
20570af302Sopenharmony_ciF(time_t,tv_sec)
21570af302Sopenharmony_ciF(long,tv_nsec)
22570af302Sopenharmony_ci}
23570af302Sopenharmony_ci{
24570af302Sopenharmony_cistruct stat x;
25570af302Sopenharmony_ciF(dev_t, st_dev)
26570af302Sopenharmony_ciF(ino_t, st_ino)
27570af302Sopenharmony_ciF(mode_t, st_mode)
28570af302Sopenharmony_ciF(nlink_t, st_nlink)
29570af302Sopenharmony_ciF(uid_t, st_uid)
30570af302Sopenharmony_ciF(gid_t, st_gid)
31570af302Sopenharmony_ciF(dev_t, st_rdev)
32570af302Sopenharmony_ciF(off_t, st_size)
33570af302Sopenharmony_ciF(struct timespec, st_atim)
34570af302Sopenharmony_ciF(struct timespec, st_mtim)
35570af302Sopenharmony_ciF(struct timespec, st_ctim)
36570af302Sopenharmony_ciF(blksize_t, st_blksize)
37570af302Sopenharmony_ciF(blkcnt_t, st_blocks)
38570af302Sopenharmony_ci
39570af302Sopenharmony_ciF(time_t, st_atime)
40570af302Sopenharmony_ciF(time_t, st_mtime)
41570af302Sopenharmony_ciF(time_t, st_ctime)
42570af302Sopenharmony_ci}
43570af302Sopenharmony_ciC(S_IRWXU)
44570af302Sopenharmony_ciC(S_IRUSR)
45570af302Sopenharmony_ciC(S_IWUSR)
46570af302Sopenharmony_ciC(S_IXUSR)
47570af302Sopenharmony_ciC(S_IRWXG)
48570af302Sopenharmony_ciC(S_IRGRP)
49570af302Sopenharmony_ciC(S_IWGRP)
50570af302Sopenharmony_ciC(S_IXGRP)
51570af302Sopenharmony_ciC(S_IRWXO)
52570af302Sopenharmony_ciC(S_IROTH)
53570af302Sopenharmony_ciC(S_IWOTH)
54570af302Sopenharmony_ciC(S_IXOTH)
55570af302Sopenharmony_ciC(S_ISUID)
56570af302Sopenharmony_ciC(S_ISGID)
57570af302Sopenharmony_ci#ifdef _XOPEN_SOURCE
58570af302Sopenharmony_ciC(S_ISVTX)
59570af302Sopenharmony_ciC(S_IFMT)
60570af302Sopenharmony_ciC(S_IFBLK)
61570af302Sopenharmony_ciC(S_IFCHR)
62570af302Sopenharmony_ciC(S_IFIFO)
63570af302Sopenharmony_ciC(S_IFREG)
64570af302Sopenharmony_ciC(S_IFDIR)
65570af302Sopenharmony_ciC(S_IFLNK)
66570af302Sopenharmony_ciC(S_IFSOCK)
67570af302Sopenharmony_ci#endif
68570af302Sopenharmony_ciC(S_ISBLK(0))
69570af302Sopenharmony_ciC(S_ISCHR(0))
70570af302Sopenharmony_ciC(S_ISDIR(0))
71570af302Sopenharmony_ciC(S_ISFIFO(0))
72570af302Sopenharmony_ciC(S_ISREG(0))
73570af302Sopenharmony_ciC(S_ISLNK(0))
74570af302Sopenharmony_ciC(S_ISSOCK(0))
75570af302Sopenharmony_ci{
76570af302Sopenharmony_cistruct stat x = {0};
77570af302Sopenharmony_ci{int i = S_TYPEISMQ(&x);}
78570af302Sopenharmony_ci{int i = S_TYPEISSEM(&x);}
79570af302Sopenharmony_ci{int i = S_TYPEISSHM(&x);}
80570af302Sopenharmony_ci#ifdef POSIX_TYPED_MEMORY_OBJECTS
81570af302Sopenharmony_ci{int i = S_TYPEISTMO(&x);}
82570af302Sopenharmony_ci#endif
83570af302Sopenharmony_ci}
84570af302Sopenharmony_ciC(UTIME_NOW)
85570af302Sopenharmony_ciC(UTIME_OMIT)
86570af302Sopenharmony_ci{int(*p)(const char*,mode_t) = chmod;}
87570af302Sopenharmony_ci{int(*p)(int,mode_t) = fchmod;}
88570af302Sopenharmony_ci{int(*p)(int,const char*,mode_t,int) = fchmodat;}
89570af302Sopenharmony_ci{int(*p)(int,struct stat*) = fstat;}
90570af302Sopenharmony_ci{int(*p)(int,const char*restrict,struct stat*restrict,int) = fstatat;}
91570af302Sopenharmony_ci{int(*p)(int,const struct timespec[]) = futimens;}
92570af302Sopenharmony_ci{int(*p)(const char*restrict,struct stat*restrict) = lstat;}
93570af302Sopenharmony_ci{int(*p)(const char*,mode_t) = mkdir;}
94570af302Sopenharmony_ci{int(*p)(int,const char*,mode_t) = mkdirat;}
95570af302Sopenharmony_ci{int(*p)(const char*,mode_t) = mkfifo;}
96570af302Sopenharmony_ci{int(*p)(int,const char*,mode_t) = mkfifoat;}
97570af302Sopenharmony_ci#ifdef _XOPEN_SOURCE
98570af302Sopenharmony_ci{int(*p)(const char*,mode_t,dev_t) = mknod;}
99570af302Sopenharmony_ci{int(*p)(int,const char*,mode_t,dev_t) = mknodat;}
100570af302Sopenharmony_ci#endif
101570af302Sopenharmony_ci{int(*p)(const char*restrict,struct stat*restrict) = stat;}
102570af302Sopenharmony_ci{mode_t(*p)(mode_t) = umask;}
103570af302Sopenharmony_ci{int(*p)(int,const char*,const struct timespec[],int) = utimensat;}
104570af302Sopenharmony_ci}
105