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