2008-08-22 Sebastien Pouliot <sebastien@ximian.com>
[mono-project.git] / support / old-map.c
blobf35d0d7bacd6de1edbf1ba74f35493eb048741e7
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"
16 int map_Mono_Posix_OpenFlags (int x)
18 int r = 0;
19 if ((x & Mono_Posix_OpenFlags_O_RDONLY) != 0)
20 r |= O_RDONLY;
21 if ((x & Mono_Posix_OpenFlags_O_WRONLY) != 0)
22 r |= O_WRONLY;
23 if ((x & Mono_Posix_OpenFlags_O_RDWR) != 0)
24 r |= O_RDWR;
25 if ((x & Mono_Posix_OpenFlags_O_CREAT) != 0)
26 r |= O_CREAT;
27 if ((x & Mono_Posix_OpenFlags_O_EXCL) != 0)
28 r |= O_EXCL;
29 if ((x & Mono_Posix_OpenFlags_O_NOCTTY) != 0)
30 r |= O_NOCTTY;
31 if ((x & Mono_Posix_OpenFlags_O_TRUNC) != 0)
32 r |= O_TRUNC;
33 if ((x & Mono_Posix_OpenFlags_O_APPEND) != 0)
34 r |= O_APPEND;
35 if ((x & Mono_Posix_OpenFlags_O_NONBLOCK) != 0)
36 r |= O_NONBLOCK;
37 #ifdef O_SYNC
38 if ((x & Mono_Posix_OpenFlags_O_SYNC) != 0)
39 r |= O_SYNC;
40 #endif
41 return r;
44 int map_Mono_Posix_FileMode (int x)
46 int r = 0;
47 if ((x & Mono_Posix_FileMode_S_ISUID) != 0)
48 r |= S_ISUID;
49 if ((x & Mono_Posix_FileMode_S_ISGID) != 0)
50 r |= S_ISGID;
51 if ((x & Mono_Posix_FileMode_S_ISVTX) != 0)
52 r |= S_ISVTX;
53 if ((x & Mono_Posix_FileMode_S_IRUSR) != 0)
54 r |= S_IRUSR;
55 if ((x & Mono_Posix_FileMode_S_IWUSR) != 0)
56 r |= S_IWUSR;
57 if ((x & Mono_Posix_FileMode_S_IXUSR) != 0)
58 r |= S_IXUSR;
59 if ((x & Mono_Posix_FileMode_S_IRGRP) != 0)
60 r |= S_IRGRP;
61 if ((x & Mono_Posix_FileMode_S_IWGRP) != 0)
62 r |= S_IWGRP;
63 if ((x & Mono_Posix_FileMode_S_IXGRP) != 0)
64 r |= S_IXGRP;
65 if ((x & Mono_Posix_FileMode_S_IROTH) != 0)
66 r |= S_IROTH;
67 if ((x & Mono_Posix_FileMode_S_IWOTH) != 0)
68 r |= S_IWOTH;
69 if ((x & Mono_Posix_FileMode_S_IXOTH) != 0)
70 r |= S_IXOTH;
71 return r;
74 int map_Mono_Posix_WaitOptions (int x)
76 int r = 0;
77 if ((x & Mono_Posix_WaitOptions_WNOHANG) != 0)
78 r |= WNOHANG;
79 if ((x & Mono_Posix_WaitOptions_WUNTRACED) != 0)
80 r |= WUNTRACED;
81 return r;
84 int map_Mono_Posix_AccessMode (int x)
86 int r = 0;
87 if ((x & Mono_Posix_AccessMode_R_OK) != 0)
88 r |= R_OK;
89 if ((x & Mono_Posix_AccessMode_W_OK) != 0)
90 r |= W_OK;
91 if ((x & Mono_Posix_AccessMode_X_OK) != 0)
92 r |= X_OK;
93 if ((x & Mono_Posix_AccessMode_F_OK) != 0)
94 r |= F_OK;
95 return r;
98 int map_Mono_Posix_Signals (int x)
100 if (x == Mono_Posix_Signals_SIGHUP)
101 return SIGHUP;
102 if (x == Mono_Posix_Signals_SIGINT)
103 return SIGINT;
104 if (x == Mono_Posix_Signals_SIGQUIT)
105 return SIGQUIT;
106 if (x == Mono_Posix_Signals_SIGILL)
107 return SIGILL;
108 if (x == Mono_Posix_Signals_SIGTRAP)
109 return SIGTRAP;
110 if (x == Mono_Posix_Signals_SIGABRT)
111 return SIGABRT;
112 if (x == Mono_Posix_Signals_SIGBUS)
113 return SIGBUS;
114 if (x == Mono_Posix_Signals_SIGFPE)
115 return SIGFPE;
116 if (x == Mono_Posix_Signals_SIGKILL)
117 return SIGKILL;
118 if (x == Mono_Posix_Signals_SIGUSR1)
119 return SIGUSR1;
120 if (x == Mono_Posix_Signals_SIGSEGV)
121 return SIGSEGV;
122 if (x == Mono_Posix_Signals_SIGUSR2)
123 return SIGUSR2;
124 if (x == Mono_Posix_Signals_SIGPIPE)
125 return SIGPIPE;
126 if (x == Mono_Posix_Signals_SIGALRM)
127 return SIGALRM;
128 if (x == Mono_Posix_Signals_SIGTERM)
129 return SIGTERM;
130 if (x == Mono_Posix_Signals_SIGCHLD)
131 return SIGCHLD;
132 if (x == Mono_Posix_Signals_SIGCONT)
133 return SIGCONT;
134 if (x == Mono_Posix_Signals_SIGSTOP)
135 return SIGSTOP;
136 if (x == Mono_Posix_Signals_SIGTSTP)
137 return SIGTSTP;
138 if (x == Mono_Posix_Signals_SIGTTIN)
139 return SIGTTIN;
140 if (x == Mono_Posix_Signals_SIGTTOU)
141 return SIGTTOU;
142 if (x == Mono_Posix_Signals_SIGURG)
143 return SIGURG;
144 if (x == Mono_Posix_Signals_SIGXCPU)
145 return SIGXCPU;
146 if (x == Mono_Posix_Signals_SIGXFSZ)
147 return SIGXFSZ;
148 if (x == Mono_Posix_Signals_SIGVTALRM)
149 return SIGVTALRM;
150 if (x == Mono_Posix_Signals_SIGPROF)
151 return SIGPROF;
152 if (x == Mono_Posix_Signals_SIGWINCH)
153 return SIGWINCH;
154 if (x == Mono_Posix_Signals_SIGIO)
155 return SIGIO;
156 if (x == Mono_Posix_Signals_SIGSYS)
157 return SIGSYS;
158 return -1;
161 int map_Mono_Posix_PollEvents (int x)
163 int r = 0;
164 if ((x & Mono_Posix_PollEvents_POLLIN) != 0)
165 r |= POLLIN;
166 if ((x & Mono_Posix_PollEvents_POLLPRI) != 0)
167 r |= POLLPRI;
168 if ((x & Mono_Posix_PollEvents_POLLOUT) != 0)
169 r |= POLLOUT;
170 if ((x & Mono_Posix_PollEvents_POLLERR) != 0)
171 r |= POLLERR;
172 if ((x & Mono_Posix_PollEvents_POLLHUP) != 0)
173 r |= POLLHUP;
174 if ((x & Mono_Posix_PollEvents_POLLNVAL) != 0)
175 r |= POLLNVAL;
176 return r;