1570af302Sopenharmony_ci#include <fcntl.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_ciC(F_DUPFD)
9570af302Sopenharmony_ciC(F_DUPFD_CLOEXEC)
10570af302Sopenharmony_ciC(F_GETFD)
11570af302Sopenharmony_ciC(F_SETFD)
12570af302Sopenharmony_ciC(F_GETFL)
13570af302Sopenharmony_ciC(F_SETFL)
14570af302Sopenharmony_ciC(F_GETLK)
15570af302Sopenharmony_ciC(F_SETLK)
16570af302Sopenharmony_ciC(F_SETLKW)
17570af302Sopenharmony_ciC(F_GETOWN)
18570af302Sopenharmony_ciC(F_SETOWN)
19570af302Sopenharmony_ciC(FD_CLOEXEC)
20570af302Sopenharmony_ciC(F_RDLCK)
21570af302Sopenharmony_ciC(F_UNLCK)
22570af302Sopenharmony_ciC(F_WRLCK)
23570af302Sopenharmony_ciC(SEEK_SET)
24570af302Sopenharmony_ciC(SEEK_CUR)
25570af302Sopenharmony_ciC(SEEK_END)
26570af302Sopenharmony_ciC(O_CREAT)
27570af302Sopenharmony_ciC(O_EXCL)
28570af302Sopenharmony_ciC(O_NOCTTY)
29570af302Sopenharmony_ciC(O_TRUNC)
30570af302Sopenharmony_ciC(O_TTY_INIT)
31570af302Sopenharmony_ciC(O_APPEND)
32570af302Sopenharmony_ciC(O_NONBLOCK)
33570af302Sopenharmony_ci#ifdef POSIX_SYNCHRONIZED_IO
34570af302Sopenharmony_ciC(O_DSYNC)
35570af302Sopenharmony_ciC(O_RSYNC)
36570af302Sopenharmony_ci#endif
37570af302Sopenharmony_ciC(O_SYNC)
38570af302Sopenharmony_ciC(O_ACCMODE)
39570af302Sopenharmony_ciC(O_EXEC)
40570af302Sopenharmony_ciC(O_RDONLY)
41570af302Sopenharmony_ciC(O_RDWR)
42570af302Sopenharmony_ciC(O_SEARCH)
43570af302Sopenharmony_ciC(O_WRONLY)
44570af302Sopenharmony_ciC(S_IRWXU)
45570af302Sopenharmony_ciC(S_IRUSR)
46570af302Sopenharmony_ciC(S_IWUSR)
47570af302Sopenharmony_ciC(S_IXUSR)
48570af302Sopenharmony_ciC(S_IRWXG)
49570af302Sopenharmony_ciC(S_IRGRP)
50570af302Sopenharmony_ciC(S_IWGRP)
51570af302Sopenharmony_ciC(S_IXGRP)
52570af302Sopenharmony_ciC(S_IRWXO)
53570af302Sopenharmony_ciC(S_IROTH)
54570af302Sopenharmony_ciC(S_IWOTH)
55570af302Sopenharmony_ciC(S_IXOTH)
56570af302Sopenharmony_ciC(S_ISUID)
57570af302Sopenharmony_ciC(S_ISGID)
58570af302Sopenharmony_ci#ifdef _XOPEN_SOURCE
59570af302Sopenharmony_ciC(S_ISVTX)
60570af302Sopenharmony_ci#endif
61570af302Sopenharmony_ciC(AT_FDCWD)
62570af302Sopenharmony_ciC(AT_EACCESS)
63570af302Sopenharmony_ciC(AT_SYMLINK_NOFOLLOW)
64570af302Sopenharmony_ciC(AT_SYMLINK_FOLLOW)
65570af302Sopenharmony_ciC(O_CLOEXEC)
66570af302Sopenharmony_ciC(O_DIRECTORY)
67570af302Sopenharmony_ciC(O_NOFOLLOW)
68570af302Sopenharmony_ciC(AT_REMOVEDIR)
69570af302Sopenharmony_ciC(POSIX_FADV_DONTNEED)
70570af302Sopenharmony_ciC(POSIX_FADV_NOREUSE)
71570af302Sopenharmony_ciC(POSIX_FADV_NORMAL)
72570af302Sopenharmony_ciC(POSIX_FADV_RANDOM)
73570af302Sopenharmony_ciC(POSIX_FADV_SEQUENTIAL)
74570af302Sopenharmony_ciC(POSIX_FADV_WILLNEED)
75570af302Sopenharmony_ci
76570af302Sopenharmony_ci{
77570af302Sopenharmony_cistruct flock x;
78570af302Sopenharmony_ciF(short, l_type)
79570af302Sopenharmony_ciF(short, l_whence)
80570af302Sopenharmony_ciF(off_t, l_start)
81570af302Sopenharmony_ciF(off_t, l_len)
82570af302Sopenharmony_ciF(pid_t, l_pid)
83570af302Sopenharmony_ci}
84570af302Sopenharmony_ci
85570af302Sopenharmony_ciT(mode_t)
86570af302Sopenharmony_ciT(off_t)
87570af302Sopenharmony_ciT(pid_t)
88570af302Sopenharmony_ci
89570af302Sopenharmony_ci{int(*p)(int,int,...) = fcntl;}
90570af302Sopenharmony_ci{int(*p)(int,off_t,off_t,int) = posix_fadvise;}
91570af302Sopenharmony_ci{int(*p)(int,off_t,off_t) = posix_fallocate;}
92570af302Sopenharmony_ci}
93570af302Sopenharmony_ci#ifndef _XOPEN_SOURCE
94570af302Sopenharmony_ci#include <sys/stat.h>
95570af302Sopenharmony_ci#endif
96570af302Sopenharmony_cistatic void g()
97570af302Sopenharmony_ci{
98570af302Sopenharmony_ci{int(*p)(const char*,mode_t) = creat;}
99570af302Sopenharmony_ci{int(*p)(const char*,int,...) = open;}
100570af302Sopenharmony_ci{int(*p)(int,const char*,int,...) = openat;}
101570af302Sopenharmony_ci}
102