]>
Commit | Line | Data |
---|---|---|
476ff2be SL |
1 | pub type c_char = i8; |
2 | pub type wchar_t = ::c_int; | |
3 | ||
4 | s! { | |
5 | pub struct stat { | |
6 | pub st_dev: ::dev_t, | |
7 | __st_padding1: [::c_long; 2], | |
8 | pub st_ino: ::ino_t, | |
9 | pub st_mode: ::mode_t, | |
10 | pub st_nlink: ::nlink_t, | |
11 | pub st_uid: ::uid_t, | |
12 | pub st_gid: ::gid_t, | |
13 | pub st_rdev: ::dev_t, | |
14 | __st_padding2: [::c_long; 2], | |
15 | pub st_size: ::off_t, | |
16 | pub st_atime: ::time_t, | |
17 | pub st_atime_nsec: ::c_long, | |
18 | pub st_mtime: ::time_t, | |
19 | pub st_mtime_nsec: ::c_long, | |
20 | pub st_ctime: ::time_t, | |
21 | pub st_ctime_nsec: ::c_long, | |
22 | pub st_blksize: ::blksize_t, | |
23 | __st_padding3: ::c_long, | |
24 | pub st_blocks: ::blkcnt_t, | |
25 | __st_padding4: [::c_long; 14], | |
26 | } | |
27 | ||
28 | pub struct stat64 { | |
29 | pub st_dev: ::dev_t, | |
30 | __st_padding1: [::c_long; 2], | |
31 | pub st_ino: ::ino64_t, | |
32 | pub st_mode: ::mode_t, | |
33 | pub st_nlink: ::nlink_t, | |
34 | pub st_uid: ::uid_t, | |
35 | pub st_gid: ::gid_t, | |
36 | pub st_rdev: ::dev_t, | |
37 | __st_padding2: [::c_long; 2], | |
38 | pub st_size: ::off_t, | |
39 | pub st_atime: ::time_t, | |
40 | pub st_atime_nsec: ::c_long, | |
41 | pub st_mtime: ::time_t, | |
42 | pub st_mtime_nsec: ::c_long, | |
43 | pub st_ctime: ::time_t, | |
44 | pub st_ctime_nsec: ::c_long, | |
45 | pub st_blksize: ::blksize_t, | |
46 | __st_padding3: ::c_long, | |
47 | pub st_blocks: ::blkcnt64_t, | |
48 | __st_padding4: [::c_long; 14], | |
49 | } | |
50 | ||
51 | pub struct stack_t { | |
52 | pub ss_sp: *mut ::c_void, | |
53 | pub ss_size: ::size_t, | |
54 | pub ss_flags: ::c_int, | |
55 | } | |
56 | ||
57 | pub struct shmid_ds { | |
58 | pub shm_perm: ::ipc_perm, | |
59 | pub shm_segsz: ::size_t, | |
60 | pub shm_atime: ::time_t, | |
61 | pub shm_dtime: ::time_t, | |
62 | pub shm_ctime: ::time_t, | |
63 | pub shm_cpid: ::pid_t, | |
64 | pub shm_lpid: ::pid_t, | |
65 | pub shm_nattch: ::c_ulong, | |
66 | __pad1: ::c_ulong, | |
67 | __pad2: ::c_ulong, | |
68 | } | |
69 | ||
70 | pub struct msqid_ds { | |
71 | pub msg_perm: ::ipc_perm, | |
72 | #[cfg(target_endian = "big")] | |
73 | __unused1: ::c_int, | |
74 | pub msg_stime: ::time_t, | |
75 | #[cfg(target_endian = "little")] | |
76 | __unused1: ::c_int, | |
77 | #[cfg(target_endian = "big")] | |
78 | __unused2: ::c_int, | |
79 | pub msg_rtime: ::time_t, | |
80 | #[cfg(target_endian = "little")] | |
81 | __unused2: ::c_int, | |
82 | #[cfg(target_endian = "big")] | |
83 | __unused3: ::c_int, | |
84 | pub msg_ctime: ::time_t, | |
85 | #[cfg(target_endian = "little")] | |
86 | __unused3: ::c_int, | |
87 | __msg_cbytes: ::c_ulong, | |
88 | pub msg_qnum: ::msgqnum_t, | |
89 | pub msg_qbytes: ::msglen_t, | |
90 | pub msg_lspid: ::pid_t, | |
91 | pub msg_lrpid: ::pid_t, | |
92 | __pad1: ::c_ulong, | |
93 | __pad2: ::c_ulong, | |
94 | } | |
95 | ||
96 | pub struct statfs { | |
97 | pub f_type: ::c_ulong, | |
98 | pub f_bsize: ::c_ulong, | |
99 | pub f_frsize: ::c_ulong, | |
100 | pub f_blocks: ::fsblkcnt_t, | |
101 | pub f_bfree: ::fsblkcnt_t, | |
102 | pub f_files: ::fsfilcnt_t, | |
103 | pub f_ffree: ::fsfilcnt_t, | |
104 | pub f_bavail: ::fsblkcnt_t, | |
105 | pub f_fsid: ::fsid_t, | |
106 | pub f_namelen: ::c_ulong, | |
107 | pub f_flags: ::c_ulong, | |
108 | pub f_spare: [::c_ulong; 5], | |
109 | } | |
110 | ||
111 | pub struct siginfo_t { | |
112 | pub si_signo: ::c_int, | |
113 | pub si_code: ::c_int, | |
114 | pub si_errno: ::c_int, | |
115 | pub _pad: [::c_int; 29], | |
116 | _align: [usize; 0], | |
117 | } | |
118 | } | |
119 | ||
120 | pub const O_DIRECT: ::c_int = 0o100000; | |
121 | pub const O_DIRECTORY: ::c_int = 0o200000; | |
122 | pub const O_NOFOLLOW: ::c_int = 0o400000; | |
123 | pub const O_ASYNC: ::c_int = 0o10000; | |
3b2f2976 | 124 | pub const O_LARGEFILE: ::c_int = 0x2000; |
476ff2be SL |
125 | |
126 | pub const FIOCLEX: ::c_int = 0x6601; | |
127 | pub const FIONBIO: ::c_int = 0x667E; | |
128 | ||
129 | pub const RLIMIT_RSS: ::c_int = 7; | |
130 | pub const RLIMIT_NOFILE: ::c_int = 5; | |
131 | pub const RLIMIT_AS: ::c_int = 6; | |
132 | pub const RLIMIT_NPROC: ::c_int = 8; | |
133 | pub const RLIMIT_MEMLOCK: ::c_int = 9; | |
134 | ||
135 | pub const O_APPEND: ::c_int = 0o010; | |
136 | pub const O_CREAT: ::c_int = 0o400; | |
137 | pub const O_EXCL: ::c_int = 0o2000; | |
138 | pub const O_NOCTTY: ::c_int = 0o4000; | |
139 | pub const O_NONBLOCK: ::c_int = 0o200; | |
140 | pub const O_SYNC: ::c_int = 0o40020; | |
141 | pub const O_RSYNC: ::c_int = 0o40020; | |
142 | pub const O_DSYNC: ::c_int = 0o020; | |
143 | ||
144 | pub const SOCK_NONBLOCK: ::c_int = 0o200; | |
145 | ||
146 | pub const MAP_ANON: ::c_int = 0x800; | |
147 | pub const MAP_GROWSDOWN: ::c_int = 0x1000; | |
148 | pub const MAP_DENYWRITE: ::c_int = 0x2000; | |
149 | pub const MAP_EXECUTABLE: ::c_int = 0x4000; | |
150 | pub const MAP_LOCKED: ::c_int = 0x8000; | |
151 | pub const MAP_NORESERVE: ::c_int = 0x0400; | |
152 | pub const MAP_POPULATE: ::c_int = 0x10000; | |
153 | pub const MAP_NONBLOCK: ::c_int = 0x20000; | |
154 | pub const MAP_STACK: ::c_int = 0x40000; | |
155 | ||
156 | pub const EDEADLK: ::c_int = 45; | |
157 | pub const ENAMETOOLONG: ::c_int = 78; | |
158 | pub const ENOLCK: ::c_int = 46; | |
159 | pub const ENOSYS: ::c_int = 89; | |
160 | pub const ENOTEMPTY: ::c_int = 93; | |
161 | pub const ELOOP: ::c_int = 90; | |
162 | pub const ENOMSG: ::c_int = 35; | |
163 | pub const EIDRM: ::c_int = 36; | |
164 | pub const ECHRNG: ::c_int = 37; | |
165 | pub const EL2NSYNC: ::c_int = 38; | |
166 | pub const EL3HLT: ::c_int = 39; | |
167 | pub const EL3RST: ::c_int = 40; | |
168 | pub const ELNRNG: ::c_int = 41; | |
169 | pub const EUNATCH: ::c_int = 42; | |
170 | pub const ENOCSI: ::c_int = 43; | |
171 | pub const EL2HLT: ::c_int = 44; | |
172 | pub const EBADE: ::c_int = 50; | |
173 | pub const EBADR: ::c_int = 51; | |
174 | pub const EXFULL: ::c_int = 52; | |
175 | pub const ENOANO: ::c_int = 53; | |
176 | pub const EBADRQC: ::c_int = 54; | |
177 | pub const EBADSLT: ::c_int = 55; | |
178 | pub const EDEADLOCK: ::c_int = 56; | |
179 | pub const EMULTIHOP: ::c_int = 74; | |
180 | pub const EOVERFLOW: ::c_int = 79; | |
181 | pub const ENOTUNIQ: ::c_int = 80; | |
182 | pub const EBADFD: ::c_int = 81; | |
183 | pub const EBADMSG: ::c_int = 77; | |
184 | pub const EREMCHG: ::c_int = 82; | |
185 | pub const ELIBACC: ::c_int = 83; | |
186 | pub const ELIBBAD: ::c_int = 84; | |
187 | pub const ELIBSCN: ::c_int = 85; | |
188 | pub const ELIBMAX: ::c_int = 86; | |
189 | pub const ELIBEXEC: ::c_int = 87; | |
190 | pub const EILSEQ: ::c_int = 88; | |
191 | pub const ERESTART: ::c_int = 91; | |
192 | pub const ESTRPIPE: ::c_int = 92; | |
193 | pub const EUSERS: ::c_int = 94; | |
194 | pub const ENOTSOCK: ::c_int = 95; | |
195 | pub const EDESTADDRREQ: ::c_int = 96; | |
196 | pub const EMSGSIZE: ::c_int = 97; | |
197 | pub const EPROTOTYPE: ::c_int = 98; | |
198 | pub const ENOPROTOOPT: ::c_int = 99; | |
199 | pub const EPROTONOSUPPORT: ::c_int = 120; | |
200 | pub const ESOCKTNOSUPPORT: ::c_int = 121; | |
201 | pub const EOPNOTSUPP: ::c_int = 122; | |
8bb4bdeb | 202 | pub const ENOTSUP: ::c_int = EOPNOTSUPP; |
476ff2be SL |
203 | pub const EPFNOSUPPORT: ::c_int = 123; |
204 | pub const EAFNOSUPPORT: ::c_int = 124; | |
205 | pub const EADDRINUSE: ::c_int = 125; | |
206 | pub const EADDRNOTAVAIL: ::c_int = 126; | |
207 | pub const ENETDOWN: ::c_int = 127; | |
208 | pub const ENETUNREACH: ::c_int = 128; | |
209 | pub const ENETRESET: ::c_int = 129; | |
210 | pub const ECONNABORTED: ::c_int = 130; | |
211 | pub const ECONNRESET: ::c_int = 131; | |
212 | pub const ENOBUFS: ::c_int = 132; | |
213 | pub const EISCONN: ::c_int = 133; | |
214 | pub const ENOTCONN: ::c_int = 134; | |
215 | pub const ESHUTDOWN: ::c_int = 143; | |
216 | pub const ETOOMANYREFS: ::c_int = 144; | |
217 | pub const ETIMEDOUT: ::c_int = 145; | |
218 | pub const ECONNREFUSED: ::c_int = 146; | |
219 | pub const EHOSTDOWN: ::c_int = 147; | |
220 | pub const EHOSTUNREACH: ::c_int = 148; | |
221 | pub const EALREADY: ::c_int = 149; | |
222 | pub const EINPROGRESS: ::c_int = 150; | |
223 | pub const ESTALE: ::c_int = 151; | |
224 | pub const EUCLEAN: ::c_int = 135; | |
225 | pub const ENOTNAM: ::c_int = 137; | |
226 | pub const ENAVAIL: ::c_int = 138; | |
227 | pub const EISNAM: ::c_int = 139; | |
228 | pub const EREMOTEIO: ::c_int = 140; | |
229 | pub const EDQUOT: ::c_int = 1133; | |
230 | pub const ENOMEDIUM: ::c_int = 159; | |
231 | pub const EMEDIUMTYPE: ::c_int = 160; | |
232 | pub const ECANCELED: ::c_int = 158; | |
233 | pub const ENOKEY: ::c_int = 161; | |
234 | pub const EKEYEXPIRED: ::c_int = 162; | |
235 | pub const EKEYREVOKED: ::c_int = 163; | |
236 | pub const EKEYREJECTED: ::c_int = 164; | |
237 | pub const EOWNERDEAD: ::c_int = 165; | |
238 | pub const ENOTRECOVERABLE: ::c_int = 166; | |
239 | pub const EHWPOISON: ::c_int = 168; | |
240 | pub const ERFKILL: ::c_int = 167; | |
241 | ||
242 | pub const SOCK_STREAM: ::c_int = 2; | |
243 | pub const SOCK_DGRAM: ::c_int = 1; | |
244 | pub const SOCK_SEQPACKET: ::c_int = 5; | |
245 | ||
246 | pub const SOL_SOCKET: ::c_int = 65535; | |
247 | ||
248 | pub const SO_REUSEADDR: ::c_int = 0x0004; | |
8bb4bdeb | 249 | pub const SO_KEEPALIVE: ::c_int = 0x0008; |
476ff2be SL |
250 | pub const SO_DONTROUTE: ::c_int = 0x0010; |
251 | pub const SO_BROADCAST: ::c_int = 0x0020; | |
8bb4bdeb XL |
252 | pub const SO_LINGER: ::c_int = 0x0080; |
253 | pub const SO_OOBINLINE: ::c_int = 0x0100; | |
254 | pub const SO_REUSEPORT: ::c_int = 0x0200; | |
476ff2be SL |
255 | pub const SO_SNDBUF: ::c_int = 0x1001; |
256 | pub const SO_RCVBUF: ::c_int = 0x1002; | |
476ff2be | 257 | pub const SO_SNDLOWAT: ::c_int = 0x1003; |
8bb4bdeb | 258 | pub const SO_RCVLOWAT: ::c_int = 0x1004; |
476ff2be SL |
259 | pub const SO_RCVTIMEO: ::c_int = 0x1006; |
260 | pub const SO_SNDTIMEO: ::c_int = 0x1005; | |
8bb4bdeb XL |
261 | pub const SO_ERROR: ::c_int = 0x1007; |
262 | pub const SO_TYPE: ::c_int = 0x1008; | |
476ff2be | 263 | pub const SO_ACCEPTCONN: ::c_int = 0x1009; |
8bb4bdeb XL |
264 | pub const SO_PROTOCOL: ::c_int = 0x1028; |
265 | pub const SO_DOMAIN: ::c_int = 0x1029; | |
266 | pub const SO_NO_CHECK: ::c_int = 11; | |
267 | pub const SO_PRIORITY: ::c_int = 12; | |
268 | pub const SO_BSDCOMPAT: ::c_int = 14; | |
269 | pub const SO_PASSCRED: ::c_int = 17; | |
270 | pub const SO_PEERCRED: ::c_int = 18; | |
271 | pub const SO_SNDBUFFORCE: ::c_int = 31; | |
272 | pub const SO_RCVBUFFORCE: ::c_int = 33; | |
476ff2be SL |
273 | |
274 | pub const SA_ONSTACK: ::c_int = 0x08000000; | |
275 | pub const SA_SIGINFO: ::c_int = 8; | |
276 | pub const SA_NOCLDWAIT: ::c_int = 0x10000; | |
277 | ||
278 | pub const SIGCHLD: ::c_int = 18; | |
279 | pub const SIGBUS: ::c_int = 10; | |
280 | pub const SIGTTIN: ::c_int = 26; | |
281 | pub const SIGTTOU: ::c_int = 27; | |
282 | pub const SIGXCPU: ::c_int = 30; | |
283 | pub const SIGXFSZ: ::c_int = 31; | |
284 | pub const SIGVTALRM: ::c_int = 28; | |
285 | pub const SIGPROF: ::c_int = 29; | |
286 | pub const SIGWINCH: ::c_int = 20; | |
287 | pub const SIGUSR1: ::c_int = 16; | |
288 | pub const SIGUSR2: ::c_int = 17; | |
289 | pub const SIGCONT: ::c_int = 25; | |
290 | pub const SIGSTOP: ::c_int = 23; | |
291 | pub const SIGTSTP: ::c_int = 24; | |
292 | pub const SIGURG: ::c_int = 21; | |
293 | pub const SIGIO: ::c_int = 22; | |
294 | pub const SIGSYS: ::c_int = 12; | |
295 | pub const SIGSTKFLT: ::c_int = 7; | |
296 | pub const SIGPOLL: ::c_int = ::SIGIO; | |
297 | pub const SIGPWR: ::c_int = 19; | |
298 | pub const SIG_SETMASK: ::c_int = 3; | |
299 | pub const SIG_BLOCK: ::c_int = 1; | |
300 | pub const SIG_UNBLOCK: ::c_int = 2; | |
301 | ||
302 | pub const EXTPROC: ::tcflag_t = 0o200000; | |
303 | ||
304 | pub const MAP_HUGETLB: ::c_int = 0x80000; | |
305 | ||
306 | pub const F_GETLK: ::c_int = 33; | |
307 | pub const F_GETOWN: ::c_int = 23; | |
308 | pub const F_SETLK: ::c_int = 34; | |
309 | pub const F_SETLKW: ::c_int = 35; | |
310 | pub const F_SETOWN: ::c_int = 24; | |
311 | ||
312 | pub const VEOF: usize = 16; | |
313 | pub const VEOL: usize = 17; | |
314 | pub const VEOL2: usize = 6; | |
315 | pub const VMIN: usize = 4; | |
316 | pub const IEXTEN: ::tcflag_t = 0o000400; | |
317 | pub const TOSTOP: ::tcflag_t = 0o100000; | |
318 | pub const FLUSHO: ::tcflag_t = 0o020000; | |
319 | ||
320 | pub const TCGETS: ::c_int = 0x540D; | |
321 | pub const TCSETS: ::c_int = 0x540E; | |
322 | pub const TCSETSW: ::c_int = 0x540F; | |
323 | pub const TCSETSF: ::c_int = 0x5410; | |
324 | pub const TCGETA: ::c_int = 0x5401; | |
325 | pub const TCSETA: ::c_int = 0x5402; | |
326 | pub const TCSETAW: ::c_int = 0x5403; | |
327 | pub const TCSETAF: ::c_int = 0x5404; | |
328 | pub const TCSBRK: ::c_int = 0x5405; | |
329 | pub const TCXONC: ::c_int = 0x5406; | |
330 | pub const TCFLSH: ::c_int = 0x5407; | |
331 | pub const TIOCGSOFTCAR: ::c_int = 0x5481; | |
332 | pub const TIOCSSOFTCAR: ::c_int = 0x5482; | |
333 | pub const TIOCLINUX: ::c_int = 0x5483; | |
334 | pub const TIOCGSERIAL: ::c_int = 0x5484; | |
335 | pub const TIOCEXCL: ::c_int = 0x740D; | |
336 | pub const TIOCNXCL: ::c_int = 0x740E; | |
337 | pub const TIOCSCTTY: ::c_int = 0x5480; | |
338 | pub const TIOCGPGRP: ::c_int = 0x40047477; | |
339 | pub const TIOCSPGRP: ::c_int = 0x80047476; | |
340 | pub const TIOCOUTQ: ::c_int = 0x7472; | |
341 | pub const TIOCSTI: ::c_int = 0x5472; | |
342 | pub const TIOCGWINSZ: ::c_int = 0x40087468; | |
343 | pub const TIOCSWINSZ: ::c_int = 0x80087467; | |
344 | pub const TIOCMGET: ::c_int = 0x741D; | |
345 | pub const TIOCMBIS: ::c_int = 0x741B; | |
346 | pub const TIOCMBIC: ::c_int = 0x741C; | |
347 | pub const TIOCMSET: ::c_int = 0x741A; | |
348 | pub const FIONREAD: ::c_int = 0x467F; | |
349 | pub const TIOCCONS: ::c_int = 0x80047478; | |
350 | ||
351 | pub const SYS_gettid: ::c_long = 4222; // Valid for O32 | |
352 | pub const SYS_perf_event_open: ::c_long = 4333; // Valid for O32 | |
353 | ||
354 | pub const POLLWRNORM: ::c_short = 0x4; | |
355 | pub const POLLWRBAND: ::c_short = 0x100; | |
041b39d2 XL |
356 | |
357 | pub const TIOCM_LE: ::c_int = 0x001; | |
358 | pub const TIOCM_DTR: ::c_int = 0x002; | |
359 | pub const TIOCM_RTS: ::c_int = 0x004; | |
360 | pub const TIOCM_ST: ::c_int = 0x010; | |
361 | pub const TIOCM_SR: ::c_int = 0x020; | |
362 | pub const TIOCM_CTS: ::c_int = 0x040; | |
363 | pub const TIOCM_CAR: ::c_int = 0x100; | |
364 | pub const TIOCM_CD: ::c_int = TIOCM_CAR; | |
365 | pub const TIOCM_RNG: ::c_int = 0x200; | |
366 | pub const TIOCM_RI: ::c_int = TIOCM_RNG; | |
367 | pub const TIOCM_DSR: ::c_int = 0x400; |