]>
Commit | Line | Data |
---|---|---|
92a42be0 SL |
1 | pub type c_char = i8; |
2 | pub type c_long = i32; | |
3 | pub type c_ulong = u32; | |
4 | pub type clock_t = i32; | |
5 | pub type time_t = i32; | |
6 | pub type suseconds_t = i32; | |
7 | pub type wchar_t = i32; | |
8 | pub type off_t = i32; | |
9 | pub type ino_t = u32; | |
10 | pub type blkcnt_t = i32; | |
11 | pub type blksize_t = i32; | |
12 | pub type nlink_t = u32; | |
7453a54e SL |
13 | pub type fsblkcnt_t = ::c_ulong; |
14 | pub type fsfilcnt_t = ::c_ulong; | |
15 | pub type rlim_t = c_ulong; | |
92a42be0 SL |
16 | |
17 | s! { | |
18 | pub struct stat { | |
19 | pub st_dev: ::c_ulong, | |
20 | st_pad1: [::c_long; 3], | |
21 | pub st_ino: ::ino_t, | |
22 | pub st_mode: ::mode_t, | |
23 | pub st_nlink: ::nlink_t, | |
24 | pub st_uid: ::uid_t, | |
25 | pub st_gid: ::gid_t, | |
26 | pub st_rdev: ::c_ulong, | |
27 | pub st_pad2: [::c_long; 2], | |
28 | pub st_size: ::off_t, | |
29 | st_pad3: ::c_long, | |
30 | pub st_atime: ::time_t, | |
31 | pub st_atime_nsec: ::c_long, | |
32 | pub st_mtime: ::time_t, | |
33 | pub st_mtime_nsec: ::c_long, | |
34 | pub st_ctime: ::time_t, | |
35 | pub st_ctime_nsec: ::c_long, | |
36 | pub st_blksize: ::blksize_t, | |
37 | pub st_blocks: ::blkcnt_t, | |
38 | st_pad5: [::c_long; 14], | |
39 | } | |
40 | ||
41 | pub struct stat64 { | |
42 | pub st_dev: ::c_ulong, | |
43 | st_pad1: [::c_long; 3], | |
44 | pub st_ino: ::ino64_t, | |
45 | pub st_mode: ::mode_t, | |
46 | pub st_nlink: ::nlink_t, | |
47 | pub st_uid: ::uid_t, | |
48 | pub st_gid: ::gid_t, | |
49 | pub st_rdev: ::c_ulong, | |
50 | st_pad2: [::c_long; 2], | |
51 | pub st_size: ::off64_t, | |
52 | pub st_atime: ::time_t, | |
53 | pub st_atime_nsec: ::c_long, | |
54 | pub st_mtime: ::time_t, | |
55 | pub st_mtime_nsec: ::c_long, | |
56 | pub st_ctime: ::time_t, | |
57 | pub st_ctime_nsec: ::c_long, | |
58 | pub st_blksize: ::blksize_t, | |
59 | st_pad3: ::c_long, | |
60 | pub st_blocks: ::blkcnt64_t, | |
61 | st_pad5: [::c_long; 14], | |
62 | } | |
63 | ||
64 | pub struct pthread_attr_t { | |
65 | __size: [u32; 9] | |
66 | } | |
67 | ||
68 | pub struct sigaction { | |
9cc50fc6 | 69 | pub sa_flags: ::c_int, |
92a42be0 SL |
70 | pub sa_sigaction: ::sighandler_t, |
71 | pub sa_mask: sigset_t, | |
72 | _restorer: *mut ::c_void, | |
73 | _resv: [::c_int; 1], | |
74 | } | |
75 | ||
76 | pub struct stack_t { | |
77 | pub ss_sp: *mut ::c_void, | |
78 | pub ss_size: ::size_t, | |
79 | pub ss_flags: ::c_int, | |
80 | } | |
81 | ||
82 | pub struct sigset_t { | |
83 | __val: [::c_ulong; 32], | |
84 | } | |
85 | ||
86 | pub struct siginfo_t { | |
87 | pub si_signo: ::c_int, | |
88 | pub si_code: ::c_int, | |
89 | pub si_errno: ::c_int, | |
90 | pub _pad: [::c_int; 29], | |
91 | } | |
92 | ||
93 | pub struct glob64_t { | |
94 | pub gl_pathc: ::size_t, | |
95 | pub gl_pathv: *mut *mut ::c_char, | |
96 | pub gl_offs: ::size_t, | |
97 | pub gl_flags: ::c_int, | |
98 | ||
99 | __unused1: *mut ::c_void, | |
100 | __unused2: *mut ::c_void, | |
101 | __unused3: *mut ::c_void, | |
102 | __unused4: *mut ::c_void, | |
103 | __unused5: *mut ::c_void, | |
104 | } | |
9cc50fc6 SL |
105 | |
106 | pub struct ipc_perm { | |
107 | pub __key: ::key_t, | |
108 | pub uid: ::uid_t, | |
109 | pub gid: ::gid_t, | |
110 | pub cuid: ::uid_t, | |
111 | pub cgid: ::gid_t, | |
112 | pub mode: ::c_uint, | |
113 | pub __seq: ::c_ushort, | |
114 | __pad1: ::c_ushort, | |
115 | __unused1: ::c_ulong, | |
116 | __unused2: ::c_ulong | |
117 | } | |
118 | ||
119 | pub struct shmid_ds { | |
120 | pub shm_perm: ::ipc_perm, | |
121 | pub shm_segsz: ::size_t, | |
122 | pub shm_atime: ::time_t, | |
123 | pub shm_dtime: ::time_t, | |
124 | pub shm_ctime: ::time_t, | |
125 | pub shm_cpid: ::pid_t, | |
126 | pub shm_lpid: ::pid_t, | |
127 | pub shm_nattch: ::shmatt_t, | |
128 | __unused4: ::c_ulong, | |
129 | __unused5: ::c_ulong | |
130 | } | |
131 | ||
9e0c209e SL |
132 | pub struct msqid_ds { |
133 | pub msg_perm: ::ipc_perm, | |
134 | #[cfg(target_endian = "big")] | |
135 | __glibc_reserved1: ::c_ulong, | |
136 | pub msg_stime: ::time_t, | |
137 | #[cfg(target_endian = "little")] | |
138 | __glibc_reserved1: ::c_ulong, | |
139 | #[cfg(target_endian = "big")] | |
140 | __glibc_reserved2: ::c_ulong, | |
141 | pub msg_rtime: ::time_t, | |
142 | #[cfg(target_endian = "little")] | |
143 | __glibc_reserved2: ::c_ulong, | |
144 | #[cfg(target_endian = "big")] | |
145 | __glibc_reserved3: ::c_ulong, | |
146 | pub msg_ctime: ::time_t, | |
147 | #[cfg(target_endian = "little")] | |
148 | __glibc_reserved3: ::c_ulong, | |
149 | __msg_cbytes: ::c_ulong, | |
150 | pub msg_qnum: ::msgqnum_t, | |
151 | pub msg_qbytes: ::msglen_t, | |
152 | pub msg_lspid: ::pid_t, | |
153 | pub msg_lrpid: ::pid_t, | |
154 | __glibc_reserved4: ::c_ulong, | |
155 | __glibc_reserved5: ::c_ulong, | |
156 | } | |
157 | ||
9cc50fc6 SL |
158 | pub struct statfs { |
159 | pub f_type: ::c_long, | |
160 | pub f_bsize: ::c_long, | |
161 | pub f_frsize: ::c_long, | |
162 | pub f_blocks: ::fsblkcnt_t, | |
163 | pub f_bfree: ::fsblkcnt_t, | |
164 | pub f_files: ::fsblkcnt_t, | |
165 | pub f_ffree: ::fsblkcnt_t, | |
166 | pub f_bavail: ::fsblkcnt_t, | |
167 | pub f_fsid: ::fsid_t, | |
168 | ||
169 | pub f_namelen: ::c_long, | |
170 | f_spare: [::c_long; 6], | |
171 | } | |
172 | ||
173 | pub struct msghdr { | |
174 | pub msg_name: *mut ::c_void, | |
175 | pub msg_namelen: ::socklen_t, | |
176 | pub msg_iov: *mut ::iovec, | |
177 | pub msg_iovlen: ::size_t, | |
178 | pub msg_control: *mut ::c_void, | |
179 | pub msg_controllen: ::size_t, | |
180 | pub msg_flags: ::c_int, | |
181 | } | |
182 | ||
183 | pub struct termios { | |
184 | pub c_iflag: ::tcflag_t, | |
185 | pub c_oflag: ::tcflag_t, | |
186 | pub c_cflag: ::tcflag_t, | |
187 | pub c_lflag: ::tcflag_t, | |
188 | pub c_line: ::cc_t, | |
189 | pub c_cc: [::cc_t; ::NCCS], | |
190 | } | |
191 | ||
192 | pub struct flock { | |
193 | pub l_type: ::c_short, | |
194 | pub l_whence: ::c_short, | |
195 | pub l_start: ::off_t, | |
196 | pub l_len: ::off_t, | |
197 | pub l_sysid: ::c_long, | |
198 | pub l_pid: ::pid_t, | |
199 | pad: [::c_long; 4], | |
200 | } | |
3157f602 XL |
201 | |
202 | pub struct sysinfo { | |
203 | pub uptime: ::c_long, | |
204 | pub loads: [::c_ulong; 3], | |
205 | pub totalram: ::c_ulong, | |
206 | pub freeram: ::c_ulong, | |
207 | pub sharedram: ::c_ulong, | |
208 | pub bufferram: ::c_ulong, | |
209 | pub totalswap: ::c_ulong, | |
210 | pub freeswap: ::c_ulong, | |
211 | pub procs: ::c_ushort, | |
212 | pub pad: ::c_ushort, | |
213 | pub totalhigh: ::c_ulong, | |
214 | pub freehigh: ::c_ulong, | |
215 | pub mem_unit: ::c_uint, | |
216 | pub _f: [::c_char; 8], | |
217 | } | |
5bcae85e SL |
218 | |
219 | // FIXME this is actually a union | |
220 | pub struct sem_t { | |
221 | #[cfg(target_pointer_width = "32")] | |
222 | __size: [::c_char; 16], | |
223 | #[cfg(target_pointer_width = "64")] | |
224 | __size: [::c_char; 32], | |
225 | __align: [::c_long; 0], | |
226 | } | |
92a42be0 SL |
227 | } |
228 | ||
229 | pub const BUFSIZ: ::c_uint = 8192; | |
230 | pub const TMP_MAX: ::c_uint = 238328; | |
231 | pub const FOPEN_MAX: ::c_uint = 16; | |
9e0c209e SL |
232 | pub const POSIX_FADV_DONTNEED: ::c_int = 4; |
233 | pub const POSIX_FADV_NOREUSE: ::c_int = 5; | |
92a42be0 SL |
234 | pub const POSIX_MADV_DONTNEED: ::c_int = 4; |
235 | pub const _SC_2_C_VERSION: ::c_int = 96; | |
92a42be0 | 236 | pub const O_ACCMODE: ::c_int = 3; |
9cc50fc6 SL |
237 | pub const O_DIRECT: ::c_int = 0x8000; |
238 | pub const O_DIRECTORY: ::c_int = 0x10000; | |
239 | pub const O_NOFOLLOW: ::c_int = 0x20000; | |
92a42be0 SL |
240 | pub const ST_RELATIME: ::c_ulong = 4096; |
241 | pub const NI_MAXHOST: ::socklen_t = 1025; | |
242 | ||
243 | pub const RLIMIT_NOFILE: ::c_int = 5; | |
244 | pub const RLIMIT_AS: ::c_int = 6; | |
245 | pub const RLIMIT_RSS: ::c_int = 7; | |
246 | pub const RLIMIT_NPROC: ::c_int = 8; | |
247 | pub const RLIMIT_MEMLOCK: ::c_int = 9; | |
9cc50fc6 | 248 | pub const RLIMIT_NLIMITS: ::c_int = 16; |
92a42be0 SL |
249 | pub const RLIM_INFINITY: ::rlim_t = 0x7fffffff; |
250 | ||
251 | pub const O_APPEND: ::c_int = 8; | |
252 | pub const O_CREAT: ::c_int = 256; | |
253 | pub const O_EXCL: ::c_int = 1024; | |
254 | pub const O_NOCTTY: ::c_int = 2048; | |
255 | pub const O_NONBLOCK: ::c_int = 128; | |
9cc50fc6 SL |
256 | pub const O_SYNC: ::c_int = 0x4010; |
257 | pub const O_RSYNC: ::c_int = 0x4010; | |
92a42be0 | 258 | pub const O_DSYNC: ::c_int = 0x10; |
9cc50fc6 SL |
259 | pub const O_FSYNC: ::c_int = 0x4010; |
260 | pub const O_ASYNC: ::c_int = 0x1000; | |
261 | pub const O_NDELAY: ::c_int = 0x80; | |
92a42be0 | 262 | |
7453a54e SL |
263 | pub const SOCK_NONBLOCK: ::c_int = 128; |
264 | ||
92a42be0 SL |
265 | pub const EDEADLK: ::c_int = 45; |
266 | pub const ENAMETOOLONG: ::c_int = 78; | |
267 | pub const ENOLCK: ::c_int = 46; | |
268 | pub const ENOSYS: ::c_int = 89; | |
269 | pub const ENOTEMPTY: ::c_int = 93; | |
270 | pub const ELOOP: ::c_int = 90; | |
271 | pub const ENOMSG: ::c_int = 35; | |
272 | pub const EIDRM: ::c_int = 36; | |
273 | pub const ECHRNG: ::c_int = 37; | |
274 | pub const EL2NSYNC: ::c_int = 38; | |
275 | pub const EL3HLT: ::c_int = 39; | |
276 | pub const EL3RST: ::c_int = 40; | |
277 | pub const ELNRNG: ::c_int = 41; | |
278 | pub const EUNATCH: ::c_int = 42; | |
279 | pub const ENOCSI: ::c_int = 43; | |
280 | pub const EL2HLT: ::c_int = 44; | |
281 | pub const EBADE: ::c_int = 50; | |
282 | pub const EBADR: ::c_int = 51; | |
283 | pub const EXFULL: ::c_int = 52; | |
284 | pub const ENOANO: ::c_int = 53; | |
285 | pub const EBADRQC: ::c_int = 54; | |
286 | pub const EBADSLT: ::c_int = 55; | |
287 | pub const EDEADLOCK: ::c_int = 56; | |
288 | pub const EMULTIHOP: ::c_int = 74; | |
289 | pub const EOVERFLOW: ::c_int = 79; | |
290 | pub const ENOTUNIQ: ::c_int = 80; | |
291 | pub const EBADFD: ::c_int = 81; | |
292 | pub const EBADMSG: ::c_int = 77; | |
293 | pub const EREMCHG: ::c_int = 82; | |
294 | pub const ELIBACC: ::c_int = 83; | |
295 | pub const ELIBBAD: ::c_int = 84; | |
296 | pub const ELIBSCN: ::c_int = 85; | |
297 | pub const ELIBMAX: ::c_int = 86; | |
298 | pub const ELIBEXEC: ::c_int = 87; | |
299 | pub const EILSEQ: ::c_int = 88; | |
300 | pub const ERESTART: ::c_int = 91; | |
301 | pub const ESTRPIPE: ::c_int = 92; | |
302 | pub const EUSERS: ::c_int = 94; | |
303 | pub const ENOTSOCK: ::c_int = 95; | |
304 | pub const EDESTADDRREQ: ::c_int = 96; | |
305 | pub const EMSGSIZE: ::c_int = 97; | |
306 | pub const EPROTOTYPE: ::c_int = 98; | |
307 | pub const ENOPROTOOPT: ::c_int = 99; | |
308 | pub const EPROTONOSUPPORT: ::c_int = 120; | |
309 | pub const ESOCKTNOSUPPORT: ::c_int = 121; | |
310 | pub const EOPNOTSUPP: ::c_int = 122; | |
311 | pub const EPFNOSUPPORT: ::c_int = 123; | |
312 | pub const EAFNOSUPPORT: ::c_int = 124; | |
313 | pub const EADDRINUSE: ::c_int = 125; | |
314 | pub const EADDRNOTAVAIL: ::c_int = 126; | |
315 | pub const ENETDOWN: ::c_int = 127; | |
316 | pub const ENETUNREACH: ::c_int = 128; | |
317 | pub const ENETRESET: ::c_int = 129; | |
318 | pub const ECONNABORTED: ::c_int = 130; | |
319 | pub const ECONNRESET: ::c_int = 131; | |
320 | pub const ENOBUFS: ::c_int = 132; | |
321 | pub const EISCONN: ::c_int = 133; | |
322 | pub const ENOTCONN: ::c_int = 134; | |
323 | pub const ESHUTDOWN: ::c_int = 143; | |
324 | pub const ETOOMANYREFS: ::c_int = 144; | |
325 | pub const ETIMEDOUT: ::c_int = 145; | |
326 | pub const ECONNREFUSED: ::c_int = 146; | |
327 | pub const EHOSTDOWN: ::c_int = 147; | |
328 | pub const EHOSTUNREACH: ::c_int = 148; | |
329 | pub const EALREADY: ::c_int = 149; | |
330 | pub const EINPROGRESS: ::c_int = 150; | |
331 | pub const ESTALE: ::c_int = 151; | |
332 | pub const EUCLEAN: ::c_int = 135; | |
333 | pub const ENOTNAM: ::c_int = 137; | |
334 | pub const ENAVAIL: ::c_int = 138; | |
335 | pub const EISNAM: ::c_int = 139; | |
336 | pub const EREMOTEIO: ::c_int = 140; | |
337 | pub const EDQUOT: ::c_int = 1133; | |
338 | pub const ENOMEDIUM: ::c_int = 159; | |
339 | pub const EMEDIUMTYPE: ::c_int = 160; | |
340 | pub const ECANCELED: ::c_int = 158; | |
341 | pub const ENOKEY: ::c_int = 161; | |
342 | pub const EKEYEXPIRED: ::c_int = 162; | |
343 | pub const EKEYREVOKED: ::c_int = 163; | |
344 | pub const EKEYREJECTED: ::c_int = 164; | |
345 | pub const EOWNERDEAD: ::c_int = 165; | |
346 | pub const ENOTRECOVERABLE: ::c_int = 166; | |
347 | pub const ERFKILL: ::c_int = 167; | |
348 | ||
54a0048b SL |
349 | pub const LC_PAPER: ::c_int = 7; |
350 | pub const LC_NAME: ::c_int = 8; | |
351 | pub const LC_ADDRESS: ::c_int = 9; | |
352 | pub const LC_TELEPHONE: ::c_int = 10; | |
353 | pub const LC_MEASUREMENT: ::c_int = 11; | |
354 | pub const LC_IDENTIFICATION: ::c_int = 12; | |
a7813a04 XL |
355 | pub const LC_PAPER_MASK: ::c_int = (1 << LC_PAPER); |
356 | pub const LC_NAME_MASK: ::c_int = (1 << LC_NAME); | |
357 | pub const LC_ADDRESS_MASK: ::c_int = (1 << LC_ADDRESS); | |
358 | pub const LC_TELEPHONE_MASK: ::c_int = (1 << LC_TELEPHONE); | |
359 | pub const LC_MEASUREMENT_MASK: ::c_int = (1 << LC_MEASUREMENT); | |
360 | pub const LC_IDENTIFICATION_MASK: ::c_int = (1 << LC_IDENTIFICATION); | |
361 | pub const LC_ALL_MASK: ::c_int = ::LC_CTYPE_MASK | |
362 | | ::LC_NUMERIC_MASK | |
363 | | ::LC_TIME_MASK | |
364 | | ::LC_COLLATE_MASK | |
365 | | ::LC_MONETARY_MASK | |
366 | | ::LC_MESSAGES_MASK | |
367 | | LC_PAPER_MASK | |
368 | | LC_NAME_MASK | |
369 | | LC_ADDRESS_MASK | |
370 | | LC_TELEPHONE_MASK | |
371 | | LC_MEASUREMENT_MASK | |
372 | | LC_IDENTIFICATION_MASK; | |
54a0048b | 373 | |
92a42be0 SL |
374 | pub const MAP_NORESERVE: ::c_int = 0x400; |
375 | pub const MAP_ANON: ::c_int = 0x800; | |
376 | pub const MAP_ANONYMOUS: ::c_int = 0x800; | |
377 | pub const MAP_GROWSDOWN: ::c_int = 0x1000; | |
378 | pub const MAP_DENYWRITE: ::c_int = 0x2000; | |
379 | pub const MAP_EXECUTABLE: ::c_int = 0x4000; | |
380 | pub const MAP_LOCKED: ::c_int = 0x8000; | |
381 | pub const MAP_POPULATE: ::c_int = 0x10000; | |
382 | pub const MAP_NONBLOCK: ::c_int = 0x20000; | |
54a0048b | 383 | pub const MAP_STACK: ::c_int = 0x40000; |
92a42be0 SL |
384 | |
385 | pub const SOCK_STREAM: ::c_int = 2; | |
386 | pub const SOCK_DGRAM: ::c_int = 1; | |
3157f602 | 387 | pub const SOCK_SEQPACKET: ::c_int = 5; |
92a42be0 SL |
388 | |
389 | pub const SOL_SOCKET: ::c_int = 0xffff; | |
390 | ||
391 | pub const SO_REUSEADDR: ::c_int = 4; | |
9e0c209e | 392 | pub const SO_REUSEPORT: ::c_int = 0x200; |
92a42be0 SL |
393 | pub const SO_TYPE: ::c_int = 4104; |
394 | pub const SO_ERROR: ::c_int = 4103; | |
395 | pub const SO_DONTROUTE: ::c_int = 16; | |
396 | pub const SO_BROADCAST: ::c_int = 32; | |
397 | pub const SO_SNDBUF: ::c_int = 4097; | |
398 | pub const SO_RCVBUF: ::c_int = 4098; | |
399 | pub const SO_KEEPALIVE: ::c_int = 8; | |
400 | pub const SO_OOBINLINE: ::c_int = 256; | |
401 | pub const SO_LINGER: ::c_int = 128; | |
402 | pub const SO_RCVLOWAT: ::c_int = 4100; | |
403 | pub const SO_SNDLOWAT: ::c_int = 4099; | |
404 | pub const SO_RCVTIMEO: ::c_int = 4102; | |
405 | pub const SO_SNDTIMEO: ::c_int = 4101; | |
406 | pub const SO_ACCEPTCONN: ::c_int = 4105; | |
407 | ||
5bcae85e | 408 | pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; |
92a42be0 SL |
409 | pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 24; |
410 | pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32; | |
411 | pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; | |
412 | ||
413 | pub const FIOCLEX: ::c_ulong = 0x6601; | |
414 | pub const FIONBIO: ::c_ulong = 0x667e; | |
415 | ||
9cc50fc6 SL |
416 | pub const SA_ONSTACK: ::c_int = 0x08000000; |
417 | pub const SA_SIGINFO: ::c_int = 0x00000008; | |
418 | pub const SA_NOCLDWAIT: ::c_int = 0x00010000; | |
92a42be0 SL |
419 | |
420 | pub const SIGCHLD: ::c_int = 18; | |
421 | pub const SIGBUS: ::c_int = 10; | |
9cc50fc6 SL |
422 | pub const SIGTTIN: ::c_int = 26; |
423 | pub const SIGTTOU: ::c_int = 27; | |
424 | pub const SIGXCPU: ::c_int = 30; | |
425 | pub const SIGXFSZ: ::c_int = 31; | |
426 | pub const SIGVTALRM: ::c_int = 28; | |
427 | pub const SIGPROF: ::c_int = 29; | |
428 | pub const SIGWINCH: ::c_int = 20; | |
429 | pub const SIGUSR1: ::c_int = 16; | |
430 | pub const SIGUSR2: ::c_int = 17; | |
431 | pub const SIGCONT: ::c_int = 25; | |
432 | pub const SIGSTOP: ::c_int = 23; | |
433 | pub const SIGTSTP: ::c_int = 24; | |
434 | pub const SIGURG: ::c_int = 21; | |
435 | pub const SIGIO: ::c_int = 22; | |
436 | pub const SIGSYS: ::c_int = 12; | |
437 | pub const SIGPOLL: ::c_int = 22; | |
438 | pub const SIGPWR: ::c_int = 19; | |
92a42be0 | 439 | pub const SIG_SETMASK: ::c_int = 3; |
9cc50fc6 SL |
440 | pub const SIG_BLOCK: ::c_int = 0x1; |
441 | pub const SIG_UNBLOCK: ::c_int = 0x2; | |
442 | ||
9e0c209e SL |
443 | pub const POLLRDNORM: ::c_short = 0x040; |
444 | pub const POLLWRNORM: ::c_short = 0x004; | |
445 | pub const POLLRDBAND: ::c_short = 0x080; | |
446 | pub const POLLWRBAND: ::c_short = 0x100; | |
447 | ||
92a42be0 SL |
448 | pub const PTHREAD_STACK_MIN: ::size_t = 131072; |
449 | ||
9cc50fc6 SL |
450 | pub const ADFS_SUPER_MAGIC: ::c_long = 0x0000adf5; |
451 | pub const AFFS_SUPER_MAGIC: ::c_long = 0x0000adff; | |
452 | pub const CODA_SUPER_MAGIC: ::c_long = 0x73757245; | |
453 | pub const CRAMFS_MAGIC: ::c_long = 0x28cd3d45; | |
454 | pub const EFS_SUPER_MAGIC: ::c_long = 0x00414a53; | |
455 | pub const EXT2_SUPER_MAGIC: ::c_long = 0x0000ef53; | |
456 | pub const EXT3_SUPER_MAGIC: ::c_long = 0x0000ef53; | |
457 | pub const EXT4_SUPER_MAGIC: ::c_long = 0x0000ef53; | |
458 | pub const HPFS_SUPER_MAGIC: ::c_long = 0xf995e849; | |
459 | pub const HUGETLBFS_MAGIC: ::c_long = 0x958458f6; | |
460 | pub const ISOFS_SUPER_MAGIC: ::c_long = 0x00009660; | |
461 | pub const JFFS2_SUPER_MAGIC: ::c_long = 0x000072b6; | |
462 | pub const MINIX_SUPER_MAGIC: ::c_long = 0x0000137f; | |
463 | pub const MINIX_SUPER_MAGIC2: ::c_long = 0x0000138f; | |
464 | pub const MINIX2_SUPER_MAGIC: ::c_long = 0x00002468; | |
465 | pub const MINIX2_SUPER_MAGIC2: ::c_long = 0x00002478; | |
466 | pub const MSDOS_SUPER_MAGIC: ::c_long = 0x00004d44; | |
467 | pub const NCP_SUPER_MAGIC: ::c_long = 0x0000564c; | |
468 | pub const NFS_SUPER_MAGIC: ::c_long = 0x00006969; | |
469 | pub const OPENPROM_SUPER_MAGIC: ::c_long = 0x00009fa1; | |
470 | pub const PROC_SUPER_MAGIC: ::c_long = 0x00009fa0; | |
471 | pub const QNX4_SUPER_MAGIC: ::c_long = 0x0000002f; | |
472 | pub const REISERFS_SUPER_MAGIC: ::c_long = 0x52654973; | |
473 | pub const SMB_SUPER_MAGIC: ::c_long = 0x0000517b; | |
474 | pub const TMPFS_MAGIC: ::c_long = 0x01021994; | |
475 | pub const USBDEVICE_SUPER_MAGIC: ::c_long = 0x00009fa2; | |
476 | ||
477 | pub const VEOF: usize = 16; | |
478 | pub const VEOL: usize = 17; | |
479 | pub const VEOL2: usize = 6; | |
480 | pub const VMIN: usize = 4; | |
481 | pub const IEXTEN: ::tcflag_t = 0x00000100; | |
482 | pub const TOSTOP: ::tcflag_t = 0x00008000; | |
483 | pub const FLUSHO: ::tcflag_t = 0x00002000; | |
484 | pub const IUTF8: ::tcflag_t = 0x00004000; | |
485 | pub const TCSANOW: ::c_int = 0x540e; | |
486 | pub const TCSADRAIN: ::c_int = 0x540f; | |
487 | pub const TCSAFLUSH: ::c_int = 0x5410; | |
488 | ||
489 | pub const CPU_SETSIZE: ::c_int = 0x400; | |
490 | ||
491 | pub const PTRACE_TRACEME: ::c_uint = 0; | |
492 | pub const PTRACE_PEEKTEXT: ::c_uint = 1; | |
493 | pub const PTRACE_PEEKDATA: ::c_uint = 2; | |
494 | pub const PTRACE_PEEKUSER: ::c_uint = 3; | |
495 | pub const PTRACE_POKETEXT: ::c_uint = 4; | |
496 | pub const PTRACE_POKEDATA: ::c_uint = 5; | |
497 | pub const PTRACE_POKEUSER: ::c_uint = 6; | |
498 | pub const PTRACE_CONT: ::c_uint = 7; | |
499 | pub const PTRACE_KILL: ::c_uint = 8; | |
500 | pub const PTRACE_SINGLESTEP: ::c_uint = 9; | |
501 | pub const PTRACE_ATTACH: ::c_uint = 16; | |
502 | pub const PTRACE_DETACH: ::c_uint = 17; | |
503 | pub const PTRACE_SYSCALL: ::c_uint = 24; | |
504 | pub const PTRACE_SETOPTIONS: ::c_uint = 0x4200; | |
505 | pub const PTRACE_GETEVENTMSG: ::c_uint = 0x4201; | |
506 | pub const PTRACE_GETSIGINFO: ::c_uint = 0x4202; | |
507 | pub const PTRACE_SETSIGINFO: ::c_uint = 0x4203; | |
508 | pub const PTRACE_GETFPREGS: ::c_uint = 14; | |
509 | pub const PTRACE_SETFPREGS: ::c_uint = 15; | |
510 | pub const PTRACE_GETFPXREGS: ::c_uint = 18; | |
511 | pub const PTRACE_SETFPXREGS: ::c_uint = 19; | |
512 | pub const PTRACE_GETREGS: ::c_uint = 12; | |
513 | pub const PTRACE_SETREGS: ::c_uint = 13; | |
514 | ||
54a0048b SL |
515 | pub const MAP_HUGETLB: ::c_int = 0x080000; |
516 | ||
9cc50fc6 SL |
517 | pub const EFD_NONBLOCK: ::c_int = 0x80; |
518 | ||
519 | pub const F_GETLK: ::c_int = 14; | |
520 | pub const F_GETOWN: ::c_int = 23; | |
521 | pub const F_SETOWN: ::c_int = 24; | |
7453a54e SL |
522 | pub const F_SETLK: ::c_int = 6; |
523 | pub const F_SETLKW: ::c_int = 7; | |
9cc50fc6 SL |
524 | |
525 | pub const SFD_NONBLOCK: ::c_int = 0x80; | |
526 | ||
527 | pub const TCGETS: ::c_ulong = 0x540d; | |
528 | pub const TCSETS: ::c_ulong = 0x540e; | |
529 | pub const TCSETSW: ::c_ulong = 0x540f; | |
530 | pub const TCSETSF: ::c_ulong = 0x5410; | |
531 | pub const TCGETA: ::c_ulong = 0x5401; | |
532 | pub const TCSETA: ::c_ulong = 0x5402; | |
533 | pub const TCSETAW: ::c_ulong = 0x5403; | |
534 | pub const TCSETAF: ::c_ulong = 0x5404; | |
535 | pub const TCSBRK: ::c_ulong = 0x5405; | |
536 | pub const TCXONC: ::c_ulong = 0x5406; | |
537 | pub const TCFLSH: ::c_ulong = 0x5407; | |
538 | pub const TIOCGSOFTCAR: ::c_ulong = 0x5481; | |
539 | pub const TIOCSSOFTCAR: ::c_ulong = 0x5482; | |
540 | pub const TIOCINQ: ::c_ulong = 0x467f; | |
541 | pub const TIOCLINUX: ::c_ulong = 0x5483; | |
542 | pub const TIOCGSERIAL: ::c_ulong = 0x5484; | |
543 | pub const TIOCEXCL: ::c_ulong = 0x740d; | |
544 | pub const TIOCNXCL: ::c_ulong = 0x740e; | |
545 | pub const TIOCSCTTY: ::c_ulong = 0x5480; | |
546 | pub const TIOCGPGRP: ::c_ulong = 0x40047477; | |
547 | pub const TIOCSPGRP: ::c_ulong = 0x80047476; | |
548 | pub const TIOCOUTQ: ::c_ulong = 0x7472; | |
549 | pub const TIOCSTI: ::c_ulong = 0x5472; | |
550 | pub const TIOCGWINSZ: ::c_ulong = 0x40087468; | |
551 | pub const TIOCSWINSZ: ::c_ulong = 0x80087467; | |
552 | pub const TIOCMGET: ::c_ulong = 0x741d; | |
553 | pub const TIOCMBIS: ::c_ulong = 0x741b; | |
554 | pub const TIOCMBIC: ::c_ulong = 0x741c; | |
555 | pub const TIOCMSET: ::c_ulong = 0x741a; | |
556 | pub const FIONREAD: ::c_ulong = 0x467f; | |
557 | pub const TIOCCONS: ::c_ulong = 0x80047478; | |
558 | ||
7453a54e SL |
559 | pub const RTLD_DEEPBIND: ::c_int = 0x10; |
560 | pub const RTLD_GLOBAL: ::c_int = 0x4; | |
561 | pub const RTLD_NOLOAD: ::c_int = 0x8; | |
562 | ||
5bcae85e SL |
563 | pub const LINUX_REBOOT_MAGIC1: ::c_int = 0xfee1dead; |
564 | pub const LINUX_REBOOT_MAGIC2: ::c_int = 672274793; | |
565 | pub const LINUX_REBOOT_MAGIC2A: ::c_int = 85072278; | |
566 | pub const LINUX_REBOOT_MAGIC2B: ::c_int = 369367448; | |
567 | pub const LINUX_REBOOT_MAGIC2C: ::c_int = 537993216; | |
568 | ||
569 | pub const LINUX_REBOOT_CMD_RESTART: ::c_int = 0x01234567; | |
570 | pub const LINUX_REBOOT_CMD_HALT: ::c_int = 0xCDEF0123; | |
571 | pub const LINUX_REBOOT_CMD_CAD_ON: ::c_int = 0x89ABCDEF; | |
572 | pub const LINUX_REBOOT_CMD_CAD_OFF: ::c_int = 0x00000000; | |
573 | pub const LINUX_REBOOT_CMD_POWER_OFF: ::c_int = 0x4321FEDC; | |
574 | pub const LINUX_REBOOT_CMD_RESTART2: ::c_int = 0xA1B2C3D4; | |
575 | pub const LINUX_REBOOT_CMD_SW_SUSPEND: ::c_int = 0xD000FCE2; | |
576 | pub const LINUX_REBOOT_CMD_KEXEC: ::c_int = 0x45584543; | |
577 | ||
54a0048b SL |
578 | pub const SYS_gettid: ::c_long = 4222; // Valid for O32 |
579 | ||
9e0c209e SL |
580 | pub const MCL_CURRENT: ::c_int = 0x0001; |
581 | pub const MCL_FUTURE: ::c_int = 0x0002; | |
582 | ||
583 | pub const SIGSTKSZ: ::size_t = 8192; | |
584 | pub const CBAUD: ::tcflag_t = 0o0010017; | |
585 | pub const TAB1: ::c_int = 0x00000800; | |
586 | pub const TAB2: ::c_int = 0x00001000; | |
587 | pub const TAB3: ::c_int = 0x00001800; | |
588 | pub const CR1: ::c_int = 0x00000200; | |
589 | pub const CR2: ::c_int = 0x00000400; | |
590 | pub const CR3: ::c_int = 0x00000600; | |
591 | pub const FF1: ::c_int = 0x00008000; | |
592 | pub const BS1: ::c_int = 0x00002000; | |
593 | pub const VT1: ::c_int = 0x00004000; | |
594 | pub const VWERASE: usize = 14; | |
595 | pub const VREPRINT: usize = 12; | |
596 | pub const VSUSP: usize = 10; | |
597 | pub const VSTART: usize = 8; | |
598 | pub const VSTOP: usize = 9; | |
599 | pub const VDISCARD: usize = 13; | |
600 | pub const VTIME: usize = 5; | |
601 | pub const IXON: ::tcflag_t = 0x00000400; | |
602 | pub const IXOFF: ::tcflag_t = 0x00001000; | |
603 | pub const ONLCR: ::tcflag_t = 0x4; | |
604 | pub const CSIZE: ::tcflag_t = 0x00000030; | |
605 | pub const CS6: ::tcflag_t = 0x00000010; | |
606 | pub const CS7: ::tcflag_t = 0x00000020; | |
607 | pub const CS8: ::tcflag_t = 0x00000030; | |
608 | pub const CSTOPB: ::tcflag_t = 0x00000040; | |
609 | pub const CREAD: ::tcflag_t = 0x00000080; | |
610 | pub const PARENB: ::tcflag_t = 0x00000100; | |
611 | pub const PARODD: ::tcflag_t = 0x00000200; | |
612 | pub const HUPCL: ::tcflag_t = 0x00000400; | |
613 | pub const CLOCAL: ::tcflag_t = 0x00000800; | |
614 | pub const ECHOKE: ::tcflag_t = 0x00000800; | |
615 | pub const ECHOE: ::tcflag_t = 0x00000010; | |
616 | pub const ECHOK: ::tcflag_t = 0x00000020; | |
617 | pub const ECHONL: ::tcflag_t = 0x00000040; | |
618 | pub const ECHOPRT: ::tcflag_t = 0x00000400; | |
619 | pub const ECHOCTL: ::tcflag_t = 0x00000200; | |
620 | pub const ISIG: ::tcflag_t = 0x00000001; | |
621 | pub const ICANON: ::tcflag_t = 0x00000002; | |
622 | pub const PENDIN: ::tcflag_t = 0x00004000; | |
623 | pub const NOFLSH: ::tcflag_t = 0x00000080; | |
624 | ||
a7813a04 | 625 | #[link(name = "util")] |
92a42be0 SL |
626 | extern { |
627 | pub fn sysctl(name: *mut ::c_int, | |
628 | namelen: ::c_int, | |
629 | oldp: *mut ::c_void, | |
630 | oldlenp: *mut ::size_t, | |
631 | newp: *mut ::c_void, | |
632 | newlen: ::size_t) | |
633 | -> ::c_int; | |
634 | pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int; | |
635 | pub fn backtrace(buf: *mut *mut ::c_void, | |
636 | sz: ::c_int) -> ::c_int; | |
637 | pub fn glob64(pattern: *const ::c_char, | |
638 | flags: ::c_int, | |
54a0048b SL |
639 | errfunc: ::dox::Option<extern fn(epath: *const ::c_char, |
640 | errno: ::c_int) | |
641 | -> ::c_int>, | |
92a42be0 SL |
642 | pglob: *mut glob64_t) -> ::c_int; |
643 | pub fn globfree64(pglob: *mut glob64_t); | |
9cc50fc6 | 644 | pub fn ptrace(request: ::c_uint, ...) -> ::c_long; |
7453a54e SL |
645 | pub fn pthread_attr_getaffinity_np(attr: *const ::pthread_attr_t, |
646 | cpusetsize: ::size_t, | |
647 | cpuset: *mut ::cpu_set_t) -> ::c_int; | |
648 | pub fn pthread_attr_setaffinity_np(attr: *mut ::pthread_attr_t, | |
649 | cpusetsize: ::size_t, | |
650 | cpuset: *const ::cpu_set_t) -> ::c_int; | |
92a42be0 | 651 | } |