Remove some #if __cplusplus wrt inlining. (#18891)
[mono-project.git] / support / old-map.c
blobde6affa087df418686f814455d7f9e5f4848454a
1 /* This file was automatically generated by make-map from Mono.Posix.dll */
3 #ifndef _GNU_SOURCE
4 #define _GNU_SOURCE
5 #endif
7 #include <sys/types.h>
8 #include <sys/stat.h>
9 #include <sys/wait.h>
10 #include <unistd.h>
11 #include <fcntl.h>
12 #include <signal.h>
13 #include <poll.h>
14 #include "mph.h"
15 #include "old-map.h"
17 int map_Mono_Posix_AccessMode (int mode);
18 int map_Mono_Posix_FileMode (int mode);
19 int map_Mono_Posix_OpenFlags (int flags);
20 int map_Mono_Posix_PollEvents (int x);
21 int map_Mono_Posix_Signals (int x);
22 int map_Mono_Posix_WaitOptions (int wait_options);
24 int map_Mono_Posix_OpenFlags (int x)
26 int r = 0;
27 if ((x & Mono_Posix_OpenFlags_O_RDONLY) != 0)
28 r |= O_RDONLY;
29 if ((x & Mono_Posix_OpenFlags_O_WRONLY) != 0)
30 r |= O_WRONLY;
31 if ((x & Mono_Posix_OpenFlags_O_RDWR) != 0)
32 r |= O_RDWR;
33 if ((x & Mono_Posix_OpenFlags_O_CREAT) != 0)
34 r |= O_CREAT;
35 if ((x & Mono_Posix_OpenFlags_O_EXCL) != 0)
36 r |= O_EXCL;
37 if ((x & Mono_Posix_OpenFlags_O_NOCTTY) != 0)
38 r |= O_NOCTTY;
39 if ((x & Mono_Posix_OpenFlags_O_TRUNC) != 0)
40 r |= O_TRUNC;
41 if ((x & Mono_Posix_OpenFlags_O_APPEND) != 0)
42 r |= O_APPEND;
43 if ((x & Mono_Posix_OpenFlags_O_NONBLOCK) != 0)
44 r |= O_NONBLOCK;
45 #ifdef O_NOATIME
46 if ((x & Mono_Posix_OpenFlags_O_NOATIME) != 0)
47 r |= O_NOATIME;
48 #endif
49 #ifdef O_SYNC
50 if ((x & Mono_Posix_OpenFlags_O_SYNC) != 0)
51 r |= O_SYNC;
52 #endif
53 return r;
56 int map_Mono_Posix_FileMode (int x)
58 int r = 0;
59 if ((x & Mono_Posix_FileMode_S_ISUID) != 0)
60 r |= S_ISUID;
61 if ((x & Mono_Posix_FileMode_S_ISGID) != 0)
62 r |= S_ISGID;
63 if ((x & Mono_Posix_FileMode_S_ISVTX) != 0)
64 r |= S_ISVTX;
65 if ((x & Mono_Posix_FileMode_S_IRUSR) != 0)
66 r |= S_IRUSR;
67 if ((x & Mono_Posix_FileMode_S_IWUSR) != 0)
68 r |= S_IWUSR;
69 if ((x & Mono_Posix_FileMode_S_IXUSR) != 0)
70 r |= S_IXUSR;
71 if ((x & Mono_Posix_FileMode_S_IRGRP) != 0)
72 r |= S_IRGRP;
73 if ((x & Mono_Posix_FileMode_S_IWGRP) != 0)
74 r |= S_IWGRP;
75 if ((x & Mono_Posix_FileMode_S_IXGRP) != 0)
76 r |= S_IXGRP;
77 if ((x & Mono_Posix_FileMode_S_IROTH) != 0)
78 r |= S_IROTH;
79 if ((x & Mono_Posix_FileMode_S_IWOTH) != 0)
80 r |= S_IWOTH;
81 if ((x & Mono_Posix_FileMode_S_IXOTH) != 0)
82 r |= S_IXOTH;
83 return r;
86 int map_Mono_Posix_WaitOptions (int x)
88 int r = 0;
89 if ((x & Mono_Posix_WaitOptions_WNOHANG) != 0)
90 r |= WNOHANG;
91 if ((x & Mono_Posix_WaitOptions_WUNTRACED) != 0)
92 r |= WUNTRACED;
93 return r;
96 int map_Mono_Posix_AccessMode (int x)
98 int r = 0;
99 if ((x & Mono_Posix_AccessMode_R_OK) != 0)
100 r |= R_OK;
101 if ((x & Mono_Posix_AccessMode_W_OK) != 0)
102 r |= W_OK;
103 if ((x & Mono_Posix_AccessMode_X_OK) != 0)
104 r |= X_OK;
105 if ((x & Mono_Posix_AccessMode_F_OK) != 0)
106 r |= F_OK;
107 return r;
110 int map_Mono_Posix_Signals (int x)
112 if (x == Mono_Posix_Signals_SIGHUP)
113 return SIGHUP;
114 if (x == Mono_Posix_Signals_SIGINT)
115 return SIGINT;
116 if (x == Mono_Posix_Signals_SIGQUIT)
117 return SIGQUIT;
118 if (x == Mono_Posix_Signals_SIGILL)
119 return SIGILL;
120 if (x == Mono_Posix_Signals_SIGTRAP)
121 return SIGTRAP;
122 if (x == Mono_Posix_Signals_SIGABRT)
123 return SIGABRT;
124 if (x == Mono_Posix_Signals_SIGBUS)
125 return SIGBUS;
126 if (x == Mono_Posix_Signals_SIGFPE)
127 return SIGFPE;
128 if (x == Mono_Posix_Signals_SIGKILL)
129 return SIGKILL;
130 if (x == Mono_Posix_Signals_SIGUSR1)
131 return SIGUSR1;
132 if (x == Mono_Posix_Signals_SIGSEGV)
133 return SIGSEGV;
134 if (x == Mono_Posix_Signals_SIGUSR2)
135 return SIGUSR2;
136 if (x == Mono_Posix_Signals_SIGPIPE)
137 return SIGPIPE;
138 if (x == Mono_Posix_Signals_SIGALRM)
139 return SIGALRM;
140 if (x == Mono_Posix_Signals_SIGTERM)
141 return SIGTERM;
142 if (x == Mono_Posix_Signals_SIGCHLD)
143 return SIGCHLD;
144 if (x == Mono_Posix_Signals_SIGCONT)
145 return SIGCONT;
146 if (x == Mono_Posix_Signals_SIGSTOP)
147 return SIGSTOP;
148 if (x == Mono_Posix_Signals_SIGTSTP)
149 return SIGTSTP;
150 if (x == Mono_Posix_Signals_SIGTTIN)
151 return SIGTTIN;
152 if (x == Mono_Posix_Signals_SIGTTOU)
153 return SIGTTOU;
154 if (x == Mono_Posix_Signals_SIGURG)
155 return SIGURG;
156 if (x == Mono_Posix_Signals_SIGXCPU)
157 return SIGXCPU;
158 if (x == Mono_Posix_Signals_SIGXFSZ)
159 return SIGXFSZ;
160 if (x == Mono_Posix_Signals_SIGVTALRM)
161 return SIGVTALRM;
162 #ifdef SIGPROF
163 if (x == Mono_Posix_Signals_SIGPROF)
164 return SIGPROF;
165 #endif
166 if (x == Mono_Posix_Signals_SIGWINCH)
167 return SIGWINCH;
168 #ifdef SIGIO
169 if (x == Mono_Posix_Signals_SIGIO)
170 return SIGIO;
171 #endif
172 if (x == Mono_Posix_Signals_SIGSYS)
173 return SIGSYS;
174 return -1;
177 int map_Mono_Posix_PollEvents (int x)
179 int r = 0;
180 if ((x & Mono_Posix_PollEvents_POLLIN) != 0)
181 r |= POLLIN;
182 if ((x & Mono_Posix_PollEvents_POLLPRI) != 0)
183 r |= POLLPRI;
184 if ((x & Mono_Posix_PollEvents_POLLOUT) != 0)
185 r |= POLLOUT;
186 if ((x & Mono_Posix_PollEvents_POLLERR) != 0)
187 r |= POLLERR;
188 if ((x & Mono_Posix_PollEvents_POLLHUP) != 0)
189 r |= POLLHUP;
190 if ((x & Mono_Posix_PollEvents_POLLNVAL) != 0)
191 r |= POLLNVAL;
192 return r;