]> git.proxmox.com Git - cargo.git/blob - vendor/libc-0.2.31/src/unix/notbsd/android/mod.rs
New upstream version 0.23.0
[cargo.git] / vendor / libc-0.2.31 / src / unix / notbsd / android / mod.rs
1 //! Android-specific definitions for linux-like values
2
3 use dox::{mem, Option};
4
5 pub type clock_t = ::c_long;
6 pub type time_t = ::c_long;
7 pub type suseconds_t = ::c_long;
8 pub type off_t = ::c_long;
9 pub type blkcnt_t = ::c_ulong;
10 pub type blksize_t = ::c_ulong;
11 pub type nlink_t = u32;
12 pub type useconds_t = u32;
13 pub type pthread_t = ::c_long;
14 pub type pthread_mutexattr_t = ::c_long;
15 pub type pthread_rwlockattr_t = ::c_long;
16 pub type pthread_condattr_t = ::c_long;
17 pub type fsfilcnt_t = ::c_ulong;
18 pub type fsblkcnt_t = ::c_ulong;
19 pub type nfds_t = ::c_uint;
20 pub type rlim_t = ::c_ulong;
21 pub type dev_t = ::c_ulong;
22 pub type ino_t = ::c_ulong;
23 pub type __CPU_BITTYPE = ::c_ulong;
24 pub type idtype_t = ::c_int;
25 pub type loff_t = ::c_longlong;
26
27 s! {
28 pub struct dirent {
29 pub d_ino: u64,
30 pub d_off: i64,
31 pub d_reclen: ::c_ushort,
32 pub d_type: ::c_uchar,
33 pub d_name: [::c_char; 256],
34 }
35
36 pub struct dirent64 {
37 pub d_ino: u64,
38 pub d_off: i64,
39 pub d_reclen: ::c_ushort,
40 pub d_type: ::c_uchar,
41 pub d_name: [::c_char; 256],
42 }
43
44 pub struct stack_t {
45 pub ss_sp: *mut ::c_void,
46 pub ss_flags: ::c_int,
47 pub ss_size: ::size_t
48 }
49
50 pub struct siginfo_t {
51 pub si_signo: ::c_int,
52 pub si_errno: ::c_int,
53 pub si_code: ::c_int,
54 pub _pad: [::c_int; 29],
55 _align: [usize; 0],
56 }
57
58 pub struct __fsid_t {
59 __val: [::c_int; 2],
60 }
61
62 pub struct msghdr {
63 pub msg_name: *mut ::c_void,
64 pub msg_namelen: ::socklen_t,
65 pub msg_iov: *mut ::iovec,
66 pub msg_iovlen: ::size_t,
67 pub msg_control: *mut ::c_void,
68 pub msg_controllen: ::size_t,
69 pub msg_flags: ::c_int,
70 }
71
72 pub struct cmsghdr {
73 pub cmsg_len: ::size_t,
74 pub cmsg_level: ::c_int,
75 pub cmsg_type: ::c_int,
76 }
77
78 pub struct termios {
79 pub c_iflag: ::tcflag_t,
80 pub c_oflag: ::tcflag_t,
81 pub c_cflag: ::tcflag_t,
82 pub c_lflag: ::tcflag_t,
83 pub c_line: ::cc_t,
84 pub c_cc: [::cc_t; ::NCCS],
85 }
86
87 pub struct flock {
88 pub l_type: ::c_short,
89 pub l_whence: ::c_short,
90 pub l_start: ::off_t,
91 pub l_len: ::off_t,
92 pub l_pid: ::pid_t,
93 }
94
95 pub struct cpu_set_t {
96 #[cfg(target_pointer_width = "64")]
97 __bits: [__CPU_BITTYPE; 16],
98 #[cfg(target_pointer_width = "32")]
99 __bits: [__CPU_BITTYPE; 1],
100 }
101
102 pub struct sem_t {
103 count: ::c_uint,
104 #[cfg(target_pointer_width = "64")]
105 __reserved: [::c_int; 3],
106 }
107
108 pub struct lastlog {
109 ll_time: ::time_t,
110 ll_line: [::c_char; UT_LINESIZE],
111 ll_host: [::c_char; UT_HOSTSIZE],
112 }
113
114 pub struct exit_status {
115 pub e_termination: ::c_short,
116 pub e_exit: ::c_short,
117 }
118
119 pub struct utmp {
120 pub ut_type: ::c_short,
121 pub ut_pid: ::pid_t,
122 pub ut_line: [::c_char; UT_LINESIZE],
123 pub ut_id: [::c_char; 4],
124
125 pub ut_user: [::c_char; UT_NAMESIZE],
126 pub ut_host: [::c_char; UT_HOSTSIZE],
127 pub ut_exit: exit_status,
128 pub ut_session: ::c_long,
129 pub ut_tv: ::timeval,
130
131 pub ut_addr_v6: [::int32_t; 4],
132 unused: [::c_char; 20],
133 }
134
135 pub struct statvfs {
136 pub f_bsize: ::c_ulong,
137 pub f_frsize: ::c_ulong,
138 pub f_blocks: ::fsblkcnt_t,
139 pub f_bfree: ::fsblkcnt_t,
140 pub f_bavail: ::fsblkcnt_t,
141 pub f_files: ::fsfilcnt_t,
142 pub f_ffree: ::fsfilcnt_t,
143 pub f_favail: ::fsfilcnt_t,
144 pub f_fsid: ::c_ulong,
145 pub f_flag: ::c_ulong,
146 pub f_namemax: ::c_ulong,
147 #[cfg(target_pointer_width = "64")]
148 __f_reserved: [u32; 6],
149 }
150
151 pub struct signalfd_siginfo {
152 pub ssi_signo: ::uint32_t,
153 pub ssi_errno: ::int32_t,
154 pub ssi_code: ::int32_t,
155 pub ssi_pid: ::uint32_t,
156 pub ssi_uid: ::uint32_t,
157 pub ssi_fd: ::int32_t,
158 pub ssi_tid: ::uint32_t,
159 pub ssi_band: ::uint32_t,
160 pub ssi_overrun: ::uint32_t,
161 pub ssi_trapno: ::uint32_t,
162 pub ssi_status: ::int32_t,
163 pub ssi_int: ::int32_t,
164 pub ssi_ptr: ::c_ulonglong,
165 pub ssi_utime: ::c_ulonglong,
166 pub ssi_stime: ::c_ulonglong,
167 pub ssi_addr: ::c_ulonglong,
168 pub ssi_addr_lsb: ::uint16_t,
169 _pad: [::uint8_t; 46],
170 }
171 }
172
173 pub const O_TRUNC: ::c_int = 512;
174 pub const O_CLOEXEC: ::c_int = 0x80000;
175 pub const O_PATH: ::c_int = 0o10000000;
176 pub const O_NOATIME: ::c_int = 0o1000000;
177
178 pub const EBFONT: ::c_int = 59;
179 pub const ENOSTR: ::c_int = 60;
180 pub const ENODATA: ::c_int = 61;
181 pub const ETIME: ::c_int = 62;
182 pub const ENOSR: ::c_int = 63;
183 pub const ENONET: ::c_int = 64;
184 pub const ENOPKG: ::c_int = 65;
185 pub const EREMOTE: ::c_int = 66;
186 pub const ENOLINK: ::c_int = 67;
187 pub const EADV: ::c_int = 68;
188 pub const ESRMNT: ::c_int = 69;
189 pub const ECOMM: ::c_int = 70;
190 pub const EPROTO: ::c_int = 71;
191 pub const EDOTDOT: ::c_int = 73;
192
193 pub const SA_NODEFER: ::c_int = 0x40000000;
194 pub const SA_RESETHAND: ::c_int = 0x80000000;
195 pub const SA_RESTART: ::c_int = 0x10000000;
196 pub const SA_NOCLDSTOP: ::c_int = 0x00000001;
197
198 pub const EPOLL_CLOEXEC: ::c_int = 0x80000;
199 pub const EPOLLONESHOT: ::c_int = 0x40000000;
200 pub const EPOLLRDHUP: ::c_int = 0x00002000;
201 pub const EPOLLWAKEUP: ::c_int = 0x20000000;
202
203 pub const EFD_CLOEXEC: ::c_int = 0x80000;
204
205 pub const USER_PROCESS: ::c_short = 7;
206
207 pub const BUFSIZ: ::c_uint = 1024;
208 pub const FILENAME_MAX: ::c_uint = 1024;
209 pub const FOPEN_MAX: ::c_uint = 20;
210 pub const POSIX_FADV_DONTNEED: ::c_int = 4;
211 pub const POSIX_FADV_NOREUSE: ::c_int = 5;
212 pub const L_tmpnam: ::c_uint = 1024;
213 pub const TMP_MAX: ::c_uint = 308915776;
214 pub const _PC_LINK_MAX: ::c_int = 1;
215 pub const _PC_MAX_CANON: ::c_int = 2;
216 pub const _PC_MAX_INPUT: ::c_int = 3;
217 pub const _PC_NAME_MAX: ::c_int = 4;
218 pub const _PC_PATH_MAX: ::c_int = 5;
219 pub const _PC_PIPE_BUF: ::c_int = 6;
220 pub const _PC_2_SYMLINKS: ::c_int = 7;
221 pub const _PC_ALLOC_SIZE_MIN: ::c_int = 8;
222 pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 9;
223 pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 10;
224 pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 11;
225 pub const _PC_REC_XFER_ALIGN: ::c_int = 12;
226 pub const _PC_SYMLINK_MAX: ::c_int = 13;
227 pub const _PC_CHOWN_RESTRICTED: ::c_int = 14;
228 pub const _PC_NO_TRUNC: ::c_int = 15;
229 pub const _PC_VDISABLE: ::c_int = 16;
230 pub const _PC_ASYNC_IO: ::c_int = 17;
231 pub const _PC_PRIO_IO: ::c_int = 18;
232 pub const _PC_SYNC_IO: ::c_int = 19;
233
234 pub const FIONBIO: ::c_int = 0x5421;
235
236 pub const _SC_ARG_MAX: ::c_int = 0;
237 pub const _SC_BC_BASE_MAX: ::c_int = 1;
238 pub const _SC_BC_DIM_MAX: ::c_int = 2;
239 pub const _SC_BC_SCALE_MAX: ::c_int = 3;
240 pub const _SC_BC_STRING_MAX: ::c_int = 4;
241 pub const _SC_CHILD_MAX: ::c_int = 5;
242 pub const _SC_CLK_TCK: ::c_int = 6;
243 pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 7;
244 pub const _SC_EXPR_NEST_MAX: ::c_int = 8;
245 pub const _SC_LINE_MAX: ::c_int = 9;
246 pub const _SC_NGROUPS_MAX: ::c_int = 10;
247 pub const _SC_OPEN_MAX: ::c_int = 11;
248 pub const _SC_PASS_MAX: ::c_int = 12;
249 pub const _SC_2_C_BIND: ::c_int = 13;
250 pub const _SC_2_C_DEV: ::c_int = 14;
251 pub const _SC_2_C_VERSION: ::c_int = 15;
252 pub const _SC_2_CHAR_TERM: ::c_int = 16;
253 pub const _SC_2_FORT_DEV: ::c_int = 17;
254 pub const _SC_2_FORT_RUN: ::c_int = 18;
255 pub const _SC_2_LOCALEDEF: ::c_int = 19;
256 pub const _SC_2_SW_DEV: ::c_int = 20;
257 pub const _SC_2_UPE: ::c_int = 21;
258 pub const _SC_2_VERSION: ::c_int = 22;
259 pub const _SC_JOB_CONTROL: ::c_int = 23;
260 pub const _SC_SAVED_IDS: ::c_int = 24;
261 pub const _SC_VERSION: ::c_int = 25;
262 pub const _SC_RE_DUP_MAX: ::c_int = 26;
263 pub const _SC_STREAM_MAX: ::c_int = 27;
264 pub const _SC_TZNAME_MAX: ::c_int = 28;
265 pub const _SC_XOPEN_CRYPT: ::c_int = 29;
266 pub const _SC_XOPEN_ENH_I18N: ::c_int = 30;
267 pub const _SC_XOPEN_SHM: ::c_int = 31;
268 pub const _SC_XOPEN_VERSION: ::c_int = 32;
269 pub const _SC_XOPEN_XCU_VERSION: ::c_int = 33;
270 pub const _SC_XOPEN_REALTIME: ::c_int = 34;
271 pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 35;
272 pub const _SC_XOPEN_LEGACY: ::c_int = 36;
273 pub const _SC_ATEXIT_MAX: ::c_int = 37;
274 pub const _SC_IOV_MAX: ::c_int = 38;
275 pub const _SC_PAGESIZE: ::c_int = 39;
276 pub const _SC_PAGE_SIZE: ::c_int = 40;
277 pub const _SC_XOPEN_UNIX: ::c_int = 41;
278 pub const _SC_XBS5_ILP32_OFF32: ::c_int = 42;
279 pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 43;
280 pub const _SC_XBS5_LP64_OFF64: ::c_int = 44;
281 pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = 45;
282 pub const _SC_AIO_LISTIO_MAX: ::c_int = 46;
283 pub const _SC_AIO_MAX: ::c_int = 47;
284 pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 48;
285 pub const _SC_DELAYTIMER_MAX: ::c_int = 49;
286 pub const _SC_MQ_OPEN_MAX: ::c_int = 50;
287 pub const _SC_MQ_PRIO_MAX: ::c_int = 51;
288 pub const _SC_RTSIG_MAX: ::c_int = 52;
289 pub const _SC_SEM_NSEMS_MAX: ::c_int = 53;
290 pub const _SC_SEM_VALUE_MAX: ::c_int = 54;
291 pub const _SC_SIGQUEUE_MAX: ::c_int = 55;
292 pub const _SC_TIMER_MAX: ::c_int = 56;
293 pub const _SC_ASYNCHRONOUS_IO: ::c_int = 57;
294 pub const _SC_FSYNC: ::c_int = 58;
295 pub const _SC_MAPPED_FILES: ::c_int = 59;
296 pub const _SC_MEMLOCK: ::c_int = 60;
297 pub const _SC_MEMLOCK_RANGE: ::c_int = 61;
298 pub const _SC_MEMORY_PROTECTION: ::c_int = 62;
299 pub const _SC_MESSAGE_PASSING: ::c_int = 63;
300 pub const _SC_PRIORITIZED_IO: ::c_int = 64;
301 pub const _SC_PRIORITY_SCHEDULING: ::c_int = 65;
302 pub const _SC_REALTIME_SIGNALS: ::c_int = 66;
303 pub const _SC_SEMAPHORES: ::c_int = 67;
304 pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 68;
305 pub const _SC_SYNCHRONIZED_IO: ::c_int = 69;
306 pub const _SC_TIMERS: ::c_int = 70;
307 pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 71;
308 pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 72;
309 pub const _SC_LOGIN_NAME_MAX: ::c_int = 73;
310 pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 74;
311 pub const _SC_THREAD_KEYS_MAX: ::c_int = 75;
312 pub const _SC_THREAD_STACK_MIN: ::c_int = 76;
313 pub const _SC_THREAD_THREADS_MAX: ::c_int = 77;
314 pub const _SC_TTY_NAME_MAX: ::c_int = 78;
315 pub const _SC_THREADS: ::c_int = 79;
316 pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 80;
317 pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 81;
318 pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 82;
319 pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 83;
320 pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 84;
321 pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 85;
322 pub const _SC_NPROCESSORS_CONF: ::c_int = 96;
323 pub const _SC_NPROCESSORS_ONLN: ::c_int = 97;
324 pub const _SC_PHYS_PAGES: ::c_int = 98;
325 pub const _SC_AVPHYS_PAGES: ::c_int = 99;
326 pub const _SC_MONOTONIC_CLOCK: ::c_int = 100;
327
328 pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
329 pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1;
330 pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2;
331 pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;
332
333 pub const FIOCLEX: ::c_int = 0x5451;
334
335 pub const SA_ONSTACK: ::c_ulong = 0x08000000;
336 pub const SA_SIGINFO: ::c_ulong = 0x00000004;
337 pub const SA_NOCLDWAIT: ::c_ulong = 0x00000002;
338 pub const SIGCHLD: ::c_int = 17;
339 pub const SIGBUS: ::c_int = 7;
340 pub const SIGUSR1: ::c_int = 10;
341 pub const SIGUSR2: ::c_int = 12;
342 pub const SIGCONT: ::c_int = 18;
343 pub const SIGSTOP: ::c_int = 19;
344 pub const SIGTSTP: ::c_int = 20;
345 pub const SIGURG: ::c_int = 23;
346 pub const SIGIO: ::c_int = 29;
347 pub const SIGSYS: ::c_int = 31;
348 pub const SIGSTKFLT: ::c_int = 16;
349 pub const SIGUNUSED: ::c_int = 31;
350 pub const SIGTTIN: ::c_int = 21;
351 pub const SIGTTOU: ::c_int = 22;
352 pub const SIGXCPU: ::c_int = 24;
353 pub const SIGXFSZ: ::c_int = 25;
354 pub const SIGVTALRM: ::c_int = 26;
355 pub const SIGPROF: ::c_int = 27;
356 pub const SIGWINCH: ::c_int = 28;
357 pub const SIGPOLL: ::c_int = 29;
358 pub const SIGPWR: ::c_int = 30;
359 pub const SIG_SETMASK: ::c_int = 2;
360 pub const SIG_BLOCK: ::c_int = 0x000000;
361 pub const SIG_UNBLOCK: ::c_int = 0x01;
362
363 pub const RUSAGE_CHILDREN: ::c_int = -1;
364
365 pub const LC_PAPER: ::c_int = 7;
366 pub const LC_NAME: ::c_int = 8;
367 pub const LC_ADDRESS: ::c_int = 9;
368 pub const LC_TELEPHONE: ::c_int = 10;
369 pub const LC_MEASUREMENT: ::c_int = 11;
370 pub const LC_IDENTIFICATION: ::c_int = 12;
371 pub const LC_PAPER_MASK: ::c_int = (1 << LC_PAPER);
372 pub const LC_NAME_MASK: ::c_int = (1 << LC_NAME);
373 pub const LC_ADDRESS_MASK: ::c_int = (1 << LC_ADDRESS);
374 pub const LC_TELEPHONE_MASK: ::c_int = (1 << LC_TELEPHONE);
375 pub const LC_MEASUREMENT_MASK: ::c_int = (1 << LC_MEASUREMENT);
376 pub const LC_IDENTIFICATION_MASK: ::c_int = (1 << LC_IDENTIFICATION);
377 pub const LC_ALL_MASK: ::c_int = ::LC_CTYPE_MASK
378 | ::LC_NUMERIC_MASK
379 | ::LC_TIME_MASK
380 | ::LC_COLLATE_MASK
381 | ::LC_MONETARY_MASK
382 | ::LC_MESSAGES_MASK
383 | LC_PAPER_MASK
384 | LC_NAME_MASK
385 | LC_ADDRESS_MASK
386 | LC_TELEPHONE_MASK
387 | LC_MEASUREMENT_MASK
388 | LC_IDENTIFICATION_MASK;
389
390 pub const MAP_ANON: ::c_int = 0x0020;
391 pub const MAP_ANONYMOUS: ::c_int = 0x0020;
392 pub const MAP_GROWSDOWN: ::c_int = 0x0100;
393 pub const MAP_DENYWRITE: ::c_int = 0x0800;
394 pub const MAP_EXECUTABLE: ::c_int = 0x01000;
395 pub const MAP_LOCKED: ::c_int = 0x02000;
396 pub const MAP_NORESERVE: ::c_int = 0x04000;
397 pub const MAP_POPULATE: ::c_int = 0x08000;
398 pub const MAP_NONBLOCK: ::c_int = 0x010000;
399 pub const MAP_STACK: ::c_int = 0x020000;
400
401 pub const EDEADLK: ::c_int = 35;
402 pub const ENAMETOOLONG: ::c_int = 36;
403 pub const ENOLCK: ::c_int = 37;
404 pub const ENOSYS: ::c_int = 38;
405 pub const ENOTEMPTY: ::c_int = 39;
406 pub const ELOOP: ::c_int = 40;
407 pub const ENOMSG: ::c_int = 42;
408 pub const EIDRM: ::c_int = 43;
409 pub const ECHRNG: ::c_int = 44;
410 pub const EL2NSYNC: ::c_int = 45;
411 pub const EL3HLT: ::c_int = 46;
412 pub const EL3RST: ::c_int = 47;
413 pub const ELNRNG: ::c_int = 48;
414 pub const EUNATCH: ::c_int = 49;
415 pub const ENOCSI: ::c_int = 50;
416 pub const EL2HLT: ::c_int = 51;
417 pub const EBADE: ::c_int = 52;
418 pub const EBADR: ::c_int = 53;
419 pub const EXFULL: ::c_int = 54;
420 pub const ENOANO: ::c_int = 55;
421 pub const EBADRQC: ::c_int = 56;
422 pub const EBADSLT: ::c_int = 57;
423
424 pub const EMULTIHOP: ::c_int = 72;
425 pub const EBADMSG: ::c_int = 74;
426 pub const EOVERFLOW: ::c_int = 75;
427 pub const ENOTUNIQ: ::c_int = 76;
428 pub const EBADFD: ::c_int = 77;
429 pub const EREMCHG: ::c_int = 78;
430 pub const ELIBACC: ::c_int = 79;
431 pub const ELIBBAD: ::c_int = 80;
432 pub const ELIBSCN: ::c_int = 81;
433 pub const ELIBMAX: ::c_int = 82;
434 pub const ELIBEXEC: ::c_int = 83;
435 pub const EILSEQ: ::c_int = 84;
436 pub const ERESTART: ::c_int = 85;
437 pub const ESTRPIPE: ::c_int = 86;
438 pub const EUSERS: ::c_int = 87;
439 pub const ENOTSOCK: ::c_int = 88;
440 pub const EDESTADDRREQ: ::c_int = 89;
441 pub const EMSGSIZE: ::c_int = 90;
442 pub const EPROTOTYPE: ::c_int = 91;
443 pub const ENOPROTOOPT: ::c_int = 92;
444 pub const EPROTONOSUPPORT: ::c_int = 93;
445 pub const ESOCKTNOSUPPORT: ::c_int = 94;
446 pub const EOPNOTSUPP: ::c_int = 95;
447 pub const ENOTSUP: ::c_int = EOPNOTSUPP;
448 pub const EPFNOSUPPORT: ::c_int = 96;
449 pub const EAFNOSUPPORT: ::c_int = 97;
450 pub const EADDRINUSE: ::c_int = 98;
451 pub const EADDRNOTAVAIL: ::c_int = 99;
452 pub const ENETDOWN: ::c_int = 100;
453 pub const ENETUNREACH: ::c_int = 101;
454 pub const ENETRESET: ::c_int = 102;
455 pub const ECONNABORTED: ::c_int = 103;
456 pub const ECONNRESET: ::c_int = 104;
457 pub const ENOBUFS: ::c_int = 105;
458 pub const EISCONN: ::c_int = 106;
459 pub const ENOTCONN: ::c_int = 107;
460 pub const ESHUTDOWN: ::c_int = 108;
461 pub const ETOOMANYREFS: ::c_int = 109;
462 pub const ETIMEDOUT: ::c_int = 110;
463 pub const ECONNREFUSED: ::c_int = 111;
464 pub const EHOSTDOWN: ::c_int = 112;
465 pub const EHOSTUNREACH: ::c_int = 113;
466 pub const EALREADY: ::c_int = 114;
467 pub const EINPROGRESS: ::c_int = 115;
468 pub const ESTALE: ::c_int = 116;
469 pub const EUCLEAN: ::c_int = 117;
470 pub const ENOTNAM: ::c_int = 118;
471 pub const ENAVAIL: ::c_int = 119;
472 pub const EISNAM: ::c_int = 120;
473 pub const EREMOTEIO: ::c_int = 121;
474 pub const EDQUOT: ::c_int = 122;
475 pub const ENOMEDIUM: ::c_int = 123;
476 pub const EMEDIUMTYPE: ::c_int = 124;
477 pub const ECANCELED: ::c_int = 125;
478 pub const ENOKEY: ::c_int = 126;
479 pub const EKEYEXPIRED: ::c_int = 127;
480 pub const EKEYREVOKED: ::c_int = 128;
481 pub const EKEYREJECTED: ::c_int = 129;
482 pub const EOWNERDEAD: ::c_int = 130;
483 pub const ENOTRECOVERABLE: ::c_int = 131;
484
485 pub const SOCK_STREAM: ::c_int = 1;
486 pub const SOCK_DGRAM: ::c_int = 2;
487 pub const SOCK_SEQPACKET: ::c_int = 5;
488
489 pub const SOL_SOCKET: ::c_int = 1;
490 pub const SOL_SCTP: ::c_int = 132;
491 pub const SOL_IPX: ::c_int = 256;
492 pub const SOL_AX25: ::c_int = 257;
493 pub const SOL_ATALK: ::c_int = 258;
494 pub const SOL_NETROM: ::c_int = 259;
495 pub const SOL_ROSE: ::c_int = 260;
496
497 #[doc(hidden)]
498 pub const AF_MAX: ::c_int = 43;
499 #[doc(hidden)]
500 pub const PF_MAX: ::c_int = AF_MAX;
501
502 pub const SO_REUSEADDR: ::c_int = 2;
503 pub const SO_TYPE: ::c_int = 3;
504 pub const SO_ERROR: ::c_int = 4;
505 pub const SO_DONTROUTE: ::c_int = 5;
506 pub const SO_BROADCAST: ::c_int = 6;
507 pub const SO_SNDBUF: ::c_int = 7;
508 pub const SO_RCVBUF: ::c_int = 8;
509 pub const SO_KEEPALIVE: ::c_int = 9;
510 pub const SO_OOBINLINE: ::c_int = 10;
511 pub const SO_PRIORITY: ::c_int = 12;
512 pub const SO_LINGER: ::c_int = 13;
513 pub const SO_BSDCOMPAT: ::c_int = 14;
514 pub const SO_REUSEPORT: ::c_int = 15;
515 pub const SO_PASSCRED: ::c_int = 16;
516 pub const SO_PEERCRED: ::c_int = 17;
517 pub const SO_RCVLOWAT: ::c_int = 18;
518 pub const SO_SNDLOWAT: ::c_int = 19;
519 pub const SO_RCVTIMEO: ::c_int = 20;
520 pub const SO_SNDTIMEO: ::c_int = 21;
521 pub const SO_BINDTODEVICE: ::c_int = 25;
522 pub const SO_TIMESTAMP: ::c_int = 29;
523 pub const SO_ACCEPTCONN: ::c_int = 30;
524 pub const SO_SNDBUFFORCE: ::c_int = 32;
525 pub const SO_RCVBUFFORCE: ::c_int = 33;
526 pub const SO_MARK: ::c_int = 36;
527 pub const SO_PROTOCOL: ::c_int = 38;
528 pub const SO_DOMAIN: ::c_int = 39;
529 pub const SO_RXQ_OVFL: ::c_int = 40;
530 pub const SO_PEEK_OFF: ::c_int = 42;
531 pub const SO_BUSY_POLL: ::c_int = 46;
532
533 pub const O_ACCMODE: ::c_int = 3;
534 pub const O_APPEND: ::c_int = 1024;
535 pub const O_CREAT: ::c_int = 64;
536 pub const O_EXCL: ::c_int = 128;
537 pub const O_NOCTTY: ::c_int = 256;
538 pub const O_NONBLOCK: ::c_int = 2048;
539 pub const O_SYNC: ::c_int = 0x101000;
540 pub const O_ASYNC: ::c_int = 0x2000;
541 pub const O_NDELAY: ::c_int = 0x800;
542 pub const O_DSYNC: ::c_int = 4096;
543
544 pub const NI_MAXHOST: ::size_t = 1025;
545
546 pub const NCCS: usize = 19;
547 pub const TCSBRKP: ::c_int = 0x5425;
548 pub const TCSANOW: ::c_int = 0;
549 pub const TCSADRAIN: ::c_int = 0x1;
550 pub const TCSAFLUSH: ::c_int = 0x2;
551 pub const VEOF: usize = 4;
552 pub const VEOL: usize = 11;
553 pub const VEOL2: usize = 16;
554 pub const VMIN: usize = 6;
555 pub const IEXTEN: ::tcflag_t = 0x00008000;
556 pub const TOSTOP: ::tcflag_t = 0x00000100;
557 pub const FLUSHO: ::tcflag_t = 0x00001000;
558 pub const EXTPROC: ::tcflag_t = 0o200000;
559
560 pub const ADFS_SUPER_MAGIC: ::c_long = 0x0000adf5;
561 pub const AFFS_SUPER_MAGIC: ::c_long = 0x0000adff;
562 pub const CODA_SUPER_MAGIC: ::c_long = 0x73757245;
563 pub const CRAMFS_MAGIC: ::c_long = 0x28cd3d45;
564 pub const EFS_SUPER_MAGIC: ::c_long = 0x00414a53;
565 pub const EXT2_SUPER_MAGIC: ::c_long = 0x0000ef53;
566 pub const EXT3_SUPER_MAGIC: ::c_long = 0x0000ef53;
567 pub const EXT4_SUPER_MAGIC: ::c_long = 0x0000ef53;
568 pub const HPFS_SUPER_MAGIC: ::c_long = 0xf995e849;
569 pub const HUGETLBFS_MAGIC: ::c_long = 0x958458f6;
570 pub const ISOFS_SUPER_MAGIC: ::c_long = 0x00009660;
571 pub const JFFS2_SUPER_MAGIC: ::c_long = 0x000072b6;
572 pub const MINIX_SUPER_MAGIC: ::c_long = 0x0000137f;
573 pub const MINIX_SUPER_MAGIC2: ::c_long = 0x0000138f;
574 pub const MINIX2_SUPER_MAGIC: ::c_long = 0x00002468;
575 pub const MINIX2_SUPER_MAGIC2: ::c_long = 0x00002478;
576 pub const MSDOS_SUPER_MAGIC: ::c_long = 0x00004d44;
577 pub const NCP_SUPER_MAGIC: ::c_long = 0x0000564c;
578 pub const NFS_SUPER_MAGIC: ::c_long = 0x00006969;
579 pub const OPENPROM_SUPER_MAGIC: ::c_long = 0x00009fa1;
580 pub const PROC_SUPER_MAGIC: ::c_long = 0x00009fa0;
581 pub const QNX4_SUPER_MAGIC: ::c_long = 0x0000002f;
582 pub const REISERFS_SUPER_MAGIC: ::c_long = 0x52654973;
583 pub const SMB_SUPER_MAGIC: ::c_long = 0x0000517b;
584 pub const TMPFS_MAGIC: ::c_long = 0x01021994;
585 pub const USBDEVICE_SUPER_MAGIC: ::c_long = 0x00009fa2;
586
587 pub const MAP_HUGETLB: ::c_int = 0x040000;
588
589 pub const PTRACE_TRACEME: ::c_int = 0;
590 pub const PTRACE_PEEKTEXT: ::c_int = 1;
591 pub const PTRACE_PEEKDATA: ::c_int = 2;
592 pub const PTRACE_PEEKUSER: ::c_int = 3;
593 pub const PTRACE_POKETEXT: ::c_int = 4;
594 pub const PTRACE_POKEDATA: ::c_int = 5;
595 pub const PTRACE_POKEUSER: ::c_int = 6;
596 pub const PTRACE_CONT: ::c_int = 7;
597 pub const PTRACE_KILL: ::c_int = 8;
598 pub const PTRACE_SINGLESTEP: ::c_int = 9;
599 pub const PTRACE_ATTACH: ::c_int = 16;
600 pub const PTRACE_DETACH: ::c_int = 17;
601 pub const PTRACE_SYSCALL: ::c_int = 24;
602 pub const PTRACE_SETOPTIONS: ::c_int = 0x4200;
603 pub const PTRACE_GETEVENTMSG: ::c_int = 0x4201;
604 pub const PTRACE_GETSIGINFO: ::c_int = 0x4202;
605 pub const PTRACE_SETSIGINFO: ::c_int = 0x4203;
606
607 pub const EFD_NONBLOCK: ::c_int = 0x800;
608
609 pub const F_GETLK: ::c_int = 5;
610 pub const F_GETOWN: ::c_int = 9;
611 pub const F_SETOWN: ::c_int = 8;
612 pub const F_SETLK: ::c_int = 6;
613 pub const F_SETLKW: ::c_int = 7;
614
615 pub const TCGETS: ::c_int = 0x5401;
616 pub const TCSETS: ::c_int = 0x5402;
617 pub const TCSETSW: ::c_int = 0x5403;
618 pub const TCSETSF: ::c_int = 0x5404;
619 pub const TCGETA: ::c_int = 0x5405;
620 pub const TCSETA: ::c_int = 0x5406;
621 pub const TCSETAW: ::c_int = 0x5407;
622 pub const TCSETAF: ::c_int = 0x5408;
623 pub const TCSBRK: ::c_int = 0x5409;
624 pub const TCXONC: ::c_int = 0x540A;
625 pub const TCFLSH: ::c_int = 0x540B;
626 pub const TIOCGSOFTCAR: ::c_int = 0x5419;
627 pub const TIOCSSOFTCAR: ::c_int = 0x541A;
628 pub const TIOCINQ: ::c_int = 0x541B;
629 pub const TIOCLINUX: ::c_int = 0x541C;
630 pub const TIOCGSERIAL: ::c_int = 0x541E;
631 pub const TIOCEXCL: ::c_int = 0x540C;
632 pub const TIOCNXCL: ::c_int = 0x540D;
633 pub const TIOCSCTTY: ::c_int = 0x540E;
634 pub const TIOCGPGRP: ::c_int = 0x540F;
635 pub const TIOCSPGRP: ::c_int = 0x5410;
636 pub const TIOCOUTQ: ::c_int = 0x5411;
637 pub const TIOCSTI: ::c_int = 0x5412;
638 pub const TIOCGWINSZ: ::c_int = 0x5413;
639 pub const TIOCSWINSZ: ::c_int = 0x5414;
640 pub const TIOCMGET: ::c_int = 0x5415;
641 pub const TIOCMBIS: ::c_int = 0x5416;
642 pub const TIOCMBIC: ::c_int = 0x5417;
643 pub const TIOCMSET: ::c_int = 0x5418;
644 pub const FIONREAD: ::c_int = 0x541B;
645 pub const TIOCCONS: ::c_int = 0x541D;
646
647 pub const RTLD_NOLOAD: ::c_int = 0x4;
648
649 pub const SEM_FAILED: *mut sem_t = 0 as *mut sem_t;
650
651 pub const LINUX_REBOOT_MAGIC1: ::c_int = 0xfee1dead;
652 pub const LINUX_REBOOT_MAGIC2: ::c_int = 672274793;
653 pub const LINUX_REBOOT_MAGIC2A: ::c_int = 85072278;
654 pub const LINUX_REBOOT_MAGIC2B: ::c_int = 369367448;
655 pub const LINUX_REBOOT_MAGIC2C: ::c_int = 537993216;
656
657 pub const LINUX_REBOOT_CMD_RESTART: ::c_int = 0x01234567;
658 pub const LINUX_REBOOT_CMD_HALT: ::c_int = 0xCDEF0123;
659 pub const LINUX_REBOOT_CMD_CAD_ON: ::c_int = 0x89ABCDEF;
660 pub const LINUX_REBOOT_CMD_CAD_OFF: ::c_int = 0x00000000;
661 pub const LINUX_REBOOT_CMD_POWER_OFF: ::c_int = 0x4321FEDC;
662 pub const LINUX_REBOOT_CMD_RESTART2: ::c_int = 0xA1B2C3D4;
663 pub const LINUX_REBOOT_CMD_SW_SUSPEND: ::c_int = 0xD000FCE2;
664 pub const LINUX_REBOOT_CMD_KEXEC: ::c_int = 0x45584543;
665
666 pub const MCL_CURRENT: ::c_int = 0x0001;
667 pub const MCL_FUTURE: ::c_int = 0x0002;
668
669 pub const CBAUD: ::tcflag_t = 0o0010017;
670 pub const TAB1: ::c_int = 0x00000800;
671 pub const TAB2: ::c_int = 0x00001000;
672 pub const TAB3: ::c_int = 0x00001800;
673 pub const CR1: ::c_int = 0x00000200;
674 pub const CR2: ::c_int = 0x00000400;
675 pub const CR3: ::c_int = 0x00000600;
676 pub const FF1: ::c_int = 0x00008000;
677 pub const BS1: ::c_int = 0x00002000;
678 pub const VT1: ::c_int = 0x00004000;
679 pub const VWERASE: usize = 14;
680 pub const VREPRINT: usize = 12;
681 pub const VSUSP: usize = 10;
682 pub const VSTART: usize = 8;
683 pub const VSTOP: usize = 9;
684 pub const VDISCARD: usize = 13;
685 pub const VTIME: usize = 5;
686 pub const IXON: ::tcflag_t = 0x00000400;
687 pub const IXOFF: ::tcflag_t = 0x00001000;
688 pub const ONLCR: ::tcflag_t = 0x4;
689 pub const CSIZE: ::tcflag_t = 0x00000030;
690 pub const CS6: ::tcflag_t = 0x00000010;
691 pub const CS7: ::tcflag_t = 0x00000020;
692 pub const CS8: ::tcflag_t = 0x00000030;
693 pub const CSTOPB: ::tcflag_t = 0x00000040;
694 pub const CREAD: ::tcflag_t = 0x00000080;
695 pub const PARENB: ::tcflag_t = 0x00000100;
696 pub const PARODD: ::tcflag_t = 0x00000200;
697 pub const HUPCL: ::tcflag_t = 0x00000400;
698 pub const CLOCAL: ::tcflag_t = 0x00000800;
699 pub const ECHOKE: ::tcflag_t = 0x00000800;
700 pub const ECHOE: ::tcflag_t = 0x00000010;
701 pub const ECHOK: ::tcflag_t = 0x00000020;
702 pub const ECHONL: ::tcflag_t = 0x00000040;
703 pub const ECHOPRT: ::tcflag_t = 0x00000400;
704 pub const ECHOCTL: ::tcflag_t = 0x00000200;
705 pub const ISIG: ::tcflag_t = 0x00000001;
706 pub const ICANON: ::tcflag_t = 0x00000002;
707 pub const PENDIN: ::tcflag_t = 0x00004000;
708 pub const NOFLSH: ::tcflag_t = 0x00000080;
709 pub const VSWTC: usize = 7;
710 pub const OLCUC: ::tcflag_t = 0o000002;
711 pub const NLDLY: ::tcflag_t = 0o000400;
712 pub const CRDLY: ::tcflag_t = 0o003000;
713 pub const TABDLY: ::tcflag_t = 0o014000;
714 pub const BSDLY: ::tcflag_t = 0o020000;
715 pub const FFDLY: ::tcflag_t = 0o100000;
716 pub const VTDLY: ::tcflag_t = 0o040000;
717 pub const XTABS: ::tcflag_t = 0o014000;
718
719 pub const B0: ::speed_t = 0o000000;
720 pub const B50: ::speed_t = 0o000001;
721 pub const B75: ::speed_t = 0o000002;
722 pub const B110: ::speed_t = 0o000003;
723 pub const B134: ::speed_t = 0o000004;
724 pub const B150: ::speed_t = 0o000005;
725 pub const B200: ::speed_t = 0o000006;
726 pub const B300: ::speed_t = 0o000007;
727 pub const B600: ::speed_t = 0o000010;
728 pub const B1200: ::speed_t = 0o000011;
729 pub const B1800: ::speed_t = 0o000012;
730 pub const B2400: ::speed_t = 0o000013;
731 pub const B4800: ::speed_t = 0o000014;
732 pub const B9600: ::speed_t = 0o000015;
733 pub const B19200: ::speed_t = 0o000016;
734 pub const B38400: ::speed_t = 0o000017;
735 pub const EXTA: ::speed_t = B19200;
736 pub const EXTB: ::speed_t = B38400;
737 pub const B57600: ::speed_t = 0o010001;
738 pub const B115200: ::speed_t = 0o010002;
739 pub const B230400: ::speed_t = 0o010003;
740 pub const B460800: ::speed_t = 0o010004;
741 pub const B500000: ::speed_t = 0o010005;
742 pub const B576000: ::speed_t = 0o010006;
743 pub const B921600: ::speed_t = 0o010007;
744 pub const B1000000: ::speed_t = 0o010010;
745 pub const B1152000: ::speed_t = 0o010011;
746 pub const B1500000: ::speed_t = 0o010012;
747 pub const B2000000: ::speed_t = 0o010013;
748 pub const B2500000: ::speed_t = 0o010014;
749 pub const B3000000: ::speed_t = 0o010015;
750 pub const B3500000: ::speed_t = 0o010016;
751 pub const B4000000: ::speed_t = 0o010017;
752
753 pub const EAI_SYSTEM: ::c_int = 11;
754
755 pub const NETLINK_ROUTE: ::c_int = 0;
756 pub const NETLINK_UNUSED: ::c_int = 1;
757 pub const NETLINK_USERSOCK: ::c_int = 2;
758 pub const NETLINK_FIREWALL: ::c_int = 3;
759 pub const NETLINK_SOCK_DIAG: ::c_int = 4;
760 pub const NETLINK_NFLOG: ::c_int = 5;
761 pub const NETLINK_XFRM: ::c_int = 6;
762 pub const NETLINK_SELINUX: ::c_int = 7;
763 pub const NETLINK_ISCSI: ::c_int = 8;
764 pub const NETLINK_AUDIT: ::c_int = 9;
765 pub const NETLINK_FIB_LOOKUP: ::c_int = 10;
766 pub const NETLINK_CONNECTOR: ::c_int = 11;
767 pub const NETLINK_NETFILTER: ::c_int = 12;
768 pub const NETLINK_IP6_FW: ::c_int = 13;
769 pub const NETLINK_DNRTMSG: ::c_int = 14;
770 pub const NETLINK_KOBJECT_UEVENT: ::c_int = 15;
771 pub const NETLINK_GENERIC: ::c_int = 16;
772 pub const NETLINK_SCSITRANSPORT: ::c_int = 18;
773 pub const NETLINK_ECRYPTFS: ::c_int = 19;
774 pub const NETLINK_RDMA: ::c_int = 20;
775 pub const NETLINK_CRYPTO: ::c_int = 21;
776 pub const NETLINK_INET_DIAG: ::c_int = NETLINK_SOCK_DIAG;
777
778 pub const MAX_LINKS: ::c_int = 32;
779
780 pub const NLM_F_REQUEST: ::c_int = 1;
781 pub const NLM_F_MULTI: ::c_int = 2;
782 pub const NLM_F_ACK: ::c_int = 4;
783 pub const NLM_F_ECHO: ::c_int = 8;
784 pub const NLM_F_DUMP_INTR: ::c_int = 16;
785
786 pub const NLM_F_ROOT: ::c_int = 0x100;
787 pub const NLM_F_MATCH: ::c_int = 0x200;
788 pub const NLM_F_ATOMIC: ::c_int = 0x400;
789 pub const NLM_F_DUMP: ::c_int = NLM_F_ROOT | NLM_F_MATCH;
790
791 pub const NLM_F_REPLACE: ::c_int = 0x100;
792 pub const NLM_F_EXCL: ::c_int = 0x200;
793 pub const NLM_F_CREATE: ::c_int = 0x400;
794 pub const NLM_F_APPEND: ::c_int = 0x800;
795
796 pub const NLMSG_NOOP: ::c_int = 0x1;
797 pub const NLMSG_ERROR: ::c_int = 0x2;
798 pub const NLMSG_DONE: ::c_int = 0x3;
799 pub const NLMSG_OVERRUN: ::c_int = 0x4;
800 pub const NLMSG_MIN_TYPE: ::c_int = 0x10;
801
802 pub const NETLINK_ADD_MEMBERSHIP: ::c_int = 1;
803 pub const NETLINK_DROP_MEMBERSHIP: ::c_int = 2;
804 pub const NETLINK_PKTINFO: ::c_int = 3;
805 pub const NETLINK_BROADCAST_ERROR: ::c_int = 4;
806 pub const NETLINK_NO_ENOBUFS: ::c_int = 5;
807 pub const NETLINK_RX_RING: ::c_int = 6;
808 pub const NETLINK_TX_RING: ::c_int = 7;
809
810 pub const NLA_F_NESTED: ::c_int = 1 << 15;
811 pub const NLA_F_NET_BYTEORDER: ::c_int = 1 << 14;
812 pub const NLA_TYPE_MASK: ::c_int = !(NLA_F_NESTED | NLA_F_NET_BYTEORDER);
813
814 pub const SIGEV_THREAD_ID: ::c_int = 4;
815
816 pub const CIBAUD: ::tcflag_t = 0o02003600000;
817 pub const CBAUDEX: ::tcflag_t = 0o010000;
818
819 pub const TIOCM_LE: ::c_int = 0x001;
820 pub const TIOCM_DTR: ::c_int = 0x002;
821 pub const TIOCM_RTS: ::c_int = 0x004;
822 pub const TIOCM_ST: ::c_int = 0x008;
823 pub const TIOCM_SR: ::c_int = 0x010;
824 pub const TIOCM_CTS: ::c_int = 0x020;
825 pub const TIOCM_CAR: ::c_int = 0x040;
826 pub const TIOCM_RNG: ::c_int = 0x080;
827 pub const TIOCM_DSR: ::c_int = 0x100;
828 pub const TIOCM_CD: ::c_int = TIOCM_CAR;
829 pub const TIOCM_RI: ::c_int = TIOCM_RNG;
830
831 pub const POLLWRNORM: ::c_short = 0x100;
832 pub const POLLWRBAND: ::c_short = 0x200;
833
834 pub const SFD_CLOEXEC: ::c_int = O_CLOEXEC;
835 pub const SFD_NONBLOCK: ::c_int = O_NONBLOCK;
836
837 pub const SOCK_NONBLOCK: ::c_int = O_NONBLOCK;
838
839 pub const SO_ORIGINAL_DST: ::c_int = 80;
840 pub const IUTF8: ::tcflag_t = 0x00004000;
841 pub const CMSPAR: ::tcflag_t = 0o10000000000;
842 pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
843
844 f! {
845 pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
846 for slot in cpuset.__bits.iter_mut() {
847 *slot = 0;
848 }
849 }
850
851 pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () {
852 let size_in___bits = 8 * mem::size_of_val(&cpuset.__bits[0]);
853 let (idx, offset) = (cpu / size_in___bits, cpu % size_in___bits);
854 cpuset.__bits[idx] |= 1 << offset;
855 ()
856 }
857
858 pub fn CPU_CLR(cpu: usize, cpuset: &mut cpu_set_t) -> () {
859 let size_in___bits = 8 * mem::size_of_val(&cpuset.__bits[0]);
860 let (idx, offset) = (cpu / size_in___bits, cpu % size_in___bits);
861 cpuset.__bits[idx] &= !(1 << offset);
862 ()
863 }
864
865 pub fn CPU_ISSET(cpu: usize, cpuset: &cpu_set_t) -> bool {
866 let size_in___bits = 8 * mem::size_of_val(&cpuset.__bits[0]);
867 let (idx, offset) = (cpu / size_in___bits, cpu % size_in___bits);
868 0 != (cpuset.__bits[idx] & (1 << offset))
869 }
870
871 pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool {
872 set1.__bits == set2.__bits
873 }
874 pub fn major(dev: ::dev_t) -> ::c_int {
875 ((dev >> 8) & 0xfff) as ::c_int
876 }
877 pub fn minor(dev: ::dev_t) -> ::c_int {
878 ((dev & 0xff) | ((dev >> 12) & 0xfff00)) as ::c_int
879 }
880 pub fn makedev(ma: ::c_int, mi: ::c_int) -> ::dev_t {
881 let ma = ma as ::dev_t;
882 let mi = mi as ::dev_t;
883 ((ma & 0xfff) << 8) | (mi & 0xff) | ((mi & 0xfff00) << 12)
884 }
885 }
886
887 extern {
888 static mut __progname: *mut ::c_char;
889 }
890
891 extern {
892 pub fn madvise(addr: *const ::c_void, len: ::size_t, advice: ::c_int)
893 -> ::c_int;
894 pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
895 pub fn msync(addr: *const ::c_void, len: ::size_t,
896 flags: ::c_int) -> ::c_int;
897 pub fn mprotect(addr: *const ::c_void, len: ::size_t, prot: ::c_int)
898 -> ::c_int;
899 pub fn recvfrom(socket: ::c_int, buf: *mut ::c_void, len: ::size_t,
900 flags: ::c_int, addr: *const ::sockaddr,
901 addrlen: *mut ::socklen_t) -> ::ssize_t;
902 pub fn getnameinfo(sa: *const ::sockaddr,
903 salen: ::socklen_t,
904 host: *mut ::c_char,
905 hostlen: ::size_t,
906 serv: *mut ::c_char,
907 sevlen: ::size_t,
908 flags: ::c_int) -> ::c_int;
909 pub fn ptrace(request: ::c_int, ...) -> ::c_long;
910 pub fn getpriority(which: ::c_int, who: ::c_int) -> ::c_int;
911 pub fn setpriority(which: ::c_int, who: ::c_int, prio: ::c_int) -> ::c_int;
912 pub fn __sched_cpualloc(count: ::size_t) -> *mut ::cpu_set_t;
913 pub fn __sched_cpufree(set: *mut ::cpu_set_t);
914 pub fn __sched_cpucount(setsize: ::size_t, set: *mut cpu_set_t) -> ::c_int;
915 pub fn sched_getcpu() -> ::c_int;
916
917 pub fn utmpname(name: *const ::c_char) -> ::c_int;
918 pub fn setutent();
919 pub fn getutent() -> *mut utmp;
920
921 pub fn posix_fallocate(fd: ::c_int, offset: ::off_t,
922 len: ::off_t) -> ::c_int;
923 pub fn signalfd(fd: ::c_int, mask: *const ::sigset_t, flags: ::c_int)
924 -> ::c_int;
925 pub fn syscall(num: ::c_long, ...) -> ::c_long;
926 pub fn sched_getaffinity(pid: ::pid_t,
927 cpusetsize: ::size_t,
928 cpuset: *mut cpu_set_t) -> ::c_int;
929 pub fn sched_setaffinity(pid: ::pid_t,
930 cpusetsize: ::size_t,
931 cpuset: *const cpu_set_t) -> ::c_int;
932 pub fn epoll_create(size: ::c_int) -> ::c_int;
933 pub fn epoll_create1(flags: ::c_int) -> ::c_int;
934 pub fn epoll_wait(epfd: ::c_int,
935 events: *mut ::epoll_event,
936 maxevents: ::c_int,
937 timeout: ::c_int) -> ::c_int;
938 pub fn epoll_ctl(epfd: ::c_int,
939 op: ::c_int,
940 fd: ::c_int,
941 event: *mut ::epoll_event) -> ::c_int;
942 pub fn pthread_getschedparam(native: ::pthread_t,
943 policy: *mut ::c_int,
944 param: *mut ::sched_param) -> ::c_int;
945 pub fn unshare(flags: ::c_int) -> ::c_int;
946 pub fn umount(target: *const ::c_char) -> ::c_int;
947 pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int;
948 pub fn tee(fd_in: ::c_int,
949 fd_out: ::c_int,
950 len: ::size_t,
951 flags: ::c_uint) -> ::ssize_t;
952 pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int;
953 pub fn splice(fd_in: ::c_int,
954 off_in: *mut ::loff_t,
955 fd_out: ::c_int,
956 off_out: *mut ::loff_t,
957 len: ::size_t,
958 flags: ::c_uint) -> ::ssize_t;
959 pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int;
960 pub fn sched_rr_get_interval(pid: ::pid_t, tp: *mut ::timespec) -> ::c_int;
961 pub fn sem_timedwait(sem: *mut sem_t,
962 abstime: *const ::timespec) -> ::c_int;
963 pub fn sched_setparam(pid: ::pid_t, param: *const ::sched_param) -> ::c_int;
964 pub fn setns(fd: ::c_int, nstype: ::c_int) -> ::c_int;
965 pub fn swapoff(puath: *const ::c_char) -> ::c_int;
966 pub fn vmsplice(fd: ::c_int,
967 iov: *const ::iovec,
968 nr_segs: ::size_t,
969 flags: ::c_uint) -> ::ssize_t;
970 pub fn mount(src: *const ::c_char,
971 target: *const ::c_char,
972 fstype: *const ::c_char,
973 flags: ::c_ulong,
974 data: *const ::c_void) -> ::c_int;
975 pub fn personality(persona: ::c_ulong) -> ::c_int;
976 pub fn prctl(option: ::c_int, ...) -> ::c_int;
977 pub fn sched_getparam(pid: ::pid_t, param: *mut ::sched_param) -> ::c_int;
978 pub fn ppoll(fds: *mut ::pollfd,
979 nfds: nfds_t,
980 timeout: *const ::timespec,
981 sigmask: *const sigset_t) -> ::c_int;
982 pub fn pthread_mutex_timedlock(lock: *mut pthread_mutex_t,
983 abstime: *const ::timespec) -> ::c_int;
984 pub fn clone(cb: extern fn(*mut ::c_void) -> ::c_int,
985 child_stack: *mut ::c_void,
986 flags: ::c_int,
987 arg: *mut ::c_void, ...) -> ::c_int;
988 pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int;
989 pub fn clock_nanosleep(clk_id: ::clockid_t,
990 flags: ::c_int,
991 rqtp: *const ::timespec,
992 rmtp: *mut ::timespec) -> ::c_int;
993 pub fn pthread_attr_getguardsize(attr: *const ::pthread_attr_t,
994 guardsize: *mut ::size_t) -> ::c_int;
995 pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int;
996 pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int;
997 pub fn pthread_condattr_getpshared(attr: *const pthread_condattr_t,
998 pshared: *mut ::c_int) -> ::c_int;
999 pub fn sysinfo(info: *mut ::sysinfo) -> ::c_int;
1000 pub fn umount2(target: *const ::c_char, flags: ::c_int) -> ::c_int;
1001 pub fn pthread_setschedparam(native: ::pthread_t,
1002 policy: ::c_int,
1003 param: *const ::sched_param) -> ::c_int;
1004 pub fn swapon(path: *const ::c_char, swapflags: ::c_int) -> ::c_int;
1005 pub fn sched_setscheduler(pid: ::pid_t,
1006 policy: ::c_int,
1007 param: *const ::sched_param) -> ::c_int;
1008 pub fn sendfile(out_fd: ::c_int,
1009 in_fd: ::c_int,
1010 offset: *mut off_t,
1011 count: ::size_t) -> ::ssize_t;
1012 pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int;
1013 #[cfg_attr(target_os = "solaris", link_name = "__posix_getgrgid_r")]
1014 pub fn getgrgid_r(uid: ::uid_t,
1015 grp: *mut ::group,
1016 buf: *mut ::c_char,
1017 buflen: ::size_t,
1018 result: *mut *mut ::group) -> ::c_int;
1019 #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
1020 link_name = "sigaltstack$UNIX2003")]
1021 #[cfg_attr(target_os = "netbsd", link_name = "__sigaltstack14")]
1022 pub fn sigaltstack(ss: *const stack_t,
1023 oss: *mut stack_t) -> ::c_int;
1024 pub fn sem_close(sem: *mut sem_t) -> ::c_int;
1025 pub fn getdtablesize() -> ::c_int;
1026 #[cfg_attr(target_os = "solaris", link_name = "__posix_getgrnam_r")]
1027 pub fn getgrnam_r(name: *const ::c_char,
1028 grp: *mut ::group,
1029 buf: *mut ::c_char,
1030 buflen: ::size_t,
1031 result: *mut *mut ::group) -> ::c_int;
1032 #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
1033 link_name = "pthread_sigmask$UNIX2003")]
1034 pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t,
1035 oldset: *mut sigset_t) -> ::c_int;
1036 pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t;
1037 pub fn getgrnam(name: *const ::c_char) -> *mut ::group;
1038 pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int;
1039 pub fn sem_unlink(name: *const ::c_char) -> ::c_int;
1040 pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int;
1041 #[cfg_attr(target_os = "netbsd", link_name = "__getpwnam_r50")]
1042 #[cfg_attr(target_os = "solaris", link_name = "__posix_getpwnam_r")]
1043 pub fn getpwnam_r(name: *const ::c_char,
1044 pwd: *mut passwd,
1045 buf: *mut ::c_char,
1046 buflen: ::size_t,
1047 result: *mut *mut passwd) -> ::c_int;
1048 #[cfg_attr(target_os = "netbsd", link_name = "__getpwuid_r50")]
1049 #[cfg_attr(target_os = "solaris", link_name = "__posix_getpwuid_r")]
1050 pub fn getpwuid_r(uid: ::uid_t,
1051 pwd: *mut passwd,
1052 buf: *mut ::c_char,
1053 buflen: ::size_t,
1054 result: *mut *mut passwd) -> ::c_int;
1055 #[cfg_attr(all(target_os = "macos", target_arch ="x86"),
1056 link_name = "sigwait$UNIX2003")]
1057 #[cfg_attr(target_os = "solaris", link_name = "__posix_sigwait")]
1058 pub fn sigwait(set: *const sigset_t,
1059 sig: *mut ::c_int) -> ::c_int;
1060 pub fn pthread_atfork(prepare: Option<unsafe extern fn()>,
1061 parent: Option<unsafe extern fn()>,
1062 child: Option<unsafe extern fn()>) -> ::c_int;
1063 pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
1064 pub fn getgrouplist(user: *const ::c_char,
1065 group: ::gid_t,
1066 groups: *mut ::gid_t,
1067 ngroups: *mut ::c_int) -> ::c_int;
1068 pub fn initgroups(user: *const ::c_char, group: ::gid_t) -> ::c_int;
1069 pub fn pthread_mutexattr_getpshared(attr: *const pthread_mutexattr_t,
1070 pshared: *mut ::c_int) -> ::c_int;
1071 #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
1072 link_name = "popen$UNIX2003")]
1073 pub fn popen(command: *const c_char,
1074 mode: *const c_char) -> *mut ::FILE;
1075 pub fn faccessat(dirfd: ::c_int, pathname: *const ::c_char,
1076 mode: ::c_int, flags: ::c_int) -> ::c_int;
1077 pub fn pthread_create(native: *mut ::pthread_t,
1078 attr: *const ::pthread_attr_t,
1079 f: extern fn(*mut ::c_void) -> *mut ::c_void,
1080 value: *mut ::c_void) -> ::c_int;
1081 }
1082
1083 cfg_if! {
1084 if #[cfg(target_pointer_width = "32")] {
1085 mod b32;
1086 pub use self::b32::*;
1087 } else if #[cfg(target_pointer_width = "64")] {
1088 mod b64;
1089 pub use self::b64::*;
1090 } else {
1091 // Unknown target_pointer_width
1092 }
1093 }