]> git.proxmox.com Git - rustc.git/blob - src/vendor/libc/src/unix/bsd/freebsdlike/mod.rs
New upstream version 1.24.1+dfsg1
[rustc.git] / src / vendor / libc / src / unix / bsd / freebsdlike / mod.rs
1 pub type dev_t = u32;
2 pub type mode_t = u16;
3 pub type pthread_attr_t = *mut ::c_void;
4 pub type rlim_t = i64;
5 pub type pthread_mutex_t = *mut ::c_void;
6 pub type pthread_mutexattr_t = *mut ::c_void;
7 pub type pthread_cond_t = *mut ::c_void;
8 pub type pthread_condattr_t = *mut ::c_void;
9 pub type pthread_rwlock_t = *mut ::c_void;
10 pub type pthread_rwlockattr_t = *mut ::c_void;
11 pub type pthread_key_t = ::c_int;
12 pub type tcflag_t = ::c_uint;
13 pub type speed_t = ::c_uint;
14 pub type nl_item = ::c_int;
15 pub type id_t = i64;
16
17 pub enum timezone {}
18
19 s! {
20 pub struct glob_t {
21 pub gl_pathc: ::size_t,
22 pub gl_matchc: ::size_t,
23 pub gl_offs: ::size_t,
24 pub gl_flags: ::c_int,
25 pub gl_pathv: *mut *mut ::c_char,
26 __unused3: *mut ::c_void,
27 __unused4: *mut ::c_void,
28 __unused5: *mut ::c_void,
29 __unused6: *mut ::c_void,
30 __unused7: *mut ::c_void,
31 __unused8: *mut ::c_void,
32 }
33
34 pub struct kevent {
35 pub ident: ::uintptr_t,
36 pub filter: ::c_short,
37 pub flags: ::c_ushort,
38 pub fflags: ::c_uint,
39 pub data: ::intptr_t,
40 pub udata: *mut ::c_void,
41 }
42
43 pub struct sockaddr_storage {
44 pub ss_len: u8,
45 pub ss_family: ::sa_family_t,
46 __ss_pad1: [u8; 6],
47 __ss_align: i64,
48 __ss_pad2: [u8; 112],
49 }
50
51 pub struct addrinfo {
52 pub ai_flags: ::c_int,
53 pub ai_family: ::c_int,
54 pub ai_socktype: ::c_int,
55 pub ai_protocol: ::c_int,
56 pub ai_addrlen: ::socklen_t,
57 pub ai_canonname: *mut ::c_char,
58 pub ai_addr: *mut ::sockaddr,
59 pub ai_next: *mut addrinfo,
60 }
61
62 pub struct sigset_t {
63 bits: [u32; 4],
64 }
65
66 pub struct siginfo_t {
67 pub si_signo: ::c_int,
68 pub si_errno: ::c_int,
69 pub si_code: ::c_int,
70 pub si_pid: ::pid_t,
71 pub si_uid: ::uid_t,
72 pub si_status: ::c_int,
73 pub si_addr: *mut ::c_void,
74 _pad: [::c_int; 12],
75 }
76
77 pub struct sigaction {
78 pub sa_sigaction: ::sighandler_t,
79 pub sa_flags: ::c_int,
80 pub sa_mask: sigset_t,
81 }
82
83 pub struct stack_t {
84 // In FreeBSD 11 and later, ss_sp is actually a void*
85 pub ss_sp: *mut ::c_char,
86 pub ss_size: ::size_t,
87 pub ss_flags: ::c_int,
88 }
89
90 pub struct sched_param {
91 pub sched_priority: ::c_int,
92 }
93
94 pub struct Dl_info {
95 pub dli_fname: *const ::c_char,
96 pub dli_fbase: *mut ::c_void,
97 pub dli_sname: *const ::c_char,
98 pub dli_saddr: *mut ::c_void,
99 }
100
101 pub struct sockaddr_in {
102 pub sin_len: u8,
103 pub sin_family: ::sa_family_t,
104 pub sin_port: ::in_port_t,
105 pub sin_addr: ::in_addr,
106 pub sin_zero: [::c_char; 8],
107 }
108
109 pub struct termios {
110 pub c_iflag: ::tcflag_t,
111 pub c_oflag: ::tcflag_t,
112 pub c_cflag: ::tcflag_t,
113 pub c_lflag: ::tcflag_t,
114 pub c_cc: [::cc_t; ::NCCS],
115 pub c_ispeed: ::speed_t,
116 pub c_ospeed: ::speed_t,
117 }
118
119 pub struct flock {
120 pub l_start: ::off_t,
121 pub l_len: ::off_t,
122 pub l_pid: ::pid_t,
123 pub l_type: ::c_short,
124 pub l_whence: ::c_short,
125 #[cfg(not(target_os = "dragonfly"))]
126 pub l_sysid: ::c_int,
127 }
128
129 pub struct sf_hdtr {
130 pub headers: *mut ::iovec,
131 pub hdr_cnt: ::c_int,
132 pub trailers: *mut ::iovec,
133 pub trl_cnt: ::c_int,
134 }
135
136 pub struct lconv {
137 pub decimal_point: *mut ::c_char,
138 pub thousands_sep: *mut ::c_char,
139 pub grouping: *mut ::c_char,
140 pub int_curr_symbol: *mut ::c_char,
141 pub currency_symbol: *mut ::c_char,
142 pub mon_decimal_point: *mut ::c_char,
143 pub mon_thousands_sep: *mut ::c_char,
144 pub mon_grouping: *mut ::c_char,
145 pub positive_sign: *mut ::c_char,
146 pub negative_sign: *mut ::c_char,
147 pub int_frac_digits: ::c_char,
148 pub frac_digits: ::c_char,
149 pub p_cs_precedes: ::c_char,
150 pub p_sep_by_space: ::c_char,
151 pub n_cs_precedes: ::c_char,
152 pub n_sep_by_space: ::c_char,
153 pub p_sign_posn: ::c_char,
154 pub n_sign_posn: ::c_char,
155 pub int_p_cs_precedes: ::c_char,
156 pub int_n_cs_precedes: ::c_char,
157 pub int_p_sep_by_space: ::c_char,
158 pub int_n_sep_by_space: ::c_char,
159 pub int_p_sign_posn: ::c_char,
160 pub int_n_sign_posn: ::c_char,
161 }
162 }
163
164 pub const AIO_LISTIO_MAX: ::c_int = 16;
165 pub const AIO_CANCELED: ::c_int = 1;
166 pub const AIO_NOTCANCELED: ::c_int = 2;
167 pub const AIO_ALLDONE: ::c_int = 3;
168 pub const LIO_NOP: ::c_int = 0;
169 pub const LIO_WRITE: ::c_int = 1;
170 pub const LIO_READ: ::c_int = 2;
171 pub const LIO_WAIT: ::c_int = 1;
172 pub const LIO_NOWAIT: ::c_int = 0;
173
174 pub const SIGEV_NONE: ::c_int = 0;
175 pub const SIGEV_SIGNAL: ::c_int = 1;
176 pub const SIGEV_THREAD: ::c_int = 2;
177 pub const SIGEV_KEVENT: ::c_int = 3;
178
179 pub const CODESET: ::nl_item = 0;
180 pub const D_T_FMT: ::nl_item = 1;
181 pub const D_FMT: ::nl_item = 2;
182 pub const T_FMT: ::nl_item = 3;
183 pub const T_FMT_AMPM: ::nl_item = 4;
184 pub const AM_STR: ::nl_item = 5;
185 pub const PM_STR: ::nl_item = 6;
186
187 pub const DAY_1: ::nl_item = 7;
188 pub const DAY_2: ::nl_item = 8;
189 pub const DAY_3: ::nl_item = 9;
190 pub const DAY_4: ::nl_item = 10;
191 pub const DAY_5: ::nl_item = 11;
192 pub const DAY_6: ::nl_item = 12;
193 pub const DAY_7: ::nl_item = 13;
194
195 pub const ABDAY_1: ::nl_item = 14;
196 pub const ABDAY_2: ::nl_item = 15;
197 pub const ABDAY_3: ::nl_item = 16;
198 pub const ABDAY_4: ::nl_item = 17;
199 pub const ABDAY_5: ::nl_item = 18;
200 pub const ABDAY_6: ::nl_item = 19;
201 pub const ABDAY_7: ::nl_item = 20;
202
203 pub const MON_1: ::nl_item = 21;
204 pub const MON_2: ::nl_item = 22;
205 pub const MON_3: ::nl_item = 23;
206 pub const MON_4: ::nl_item = 24;
207 pub const MON_5: ::nl_item = 25;
208 pub const MON_6: ::nl_item = 26;
209 pub const MON_7: ::nl_item = 27;
210 pub const MON_8: ::nl_item = 28;
211 pub const MON_9: ::nl_item = 29;
212 pub const MON_10: ::nl_item = 30;
213 pub const MON_11: ::nl_item = 31;
214 pub const MON_12: ::nl_item = 32;
215
216 pub const ABMON_1: ::nl_item = 33;
217 pub const ABMON_2: ::nl_item = 34;
218 pub const ABMON_3: ::nl_item = 35;
219 pub const ABMON_4: ::nl_item = 36;
220 pub const ABMON_5: ::nl_item = 37;
221 pub const ABMON_6: ::nl_item = 38;
222 pub const ABMON_7: ::nl_item = 39;
223 pub const ABMON_8: ::nl_item = 40;
224 pub const ABMON_9: ::nl_item = 41;
225 pub const ABMON_10: ::nl_item = 42;
226 pub const ABMON_11: ::nl_item = 43;
227 pub const ABMON_12: ::nl_item = 44;
228
229 pub const ERA: ::nl_item = 45;
230 pub const ERA_D_FMT: ::nl_item = 46;
231 pub const ERA_D_T_FMT: ::nl_item = 47;
232 pub const ERA_T_FMT: ::nl_item = 48;
233 pub const ALT_DIGITS: ::nl_item = 49;
234
235 pub const RADIXCHAR: ::nl_item = 50;
236 pub const THOUSEP: ::nl_item = 51;
237
238 pub const YESEXPR: ::nl_item = 52;
239 pub const NOEXPR: ::nl_item = 53;
240
241 pub const YESSTR: ::nl_item = 54;
242 pub const NOSTR: ::nl_item = 55;
243
244 pub const CRNCYSTR: ::nl_item = 56;
245
246 pub const D_MD_ORDER: ::nl_item = 57;
247
248 pub const ALTMON_1: ::nl_item = 58;
249 pub const ALTMON_2: ::nl_item = 59;
250 pub const ALTMON_3: ::nl_item = 60;
251 pub const ALTMON_4: ::nl_item = 61;
252 pub const ALTMON_5: ::nl_item = 62;
253 pub const ALTMON_6: ::nl_item = 63;
254 pub const ALTMON_7: ::nl_item = 64;
255 pub const ALTMON_8: ::nl_item = 65;
256 pub const ALTMON_9: ::nl_item = 66;
257 pub const ALTMON_10: ::nl_item = 67;
258 pub const ALTMON_11: ::nl_item = 68;
259 pub const ALTMON_12: ::nl_item = 69;
260
261 pub const EXIT_FAILURE: ::c_int = 1;
262 pub const EXIT_SUCCESS: ::c_int = 0;
263 pub const EOF: ::c_int = -1;
264 pub const SEEK_SET: ::c_int = 0;
265 pub const SEEK_CUR: ::c_int = 1;
266 pub const SEEK_END: ::c_int = 2;
267 pub const SEEK_DATA: ::c_int = 3;
268 pub const SEEK_HOLE: ::c_int = 4;
269 pub const _IOFBF: ::c_int = 0;
270 pub const _IONBF: ::c_int = 2;
271 pub const _IOLBF: ::c_int = 1;
272 pub const BUFSIZ: ::c_uint = 1024;
273 pub const FOPEN_MAX: ::c_uint = 20;
274 pub const FILENAME_MAX: ::c_uint = 1024;
275 pub const L_tmpnam: ::c_uint = 1024;
276 pub const TMP_MAX: ::c_uint = 308915776;
277
278 pub const O_NOCTTY: ::c_int = 32768;
279 pub const O_DIRECT: ::c_int = 0x00010000;
280
281 pub const S_IFIFO: mode_t = 4096;
282 pub const S_IFCHR: mode_t = 8192;
283 pub const S_IFBLK: mode_t = 24576;
284 pub const S_IFDIR: mode_t = 16384;
285 pub const S_IFREG: mode_t = 32768;
286 pub const S_IFLNK: mode_t = 40960;
287 pub const S_IFSOCK: mode_t = 49152;
288 pub const S_IFMT: mode_t = 61440;
289 pub const S_IEXEC: mode_t = 64;
290 pub const S_IWRITE: mode_t = 128;
291 pub const S_IREAD: mode_t = 256;
292 pub const S_IRWXU: mode_t = 448;
293 pub const S_IXUSR: mode_t = 64;
294 pub const S_IWUSR: mode_t = 128;
295 pub const S_IRUSR: mode_t = 256;
296 pub const S_IRWXG: mode_t = 56;
297 pub const S_IXGRP: mode_t = 8;
298 pub const S_IWGRP: mode_t = 16;
299 pub const S_IRGRP: mode_t = 32;
300 pub const S_IRWXO: mode_t = 7;
301 pub const S_IXOTH: mode_t = 1;
302 pub const S_IWOTH: mode_t = 2;
303 pub const S_IROTH: mode_t = 4;
304 pub const F_OK: ::c_int = 0;
305 pub const R_OK: ::c_int = 4;
306 pub const W_OK: ::c_int = 2;
307 pub const X_OK: ::c_int = 1;
308 pub const STDIN_FILENO: ::c_int = 0;
309 pub const STDOUT_FILENO: ::c_int = 1;
310 pub const STDERR_FILENO: ::c_int = 2;
311 pub const F_LOCK: ::c_int = 1;
312 pub const F_TEST: ::c_int = 3;
313 pub const F_TLOCK: ::c_int = 2;
314 pub const F_ULOCK: ::c_int = 0;
315 pub const F_DUPFD_CLOEXEC: ::c_int = 17;
316 pub const SIGHUP: ::c_int = 1;
317 pub const SIGINT: ::c_int = 2;
318 pub const SIGQUIT: ::c_int = 3;
319 pub const SIGILL: ::c_int = 4;
320 pub const SIGABRT: ::c_int = 6;
321 pub const SIGEMT: ::c_int = 7;
322 pub const SIGFPE: ::c_int = 8;
323 pub const SIGKILL: ::c_int = 9;
324 pub const SIGSEGV: ::c_int = 11;
325 pub const SIGPIPE: ::c_int = 13;
326 pub const SIGALRM: ::c_int = 14;
327 pub const SIGTERM: ::c_int = 15;
328
329 pub const PROT_NONE: ::c_int = 0;
330 pub const PROT_READ: ::c_int = 1;
331 pub const PROT_WRITE: ::c_int = 2;
332 pub const PROT_EXEC: ::c_int = 4;
333
334 pub const MAP_FILE: ::c_int = 0x0000;
335 pub const MAP_SHARED: ::c_int = 0x0001;
336 pub const MAP_PRIVATE: ::c_int = 0x0002;
337 pub const MAP_FIXED: ::c_int = 0x0010;
338 pub const MAP_ANON: ::c_int = 0x1000;
339 pub const MAP_ANONYMOUS: ::c_int = MAP_ANON;
340
341 pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
342
343 pub const MCL_CURRENT: ::c_int = 0x0001;
344 pub const MCL_FUTURE: ::c_int = 0x0002;
345
346 pub const MS_SYNC: ::c_int = 0x0000;
347 pub const MS_ASYNC: ::c_int = 0x0001;
348 pub const MS_INVALIDATE: ::c_int = 0x0002;
349
350 pub const EPERM: ::c_int = 1;
351 pub const ENOENT: ::c_int = 2;
352 pub const ESRCH: ::c_int = 3;
353 pub const EINTR: ::c_int = 4;
354 pub const EIO: ::c_int = 5;
355 pub const ENXIO: ::c_int = 6;
356 pub const E2BIG: ::c_int = 7;
357 pub const ENOEXEC: ::c_int = 8;
358 pub const EBADF: ::c_int = 9;
359 pub const ECHILD: ::c_int = 10;
360 pub const EDEADLK: ::c_int = 11;
361 pub const ENOMEM: ::c_int = 12;
362 pub const EACCES: ::c_int = 13;
363 pub const EFAULT: ::c_int = 14;
364 pub const ENOTBLK: ::c_int = 15;
365 pub const EBUSY: ::c_int = 16;
366 pub const EEXIST: ::c_int = 17;
367 pub const EXDEV: ::c_int = 18;
368 pub const ENODEV: ::c_int = 19;
369 pub const ENOTDIR: ::c_int = 20;
370 pub const EISDIR: ::c_int = 21;
371 pub const EINVAL: ::c_int = 22;
372 pub const ENFILE: ::c_int = 23;
373 pub const EMFILE: ::c_int = 24;
374 pub const ENOTTY: ::c_int = 25;
375 pub const ETXTBSY: ::c_int = 26;
376 pub const EFBIG: ::c_int = 27;
377 pub const ENOSPC: ::c_int = 28;
378 pub const ESPIPE: ::c_int = 29;
379 pub const EROFS: ::c_int = 30;
380 pub const EMLINK: ::c_int = 31;
381 pub const EPIPE: ::c_int = 32;
382 pub const EDOM: ::c_int = 33;
383 pub const ERANGE: ::c_int = 34;
384 pub const EAGAIN: ::c_int = 35;
385 pub const EWOULDBLOCK: ::c_int = 35;
386 pub const EINPROGRESS: ::c_int = 36;
387 pub const EALREADY: ::c_int = 37;
388 pub const ENOTSOCK: ::c_int = 38;
389 pub const EDESTADDRREQ: ::c_int = 39;
390 pub const EMSGSIZE: ::c_int = 40;
391 pub const EPROTOTYPE: ::c_int = 41;
392 pub const ENOPROTOOPT: ::c_int = 42;
393 pub const EPROTONOSUPPORT: ::c_int = 43;
394 pub const ESOCKTNOSUPPORT: ::c_int = 44;
395 pub const EOPNOTSUPP: ::c_int = 45;
396 pub const ENOTSUP: ::c_int = EOPNOTSUPP;
397 pub const EPFNOSUPPORT: ::c_int = 46;
398 pub const EAFNOSUPPORT: ::c_int = 47;
399 pub const EADDRINUSE: ::c_int = 48;
400 pub const EADDRNOTAVAIL: ::c_int = 49;
401 pub const ENETDOWN: ::c_int = 50;
402 pub const ENETUNREACH: ::c_int = 51;
403 pub const ENETRESET: ::c_int = 52;
404 pub const ECONNABORTED: ::c_int = 53;
405 pub const ECONNRESET: ::c_int = 54;
406 pub const ENOBUFS: ::c_int = 55;
407 pub const EISCONN: ::c_int = 56;
408 pub const ENOTCONN: ::c_int = 57;
409 pub const ESHUTDOWN: ::c_int = 58;
410 pub const ETOOMANYREFS: ::c_int = 59;
411 pub const ETIMEDOUT: ::c_int = 60;
412 pub const ECONNREFUSED: ::c_int = 61;
413 pub const ELOOP: ::c_int = 62;
414 pub const ENAMETOOLONG: ::c_int = 63;
415 pub const EHOSTDOWN: ::c_int = 64;
416 pub const EHOSTUNREACH: ::c_int = 65;
417 pub const ENOTEMPTY: ::c_int = 66;
418 pub const EPROCLIM: ::c_int = 67;
419 pub const EUSERS: ::c_int = 68;
420 pub const EDQUOT: ::c_int = 69;
421 pub const ESTALE: ::c_int = 70;
422 pub const EREMOTE: ::c_int = 71;
423 pub const EBADRPC: ::c_int = 72;
424 pub const ERPCMISMATCH: ::c_int = 73;
425 pub const EPROGUNAVAIL: ::c_int = 74;
426 pub const EPROGMISMATCH: ::c_int = 75;
427 pub const EPROCUNAVAIL: ::c_int = 76;
428 pub const ENOLCK: ::c_int = 77;
429 pub const ENOSYS: ::c_int = 78;
430 pub const EFTYPE: ::c_int = 79;
431 pub const EAUTH: ::c_int = 80;
432 pub const ENEEDAUTH: ::c_int = 81;
433 pub const EIDRM: ::c_int = 82;
434 pub const ENOMSG: ::c_int = 83;
435 pub const EOVERFLOW: ::c_int = 84;
436 pub const ECANCELED: ::c_int = 85;
437 pub const EILSEQ: ::c_int = 86;
438 pub const ENOATTR: ::c_int = 87;
439 pub const EDOOFUS: ::c_int = 88;
440 pub const EBADMSG: ::c_int = 89;
441 pub const EMULTIHOP: ::c_int = 90;
442 pub const ENOLINK: ::c_int = 91;
443 pub const EPROTO: ::c_int = 92;
444
445 pub const POLLSTANDARD: ::c_short = ::POLLIN | ::POLLPRI | ::POLLOUT |
446 ::POLLRDNORM | ::POLLRDBAND | ::POLLWRBAND | ::POLLERR |
447 ::POLLHUP | ::POLLNVAL;
448
449 pub const EAI_SYSTEM: ::c_int = 11;
450
451 pub const F_DUPFD: ::c_int = 0;
452 pub const F_GETFD: ::c_int = 1;
453 pub const F_SETFD: ::c_int = 2;
454 pub const F_GETFL: ::c_int = 3;
455 pub const F_SETFL: ::c_int = 4;
456
457 pub const SIGTRAP: ::c_int = 5;
458
459 pub const GLOB_APPEND : ::c_int = 0x0001;
460 pub const GLOB_DOOFFS : ::c_int = 0x0002;
461 pub const GLOB_ERR : ::c_int = 0x0004;
462 pub const GLOB_MARK : ::c_int = 0x0008;
463 pub const GLOB_NOCHECK : ::c_int = 0x0010;
464 pub const GLOB_NOSORT : ::c_int = 0x0020;
465 pub const GLOB_NOESCAPE: ::c_int = 0x2000;
466
467 pub const GLOB_NOSPACE : ::c_int = -1;
468 pub const GLOB_ABORTED : ::c_int = -2;
469 pub const GLOB_NOMATCH : ::c_int = -3;
470
471 pub const POSIX_MADV_NORMAL: ::c_int = 0;
472 pub const POSIX_MADV_RANDOM: ::c_int = 1;
473 pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2;
474 pub const POSIX_MADV_WILLNEED: ::c_int = 3;
475 pub const POSIX_MADV_DONTNEED: ::c_int = 4;
476
477 pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 0;
478 pub const PTHREAD_PROCESS_SHARED: ::c_int = 1;
479 pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0;
480 pub const PTHREAD_CREATE_DETACHED: ::c_int = 1;
481
482 pub const RLIMIT_CPU: ::c_int = 0;
483 pub const RLIMIT_FSIZE: ::c_int = 1;
484 pub const RLIMIT_DATA: ::c_int = 2;
485 pub const RLIMIT_STACK: ::c_int = 3;
486 pub const RLIMIT_CORE: ::c_int = 4;
487 pub const RLIMIT_RSS: ::c_int = 5;
488 pub const RLIMIT_MEMLOCK: ::c_int = 6;
489 pub const RLIMIT_NPROC: ::c_int = 7;
490 pub const RLIMIT_NOFILE: ::c_int = 8;
491 pub const RLIMIT_SBSIZE: ::c_int = 9;
492 pub const RLIMIT_VMEM: ::c_int = 10;
493 pub const RLIMIT_AS: ::c_int = RLIMIT_VMEM;
494 pub const RLIM_INFINITY: rlim_t = 0x7fff_ffff_ffff_ffff;
495
496 pub const RUSAGE_SELF: ::c_int = 0;
497 pub const RUSAGE_CHILDREN: ::c_int = -1;
498
499 pub const MADV_NORMAL: ::c_int = 0;
500 pub const MADV_RANDOM: ::c_int = 1;
501 pub const MADV_SEQUENTIAL: ::c_int = 2;
502 pub const MADV_WILLNEED: ::c_int = 3;
503 pub const MADV_DONTNEED: ::c_int = 4;
504 pub const MADV_FREE: ::c_int = 5;
505 pub const MADV_NOSYNC: ::c_int = 6;
506 pub const MADV_AUTOSYNC: ::c_int = 7;
507 pub const MADV_NOCORE: ::c_int = 8;
508 pub const MADV_CORE: ::c_int = 9;
509
510 pub const MINCORE_INCORE: ::c_int = 0x1;
511 pub const MINCORE_REFERENCED: ::c_int = 0x2;
512 pub const MINCORE_MODIFIED: ::c_int = 0x4;
513 pub const MINCORE_REFERENCED_OTHER: ::c_int = 0x8;
514 pub const MINCORE_MODIFIED_OTHER: ::c_int = 0x10;
515 pub const MINCORE_SUPER: ::c_int = 0x20;
516
517 pub const AF_UNSPEC: ::c_int = 0;
518 pub const AF_LOCAL: ::c_int = 1;
519 pub const AF_UNIX: ::c_int = AF_LOCAL;
520 pub const AF_INET: ::c_int = 2;
521 pub const AF_IMPLINK: ::c_int = 3;
522 pub const AF_PUP: ::c_int = 4;
523 pub const AF_CHAOS: ::c_int = 5;
524 pub const AF_NETBIOS: ::c_int = 6;
525 pub const AF_ISO: ::c_int = 7;
526 pub const AF_OSI: ::c_int = AF_ISO;
527 pub const AF_ECMA: ::c_int = 8;
528 pub const AF_DATAKIT: ::c_int = 9;
529 pub const AF_CCITT: ::c_int = 10;
530 pub const AF_SNA: ::c_int = 11;
531 pub const AF_DECnet: ::c_int = 12;
532 pub const AF_DLI: ::c_int = 13;
533 pub const AF_LAT: ::c_int = 14;
534 pub const AF_HYLINK: ::c_int = 15;
535 pub const AF_APPLETALK: ::c_int = 16;
536 pub const AF_ROUTE: ::c_int = 17;
537 pub const AF_LINK: ::c_int = 18;
538 pub const pseudo_AF_XTP: ::c_int = 19;
539 pub const AF_COIP: ::c_int = 20;
540 pub const AF_CNT: ::c_int = 21;
541 pub const pseudo_AF_RTIP: ::c_int = 22;
542 pub const AF_IPX: ::c_int = 23;
543 pub const AF_SIP: ::c_int = 24;
544 pub const pseudo_AF_PIP: ::c_int = 25;
545 pub const AF_ISDN: ::c_int = 26;
546 pub const AF_E164: ::c_int = AF_ISDN;
547 pub const pseudo_AF_KEY: ::c_int = 27;
548 pub const AF_INET6: ::c_int = 28;
549 pub const AF_NATM: ::c_int = 29;
550 pub const AF_ATM: ::c_int = 30;
551 pub const pseudo_AF_HDRCMPLT: ::c_int = 31;
552 pub const AF_NETGRAPH: ::c_int = 32;
553
554 pub const PF_UNSPEC: ::c_int = AF_UNSPEC;
555 pub const PF_LOCAL: ::c_int = AF_LOCAL;
556 pub const PF_UNIX: ::c_int = PF_LOCAL;
557 pub const PF_INET: ::c_int = AF_INET;
558 pub const PF_IMPLINK: ::c_int = AF_IMPLINK;
559 pub const PF_PUP: ::c_int = AF_PUP;
560 pub const PF_CHAOS: ::c_int = AF_CHAOS;
561 pub const PF_NETBIOS: ::c_int = AF_NETBIOS;
562 pub const PF_ISO: ::c_int = AF_ISO;
563 pub const PF_OSI: ::c_int = AF_ISO;
564 pub const PF_ECMA: ::c_int = AF_ECMA;
565 pub const PF_DATAKIT: ::c_int = AF_DATAKIT;
566 pub const PF_CCITT: ::c_int = AF_CCITT;
567 pub const PF_SNA: ::c_int = AF_SNA;
568 pub const PF_DECnet: ::c_int = AF_DECnet;
569 pub const PF_DLI: ::c_int = AF_DLI;
570 pub const PF_LAT: ::c_int = AF_LAT;
571 pub const PF_HYLINK: ::c_int = AF_HYLINK;
572 pub const PF_APPLETALK: ::c_int = AF_APPLETALK;
573 pub const PF_ROUTE: ::c_int = AF_ROUTE;
574 pub const PF_LINK: ::c_int = AF_LINK;
575 pub const PF_XTP: ::c_int = pseudo_AF_XTP;
576 pub const PF_COIP: ::c_int = AF_COIP;
577 pub const PF_CNT: ::c_int = AF_CNT;
578 pub const PF_SIP: ::c_int = AF_SIP;
579 pub const PF_IPX: ::c_int = AF_IPX;
580 pub const PF_RTIP: ::c_int = pseudo_AF_RTIP;
581 pub const PF_PIP: ::c_int = pseudo_AF_PIP;
582 pub const PF_ISDN: ::c_int = AF_ISDN;
583 pub const PF_KEY: ::c_int = pseudo_AF_KEY;
584 pub const PF_INET6: ::c_int = AF_INET6;
585 pub const PF_NATM: ::c_int = AF_NATM;
586 pub const PF_ATM: ::c_int = AF_ATM;
587 pub const PF_NETGRAPH: ::c_int = AF_NETGRAPH;
588
589 pub const SOMAXCONN: ::c_int = 128;
590
591 pub const MSG_OOB: ::c_int = 0x00000001;
592 pub const MSG_PEEK: ::c_int = 0x00000002;
593 pub const MSG_DONTROUTE: ::c_int = 0x00000004;
594 pub const MSG_EOR: ::c_int = 0x00000008;
595 pub const MSG_TRUNC: ::c_int = 0x00000010;
596 pub const MSG_CTRUNC: ::c_int = 0x00000020;
597 pub const MSG_WAITALL: ::c_int = 0x00000040;
598 pub const MSG_DONTWAIT: ::c_int = 0x00000080;
599 pub const MSG_EOF: ::c_int = 0x00000100;
600
601 pub const SCM_TIMESTAMP: ::c_int = 0x02;
602
603 pub const SOCK_STREAM: ::c_int = 1;
604 pub const SOCK_DGRAM: ::c_int = 2;
605 pub const SOCK_RAW: ::c_int = 3;
606 pub const SOCK_RDM: ::c_int = 4;
607 pub const SOCK_SEQPACKET: ::c_int = 5;
608 pub const SOCK_CLOEXEC: ::c_int = 0x10000000;
609 pub const SOCK_NONBLOCK: ::c_int = 0x20000000;
610 pub const SOCK_MAXADDRLEN: ::c_int = 255;
611 pub const IP_TTL: ::c_int = 4;
612 pub const IP_HDRINCL: ::c_int = 2;
613 pub const IP_ADD_MEMBERSHIP: ::c_int = 12;
614 pub const IP_DROP_MEMBERSHIP: ::c_int = 13;
615 pub const IPV6_JOIN_GROUP: ::c_int = 12;
616 pub const IPV6_LEAVE_GROUP: ::c_int = 13;
617
618 pub const TCP_NODELAY: ::c_int = 1;
619 pub const TCP_KEEPIDLE: ::c_int = 256;
620 pub const SOL_SOCKET: ::c_int = 0xffff;
621 pub const SO_DEBUG: ::c_int = 0x01;
622 pub const SO_ACCEPTCONN: ::c_int = 0x0002;
623 pub const SO_REUSEADDR: ::c_int = 0x0004;
624 pub const SO_KEEPALIVE: ::c_int = 0x0008;
625 pub const SO_DONTROUTE: ::c_int = 0x0010;
626 pub const SO_BROADCAST: ::c_int = 0x0020;
627 pub const SO_USELOOPBACK: ::c_int = 0x0040;
628 pub const SO_LINGER: ::c_int = 0x0080;
629 pub const SO_OOBINLINE: ::c_int = 0x0100;
630 pub const SO_REUSEPORT: ::c_int = 0x0200;
631 pub const SO_TIMESTAMP: ::c_int = 0x0400;
632 pub const SO_NOSIGPIPE: ::c_int = 0x0800;
633 pub const SO_ACCEPTFILTER: ::c_int = 0x1000;
634 pub const SO_SNDBUF: ::c_int = 0x1001;
635 pub const SO_RCVBUF: ::c_int = 0x1002;
636 pub const SO_SNDLOWAT: ::c_int = 0x1003;
637 pub const SO_RCVLOWAT: ::c_int = 0x1004;
638 pub const SO_SNDTIMEO: ::c_int = 0x1005;
639 pub const SO_RCVTIMEO: ::c_int = 0x1006;
640 pub const SO_ERROR: ::c_int = 0x1007;
641 pub const SO_TYPE: ::c_int = 0x1008;
642
643 pub const SHUT_RD: ::c_int = 0;
644 pub const SHUT_WR: ::c_int = 1;
645 pub const SHUT_RDWR: ::c_int = 2;
646
647 pub const LOCK_SH: ::c_int = 1;
648 pub const LOCK_EX: ::c_int = 2;
649 pub const LOCK_NB: ::c_int = 4;
650 pub const LOCK_UN: ::c_int = 8;
651
652 pub const MAP_COPY: ::c_int = 0x0002;
653 pub const MAP_RENAME: ::c_int = 0x0020;
654 pub const MAP_NORESERVE: ::c_int = 0x0040;
655 pub const MAP_HASSEMAPHORE: ::c_int = 0x0200;
656 pub const MAP_STACK: ::c_int = 0x0400;
657 pub const MAP_NOSYNC: ::c_int = 0x0800;
658 pub const MAP_NOCORE: ::c_int = 0x020000;
659
660 pub const IPPROTO_RAW: ::c_int = 255;
661
662 pub const _PC_LINK_MAX: ::c_int = 1;
663 pub const _PC_MAX_CANON: ::c_int = 2;
664 pub const _PC_MAX_INPUT: ::c_int = 3;
665 pub const _PC_NAME_MAX: ::c_int = 4;
666 pub const _PC_PATH_MAX: ::c_int = 5;
667 pub const _PC_PIPE_BUF: ::c_int = 6;
668 pub const _PC_CHOWN_RESTRICTED: ::c_int = 7;
669 pub const _PC_NO_TRUNC: ::c_int = 8;
670 pub const _PC_VDISABLE: ::c_int = 9;
671 pub const _PC_ALLOC_SIZE_MIN: ::c_int = 10;
672 pub const _PC_FILESIZEBITS: ::c_int = 12;
673 pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 14;
674 pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 15;
675 pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 16;
676 pub const _PC_REC_XFER_ALIGN: ::c_int = 17;
677 pub const _PC_SYMLINK_MAX: ::c_int = 18;
678 pub const _PC_MIN_HOLE_SIZE: ::c_int = 21;
679 pub const _PC_ASYNC_IO: ::c_int = 53;
680 pub const _PC_PRIO_IO: ::c_int = 54;
681 pub const _PC_SYNC_IO: ::c_int = 55;
682 pub const _PC_ACL_EXTENDED: ::c_int = 59;
683 pub const _PC_ACL_PATH_MAX: ::c_int = 60;
684 pub const _PC_CAP_PRESENT: ::c_int = 61;
685 pub const _PC_INF_PRESENT: ::c_int = 62;
686 pub const _PC_MAC_PRESENT: ::c_int = 63;
687
688 pub const _SC_ARG_MAX: ::c_int = 1;
689 pub const _SC_CHILD_MAX: ::c_int = 2;
690 pub const _SC_CLK_TCK: ::c_int = 3;
691 pub const _SC_NGROUPS_MAX: ::c_int = 4;
692 pub const _SC_OPEN_MAX: ::c_int = 5;
693 pub const _SC_JOB_CONTROL: ::c_int = 6;
694 pub const _SC_SAVED_IDS: ::c_int = 7;
695 pub const _SC_VERSION: ::c_int = 8;
696 pub const _SC_BC_BASE_MAX: ::c_int = 9;
697 pub const _SC_BC_DIM_MAX: ::c_int = 10;
698 pub const _SC_BC_SCALE_MAX: ::c_int = 11;
699 pub const _SC_BC_STRING_MAX: ::c_int = 12;
700 pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 13;
701 pub const _SC_EXPR_NEST_MAX: ::c_int = 14;
702 pub const _SC_LINE_MAX: ::c_int = 15;
703 pub const _SC_RE_DUP_MAX: ::c_int = 16;
704 pub const _SC_2_VERSION: ::c_int = 17;
705 pub const _SC_2_C_BIND: ::c_int = 18;
706 pub const _SC_2_C_DEV: ::c_int = 19;
707 pub const _SC_2_CHAR_TERM: ::c_int = 20;
708 pub const _SC_2_FORT_DEV: ::c_int = 21;
709 pub const _SC_2_FORT_RUN: ::c_int = 22;
710 pub const _SC_2_LOCALEDEF: ::c_int = 23;
711 pub const _SC_2_SW_DEV: ::c_int = 24;
712 pub const _SC_2_UPE: ::c_int = 25;
713 pub const _SC_STREAM_MAX: ::c_int = 26;
714 pub const _SC_TZNAME_MAX: ::c_int = 27;
715 pub const _SC_ASYNCHRONOUS_IO: ::c_int = 28;
716 pub const _SC_MAPPED_FILES: ::c_int = 29;
717 pub const _SC_MEMLOCK: ::c_int = 30;
718 pub const _SC_MEMLOCK_RANGE: ::c_int = 31;
719 pub const _SC_MEMORY_PROTECTION: ::c_int = 32;
720 pub const _SC_MESSAGE_PASSING: ::c_int = 33;
721 pub const _SC_PRIORITIZED_IO: ::c_int = 34;
722 pub const _SC_PRIORITY_SCHEDULING: ::c_int = 35;
723 pub const _SC_REALTIME_SIGNALS: ::c_int = 36;
724 pub const _SC_SEMAPHORES: ::c_int = 37;
725 pub const _SC_FSYNC: ::c_int = 38;
726 pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 39;
727 pub const _SC_SYNCHRONIZED_IO: ::c_int = 40;
728 pub const _SC_TIMERS: ::c_int = 41;
729 pub const _SC_AIO_LISTIO_MAX: ::c_int = 42;
730 pub const _SC_AIO_MAX: ::c_int = 43;
731 pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 44;
732 pub const _SC_DELAYTIMER_MAX: ::c_int = 45;
733 pub const _SC_MQ_OPEN_MAX: ::c_int = 46;
734 pub const _SC_PAGESIZE: ::c_int = 47;
735 pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
736 pub const _SC_RTSIG_MAX: ::c_int = 48;
737 pub const _SC_SEM_NSEMS_MAX: ::c_int = 49;
738 pub const _SC_SEM_VALUE_MAX: ::c_int = 50;
739 pub const _SC_SIGQUEUE_MAX: ::c_int = 51;
740 pub const _SC_TIMER_MAX: ::c_int = 52;
741 pub const _SC_IOV_MAX: ::c_int = 56;
742 pub const _SC_NPROCESSORS_CONF: ::c_int = 57;
743 pub const _SC_2_PBS: ::c_int = 59;
744 pub const _SC_2_PBS_ACCOUNTING: ::c_int = 60;
745 pub const _SC_2_PBS_CHECKPOINT: ::c_int = 61;
746 pub const _SC_2_PBS_LOCATE: ::c_int = 62;
747 pub const _SC_2_PBS_MESSAGE: ::c_int = 63;
748 pub const _SC_2_PBS_TRACK: ::c_int = 64;
749 pub const _SC_ADVISORY_INFO: ::c_int = 65;
750 pub const _SC_BARRIERS: ::c_int = 66;
751 pub const _SC_CLOCK_SELECTION: ::c_int = 67;
752 pub const _SC_CPUTIME: ::c_int = 68;
753 pub const _SC_FILE_LOCKING: ::c_int = 69;
754 pub const _SC_NPROCESSORS_ONLN: ::c_int = 58;
755 pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 70;
756 pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 71;
757 pub const _SC_HOST_NAME_MAX: ::c_int = 72;
758 pub const _SC_LOGIN_NAME_MAX: ::c_int = 73;
759 pub const _SC_MONOTONIC_CLOCK: ::c_int = 74;
760 pub const _SC_MQ_PRIO_MAX: ::c_int = 75;
761 pub const _SC_READER_WRITER_LOCKS: ::c_int = 76;
762 pub const _SC_REGEXP: ::c_int = 77;
763 pub const _SC_SHELL: ::c_int = 78;
764 pub const _SC_SPAWN: ::c_int = 79;
765 pub const _SC_SPIN_LOCKS: ::c_int = 80;
766 pub const _SC_SPORADIC_SERVER: ::c_int = 81;
767 pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 82;
768 pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 83;
769 pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 85;
770 pub const _SC_THREAD_KEYS_MAX: ::c_int = 86;
771 pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 87;
772 pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 88;
773 pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 89;
774 pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 90;
775 pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 91;
776 pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 92;
777 pub const _SC_THREAD_STACK_MIN: ::c_int = 93;
778 pub const _SC_THREAD_THREADS_MAX: ::c_int = 94;
779 pub const _SC_TIMEOUTS: ::c_int = 95;
780 pub const _SC_THREADS: ::c_int = 96;
781 pub const _SC_TRACE: ::c_int = 97;
782 pub const _SC_TRACE_EVENT_FILTER: ::c_int = 98;
783 pub const _SC_TRACE_INHERIT: ::c_int = 99;
784 pub const _SC_TRACE_LOG: ::c_int = 100;
785 pub const _SC_TTY_NAME_MAX: ::c_int = 101;
786 pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 102;
787 pub const _SC_V6_ILP32_OFF32: ::c_int = 103;
788 pub const _SC_V6_ILP32_OFFBIG: ::c_int = 104;
789 pub const _SC_V6_LP64_OFF64: ::c_int = 105;
790 pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 106;
791 pub const _SC_ATEXIT_MAX: ::c_int = 107;
792 pub const _SC_XOPEN_CRYPT: ::c_int = 108;
793 pub const _SC_XOPEN_ENH_I18N: ::c_int = 109;
794 pub const _SC_XOPEN_LEGACY: ::c_int = 110;
795 pub const _SC_XOPEN_REALTIME: ::c_int = 111;
796 pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 112;
797 pub const _SC_XOPEN_SHM: ::c_int = 113;
798 pub const _SC_XOPEN_STREAMS: ::c_int = 114;
799 pub const _SC_XOPEN_UNIX: ::c_int = 115;
800 pub const _SC_XOPEN_VERSION: ::c_int = 116;
801 pub const _SC_XOPEN_XCU_VERSION: ::c_int = 117;
802 pub const _SC_IPV6: ::c_int = 118;
803 pub const _SC_RAW_SOCKETS: ::c_int = 119;
804 pub const _SC_SYMLOOP_MAX: ::c_int = 120;
805 pub const _SC_PHYS_PAGES: ::c_int = 121;
806
807 pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = 0 as *mut _;
808 pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = 0 as *mut _;
809 pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = 0 as *mut _;
810 pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 1;
811 pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2;
812 pub const PTHREAD_MUTEX_NORMAL: ::c_int = 3;
813 pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_ERRORCHECK;
814
815 pub const SCHED_FIFO: ::c_int = 1;
816 pub const SCHED_OTHER: ::c_int = 2;
817 pub const SCHED_RR: ::c_int = 3;
818
819 pub const FD_SETSIZE: usize = 1024;
820
821 pub const ST_NOSUID: ::c_ulong = 2;
822
823 pub const NI_MAXHOST: ::size_t = 1025;
824
825 pub const RTLD_LOCAL: ::c_int = 0;
826 pub const RTLD_NODELETE: ::c_int = 0x1000;
827 pub const RTLD_NOLOAD: ::c_int = 0x2000;
828 pub const RTLD_GLOBAL: ::c_int = 0x100;
829
830 pub const LOG_NTP: ::c_int = 12 << 3;
831 pub const LOG_SECURITY: ::c_int = 13 << 3;
832 pub const LOG_CONSOLE: ::c_int = 14 << 3;
833 pub const LOG_NFACILITIES: ::c_int = 24;
834
835 pub const TIOCEXCL: ::c_uint = 0x2000740d;
836 pub const TIOCNXCL: ::c_uint = 0x2000740e;
837 pub const TIOCFLUSH: ::c_ulong = 0x80047410;
838 pub const TIOCGETA: ::c_uint = 0x402c7413;
839 pub const TIOCSETA: ::c_ulong = 0x802c7414;
840 pub const TIOCSETAW: ::c_ulong = 0x802c7415;
841 pub const TIOCSETAF: ::c_ulong = 0x802c7416;
842 pub const TIOCGETD: ::c_uint = 0x4004741a;
843 pub const TIOCSETD: ::c_ulong = 0x8004741b;
844 pub const TIOCGDRAINWAIT: ::c_uint = 0x40047456;
845 pub const TIOCSDRAINWAIT: ::c_ulong = 0x80047457;
846 pub const TIOCTIMESTAMP: ::c_uint = 0x40107459;
847 pub const TIOCMGDTRWAIT: ::c_uint = 0x4004745a;
848 pub const TIOCMSDTRWAIT: ::c_ulong = 0x8004745b;
849 pub const TIOCDRAIN: ::c_uint = 0x2000745e;
850 pub const TIOCEXT: ::c_ulong = 0x80047460;
851 pub const TIOCSCTTY: ::c_uint = 0x20007461;
852 pub const TIOCCONS: ::c_ulong = 0x80047462;
853 pub const TIOCGSID: ::c_uint = 0x40047463;
854 pub const TIOCSTAT: ::c_uint = 0x20007465;
855 pub const TIOCUCNTL: ::c_ulong = 0x80047466;
856 pub const TIOCSWINSZ: ::c_ulong = 0x80087467;
857 pub const TIOCGWINSZ: ::c_uint = 0x40087468;
858 pub const TIOCMGET: ::c_uint = 0x4004746a;
859 pub const TIOCM_LE: ::c_int = 0x1;
860 pub const TIOCM_DTR: ::c_int = 0x2;
861 pub const TIOCM_RTS: ::c_int = 0x4;
862 pub const TIOCM_ST: ::c_int = 0x8;
863 pub const TIOCM_SR: ::c_int = 0x10;
864 pub const TIOCM_CTS: ::c_int = 0x20;
865 pub const TIOCM_RI: ::c_int = 0x80;
866 pub const TIOCM_DSR: ::c_int = 0x100;
867 pub const TIOCM_CD: ::c_int = 0x40;
868 pub const TIOCM_CAR: ::c_int = 0x40;
869 pub const TIOCM_RNG: ::c_int = 0x80;
870 pub const TIOCMBIC: ::c_ulong = 0x8004746b;
871 pub const TIOCMBIS: ::c_ulong = 0x8004746c;
872 pub const TIOCMSET: ::c_ulong = 0x8004746d;
873 pub const TIOCSTART: ::c_uint = 0x2000746e;
874 pub const TIOCSTOP: ::c_uint = 0x2000746f;
875 pub const TIOCPKT: ::c_ulong = 0x80047470;
876 pub const TIOCPKT_DATA: ::c_int = 0x0;
877 pub const TIOCPKT_FLUSHREAD: ::c_int = 0x1;
878 pub const TIOCPKT_FLUSHWRITE: ::c_int = 0x2;
879 pub const TIOCPKT_STOP: ::c_int = 0x4;
880 pub const TIOCPKT_START: ::c_int = 0x8;
881 pub const TIOCPKT_NOSTOP: ::c_int = 0x10;
882 pub const TIOCPKT_DOSTOP: ::c_int = 0x20;
883 pub const TIOCPKT_IOCTL: ::c_int = 0x40;
884 pub const TIOCNOTTY: ::c_uint = 0x20007471;
885 pub const TIOCSTI: ::c_ulong = 0x80017472;
886 pub const TIOCOUTQ: ::c_uint = 0x40047473;
887 pub const TIOCSPGRP: ::c_ulong = 0x80047476;
888 pub const TIOCGPGRP: ::c_uint = 0x40047477;
889 pub const TIOCCDTR: ::c_uint = 0x20007478;
890 pub const TIOCSDTR: ::c_uint = 0x20007479;
891 pub const TIOCCBRK: ::c_uint = 0x2000747a;
892 pub const TIOCSBRK: ::c_uint = 0x2000747b;
893 pub const TTYDISC: ::c_int = 0x0;
894 pub const SLIPDISC: ::c_int = 0x4;
895 pub const PPPDISC: ::c_int = 0x5;
896 pub const NETGRAPHDISC: ::c_int = 0x6;
897
898 pub const B0: speed_t = 0;
899 pub const B50: speed_t = 50;
900 pub const B75: speed_t = 75;
901 pub const B110: speed_t = 110;
902 pub const B134: speed_t = 134;
903 pub const B150: speed_t = 150;
904 pub const B200: speed_t = 200;
905 pub const B300: speed_t = 300;
906 pub const B600: speed_t = 600;
907 pub const B1200: speed_t = 1200;
908 pub const B1800: speed_t = 1800;
909 pub const B2400: speed_t = 2400;
910 pub const B4800: speed_t = 4800;
911 pub const B9600: speed_t = 9600;
912 pub const B19200: speed_t = 19200;
913 pub const B38400: speed_t = 38400;
914 pub const B7200: speed_t = 7200;
915 pub const B14400: speed_t = 14400;
916 pub const B28800: speed_t = 28800;
917 pub const B57600: speed_t = 57600;
918 pub const B76800: speed_t = 76800;
919 pub const B115200: speed_t = 115200;
920 pub const B230400: speed_t = 230400;
921 pub const EXTA: speed_t = 19200;
922 pub const EXTB: speed_t = 38400;
923
924 pub const SEM_FAILED: *mut sem_t = 0 as *mut sem_t;
925
926 pub const CRTSCTS: ::tcflag_t = 0x00030000;
927 pub const CCTS_OFLOW: ::tcflag_t = 0x00010000;
928 pub const CRTS_IFLOW: ::tcflag_t = 0x00020000;
929 pub const CDTR_IFLOW: ::tcflag_t = 0x00040000;
930 pub const CDSR_OFLOW: ::tcflag_t = 0x00080000;
931 pub const CCAR_OFLOW: ::tcflag_t = 0x00100000;
932 pub const VERASE2: usize = 7;
933 pub const OCRNL: ::tcflag_t = 0x10;
934 pub const ONOCR: ::tcflag_t = 0x20;
935 pub const ONLRET: ::tcflag_t = 0x40;
936
937 f! {
938 pub fn WIFCONTINUED(status: ::c_int) -> bool {
939 status == 0x13
940 }
941
942 pub fn WSTOPSIG(status: ::c_int) -> ::c_int {
943 status >> 8
944 }
945
946 pub fn WIFSIGNALED(status: ::c_int) -> bool {
947 (status & 0o177) != 0o177 && (status & 0o177) != 0
948 }
949
950 pub fn WIFSTOPPED(status: ::c_int) -> bool {
951 (status & 0o177) == 0o177
952 }
953 }
954
955 extern {
956 pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
957 pub fn endutxent();
958 pub fn getutxent() -> *mut utmpx;
959 pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
960 pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
961 pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
962 pub fn setutxent();
963 pub fn setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int;
964 pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int;
965 pub fn getgrouplist(name: *const ::c_char,
966 basegid: ::gid_t,
967 groups: *mut ::gid_t,
968 ngroups: *mut ::c_int) -> ::c_int;
969 pub fn initgroups(name: *const ::c_char, basegid: ::gid_t) -> ::c_int;
970 }
971
972 #[link(name = "util")]
973 extern {
974 pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int;
975 pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
976 pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
977 pub fn aio_error(aiocbp: *const aiocb) -> ::c_int;
978 pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t;
979 pub fn aio_suspend(aiocb_list: *const *const aiocb, nitems: ::c_int,
980 timeout: *const ::timespec) -> ::c_int;
981 pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
982 pub fn lio_listio(mode: ::c_int, aiocb_list: *const *mut aiocb,
983 nitems: ::c_int, sevp: *mut sigevent) -> ::c_int;
984 pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
985 pub fn getnameinfo(sa: *const ::sockaddr,
986 salen: ::socklen_t,
987 host: *mut ::c_char,
988 hostlen: ::size_t,
989 serv: *mut ::c_char,
990 servlen: ::size_t,
991 flags: ::c_int) -> ::c_int;
992 pub fn kevent(kq: ::c_int,
993 changelist: *const ::kevent,
994 nchanges: ::c_int,
995 eventlist: *mut ::kevent,
996 nevents: ::c_int,
997 timeout: *const ::timespec) -> ::c_int;
998 pub fn mincore(addr: *const ::c_void, len: ::size_t,
999 vec: *mut ::c_char) -> ::c_int;
1000 pub fn pwritev(fd: ::c_int,
1001 iov: *const ::iovec,
1002 iovcnt: ::c_int,
1003 offset: ::off_t) -> ::ssize_t;
1004 pub fn preadv(fd: ::c_int,
1005 iov: *const ::iovec,
1006 iovcnt: ::c_int,
1007 offset: ::off_t) -> ::ssize_t;
1008 pub fn sysctlnametomib(name: *const ::c_char,
1009 mibp: *mut ::c_int,
1010 sizep: *mut ::size_t)
1011 -> ::c_int;
1012 pub fn shm_open(name: *const ::c_char, oflag: ::c_int, mode: ::mode_t)
1013 -> ::c_int;
1014 pub fn sysctl(name: *const ::c_int,
1015 namelen: ::c_uint,
1016 oldp: *mut ::c_void,
1017 oldlenp: *mut ::size_t,
1018 newp: *const ::c_void,
1019 newlen: ::size_t)
1020 -> ::c_int;
1021 pub fn sysctlbyname(name: *const ::c_char,
1022 oldp: *mut ::c_void,
1023 oldlenp: *mut ::size_t,
1024 newp: *const ::c_void,
1025 newlen: ::size_t)
1026 -> ::c_int;
1027 pub fn sched_setscheduler(pid: ::pid_t,
1028 policy: ::c_int,
1029 param: *const ::sched_param) -> ::c_int;
1030 pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int;
1031 pub fn memrchr(cx: *const ::c_void,
1032 c: ::c_int,
1033 n: ::size_t) -> *mut ::c_void;
1034 pub fn sendfile(fd: ::c_int,
1035 s: ::c_int,
1036 offset: ::off_t,
1037 nbytes: ::size_t,
1038 hdtr: *mut ::sf_hdtr,
1039 sbytes: *mut ::off_t,
1040 flags: ::c_int) -> ::c_int;
1041 pub fn sigtimedwait(set: *const sigset_t,
1042 info: *mut siginfo_t,
1043 timeout: *const ::timespec) -> ::c_int;
1044 pub fn sigwaitinfo(set: *const sigset_t,
1045 info: *mut siginfo_t) -> ::c_int;
1046 pub fn openpty(amaster: *mut ::c_int,
1047 aslave: *mut ::c_int,
1048 name: *mut ::c_char,
1049 termp: *mut termios,
1050 winp: *mut ::winsize) -> ::c_int;
1051 pub fn forkpty(amaster: *mut ::c_int,
1052 name: *mut ::c_char,
1053 termp: *mut termios,
1054 winp: *mut ::winsize) -> ::pid_t;
1055 pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
1056 pub fn duplocale(base: ::locale_t) -> ::locale_t;
1057 pub fn newlocale(mask: ::c_int,
1058 locale: *const ::c_char,
1059 base: ::locale_t) -> ::locale_t;
1060 pub fn uselocale(loc: ::locale_t) -> ::locale_t;
1061 pub fn querylocale(mask: ::c_int, loc: ::locale_t) -> *const ::c_char;
1062 pub fn accept4(s: ::c_int, addr: *mut ::sockaddr,
1063 addrlen: *mut ::socklen_t, flags: ::c_int) -> ::c_int;
1064 pub fn pthread_set_name_np(tid: ::pthread_t, name: *const ::c_char);
1065 pub fn pthread_attr_get_np(tid: ::pthread_t,
1066 attr: *mut ::pthread_attr_t) -> ::c_int;
1067 pub fn pthread_attr_getguardsize(attr: *const ::pthread_attr_t,
1068 guardsize: *mut ::size_t) -> ::c_int;
1069 pub fn pthread_attr_getstack(attr: *const ::pthread_attr_t,
1070 stackaddr: *mut *mut ::c_void,
1071 stacksize: *mut ::size_t) -> ::c_int;
1072 pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t,
1073 pshared: ::c_int) -> ::c_int;
1074 pub fn pthread_condattr_getpshared(attr: *const pthread_condattr_t,
1075 pshared: *mut ::c_int) -> ::c_int;
1076 pub fn pthread_mutexattr_setpshared(attr: *mut pthread_mutexattr_t,
1077 pshared: ::c_int) -> ::c_int;
1078 pub fn pthread_mutexattr_getpshared(attr: *const pthread_mutexattr_t,
1079 pshared: *mut ::c_int) -> ::c_int;
1080 pub fn pthread_rwlockattr_getpshared(attr: *const pthread_rwlockattr_t,
1081 val: *mut ::c_int) -> ::c_int;
1082 pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t,
1083 val: ::c_int) -> ::c_int;
1084 pub fn getpriority(which: ::c_int, who: ::c_int) -> ::c_int;
1085 pub fn setpriority(which: ::c_int, who: ::c_int, prio: ::c_int) -> ::c_int;
1086
1087 pub fn fdopendir(fd: ::c_int) -> *mut ::DIR;
1088
1089 pub fn mknodat(dirfd: ::c_int, pathname: *const ::c_char,
1090 mode: ::mode_t, dev: dev_t) -> ::c_int;
1091 pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char,
1092 mode: ::mode_t) -> ::c_int;
1093 pub fn pthread_condattr_getclock(attr: *const pthread_condattr_t,
1094 clock_id: *mut clockid_t) -> ::c_int;
1095 pub fn pthread_condattr_setclock(attr: *mut pthread_condattr_t,
1096 clock_id: ::clockid_t) -> ::c_int;
1097 pub fn sethostname(name: *const ::c_char, len: ::c_int) -> ::c_int;
1098 pub fn sem_timedwait(sem: *mut sem_t,
1099 abstime: *const ::timespec) -> ::c_int;
1100 pub fn pthread_mutex_timedlock(lock: *mut pthread_mutex_t,
1101 abstime: *const ::timespec) -> ::c_int;
1102 pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int;
1103 pub fn ppoll(fds: *mut ::pollfd,
1104 nfds: ::nfds_t,
1105 timeout: *const ::timespec,
1106 sigmask: *const sigset_t) -> ::c_int;
1107 pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int;
1108 }
1109
1110 cfg_if! {
1111 if #[cfg(target_os = "freebsd")] {
1112 mod freebsd;
1113 pub use self::freebsd::*;
1114 } else if #[cfg(target_os = "dragonfly")] {
1115 mod dragonfly;
1116 pub use self::dragonfly::*;
1117 } else {
1118 // ...
1119 }
1120 }