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