1 pub type fflags_t = u32;
2 pub type clock_t = i32;
3 
4 pub type lwpid_t = i32;
5 pub type blksize_t = i32;
6 pub type clockid_t = ::c_int;
7 pub type sem_t = _sem;
8 pub type timer_t = *mut __c_anonymous__timer;
9 
10 pub type fsblkcnt_t = u64;
11 pub type fsfilcnt_t = u64;
12 pub type idtype_t = ::c_uint;
13 
14 pub type msglen_t = ::c_ulong;
15 pub type msgqnum_t = ::c_ulong;
16 
17 pub type cpulevel_t = ::c_int;
18 pub type cpuwhich_t = ::c_int;
19 
20 pub type mqd_t = *mut ::c_void;
21 pub type posix_spawnattr_t = *mut ::c_void;
22 pub type posix_spawn_file_actions_t = *mut ::c_void;
23 
24 pub type pthread_spinlock_t = *mut __c_anonymous_pthread_spinlock;
25 pub type pthread_barrierattr_t = *mut __c_anonymous_pthread_barrierattr;
26 pub type pthread_barrier_t = *mut __c_anonymous_pthread_barrier;
27 
28 pub type uuid_t = ::uuid;
29 
30 s! {
31     pub struct aiocb {
32         pub aio_fildes: ::c_int,
33         pub aio_offset: ::off_t,
34         pub aio_buf: *mut ::c_void,
35         pub aio_nbytes: ::size_t,
36         __unused1: [::c_int; 2],
37         __unused2: *mut ::c_void,
38         pub aio_lio_opcode: ::c_int,
39         pub aio_reqprio: ::c_int,
40         // unused 3 through 5 are the __aiocb_private structure
41         __unused3: ::c_long,
42         __unused4: ::c_long,
43         __unused5: *mut ::c_void,
44         pub aio_sigevent: sigevent
45     }
46 
47     pub struct jail {
48         pub version: u32,
49         pub path: *mut ::c_char,
50         pub hostname: *mut ::c_char,
51         pub jailname: *mut ::c_char,
52         pub ip4s: ::c_uint,
53         pub ip6s: ::c_uint,
54         pub ip4: *mut ::in_addr,
55         pub ip6: *mut ::in6_addr,
56     }
57 
58     pub struct statvfs {
59         pub f_bavail: ::fsblkcnt_t,
60         pub f_bfree: ::fsblkcnt_t,
61         pub f_blocks: ::fsblkcnt_t,
62         pub f_favail: ::fsfilcnt_t,
63         pub f_ffree: ::fsfilcnt_t,
64         pub f_files: ::fsfilcnt_t,
65         pub f_bsize: ::c_ulong,
66         pub f_flag: ::c_ulong,
67         pub f_frsize: ::c_ulong,
68         pub f_fsid: ::c_ulong,
69         pub f_namemax: ::c_ulong,
70     }
71 
72     // internal structure has changed over time
73     pub struct _sem {
74         data: [u32; 4],
75     }
76 
77     pub struct msqid_ds {
78         pub msg_perm: ::ipc_perm,
79         __unused1: *mut ::c_void,
80         __unused2: *mut ::c_void,
81         pub msg_cbytes: ::msglen_t,
82         pub msg_qnum: ::msgqnum_t,
83         pub msg_qbytes: ::msglen_t,
84         pub msg_lspid: ::pid_t,
85         pub msg_lrpid: ::pid_t,
86         pub msg_stime: ::time_t,
87         pub msg_rtime: ::time_t,
88         pub msg_ctime: ::time_t,
89     }
90 
91     pub struct stack_t {
92         pub ss_sp: *mut ::c_void,
93         pub ss_size: ::size_t,
94         pub ss_flags: ::c_int,
95     }
96 
97     pub struct mmsghdr {
98         pub msg_hdr: ::msghdr,
99         pub msg_len: ::ssize_t,
100     }
101 
102     pub struct sockcred {
103         pub sc_uid: ::uid_t,
104         pub sc_euid: ::uid_t,
105         pub sc_gid: ::gid_t,
106         pub sc_egid: ::gid_t,
107         pub sc_ngroups: ::c_int,
108         pub sc_groups: [::gid_t; 1],
109     }
110 
111     pub struct accept_filter_arg {
112         pub af_name: [::c_char; 16],
113         af_arg: [[::c_char; 10]; 24],
114     }
115 
116     pub struct ptrace_vm_entry {
117         pub pve_entry: ::c_int,
118         pub pve_timestamp: ::c_int,
119         pub pve_start: ::c_ulong,
120         pub pve_end: ::c_ulong,
121         pub pve_offset: ::c_ulong,
122         pub pve_prot: ::c_uint,
123         pub pve_pathlen: ::c_uint,
124         pub pve_fileid: ::c_long,
125         pub pve_fsid: u32,
126         pub pve_path: *mut ::c_char,
127     }
128 
129     pub struct cpuset_t {
130         #[cfg(target_pointer_width = "64")]
131         __bits: [::c_long; 4],
132         #[cfg(target_pointer_width = "32")]
133         __bits: [::c_long; 8],
134     }
135 
136     pub struct cap_rights_t {
137         cr_rights: [u64; 2],
138     }
139 
140     pub struct umutex {
141         m_owner: ::lwpid_t,
142         m_flags: u32,
143         m_ceilings: [u32; 2],
144         m_rb_link: ::uintptr_t,
145         #[cfg(target_pointer_width = "32")]
146         m_pad: u32,
147         m_spare: [u32; 2],
148 
149     }
150 
151     pub struct ucond {
152         c_has_waiters: u32,
153         c_flags: u32,
154         c_clockid: u32,
155         c_spare: [u32; 1],
156     }
157 
158     pub struct uuid {
159         pub time_low: u32,
160         pub time_mid: u16,
161         pub time_hi_and_version: u16,
162         pub clock_seq_hi_and_reserved: u8,
163         pub clock_seq_low: u8,
164         pub node: [u8; _UUID_NODE_LEN],
165     }
166 
167     pub struct __c_anonymous_pthread_spinlock {
168         s_clock: umutex,
169     }
170 
171     pub struct __c_anonymous_pthread_barrierattr {
172         pshared: ::c_int,
173     }
174 
175     pub struct __c_anonymous_pthread_barrier {
176         b_lock: umutex,
177         b_cv: ucond,
178         b_cycle: i64,
179         b_count: ::c_int,
180         b_waiters: ::c_int,
181         b_refcount: ::c_int,
182         b_destroying: ::c_int,
183     }
184 
185     pub struct kinfo_vmentry {
186         pub kve_structsize: ::c_int,
187         pub kve_type: ::c_int,
188         pub kve_start: u64,
189         pub kve_end: u64,
190         pub kve_offset: u64,
191         pub kve_vn_fileid: u64,
192         #[cfg(not(freebsd11))]
193         pub kve_vn_fsid_freebsd11: u32,
194         #[cfg(freebsd11)]
195         pub kve_vn_fsid: u32,
196         pub kve_flags: ::c_int,
197         pub kve_resident: ::c_int,
198         pub kve_private_resident: ::c_int,
199         pub kve_protection: ::c_int,
200         pub kve_ref_count: ::c_int,
201         pub kve_shadow_count: ::c_int,
202         pub kve_vn_type: ::c_int,
203         pub kve_vn_size: u64,
204         #[cfg(not(freebsd11))]
205         pub kve_vn_rdev_freebsd11: u32,
206         #[cfg(freebsd11)]
207         pub kve_vn_rdev: u32,
208         pub kve_vn_mode: u16,
209         pub kve_status: u16,
210         #[cfg(not(freebsd11))]
211         pub kve_vn_fsid: u64,
212         #[cfg(not(freebsd11))]
213         pub kve_vn_rdev: u64,
214         #[cfg(not(freebsd11))]
215         _kve_is_spare: [::c_int; 8],
216         #[cfg(freebsd11)]
217         _kve_is_spare: [::c_int; 12],
218         pub kve_path: [[::c_char; 32]; 32],
219     }
220 
221     pub struct kinfo_proc {
222         __pad0: [[::uintptr_t; 17]; 8],
223     }
224 
225     pub struct filestat {
226         fs_type: ::c_int,
227         fs_flags: ::c_int,
228         fs_fflags: ::c_int,
229         fs_uflags: ::c_int,
230         fs_fd: ::c_int,
231         fs_ref_count: ::c_int,
232         fs_offset: ::off_t,
233         fs_typedep: *mut ::c_void,
234         fs_path: *mut ::c_char,
235         next: *mut filestat,
236         fs_cap_rights: cap_rights_t,
237     }
238 
239     pub struct filestat_list {
240         stqh_first: *mut filestat,
241         stqh_last: *mut *mut filestat,
242     }
243 
244     pub struct procstat {
245         tpe: ::c_int,
246         kd: ::uintptr_t,
247         vmentries: *mut ::c_void,
248         files: *mut ::c_void,
249         argv: *mut ::c_void,
250         envv: *mut ::c_void,
251         core: ::uintptr_t,
252     }
253 
254     pub struct itimerspec {
255         pub it_interval: ::timespec,
256         pub it_value: ::timespec,
257     }
258 
259     pub struct __c_anonymous__timer {
260         _priv: [::c_int; 3],
261     }
262 }
263 
264 s_no_extra_traits! {
265     pub struct utmpx {
266         pub ut_type: ::c_short,
267         pub ut_tv: ::timeval,
268         pub ut_id: [::c_char; 8],
269         pub ut_pid: ::pid_t,
270         pub ut_user: [::c_char; 32],
271         pub ut_line: [::c_char; 16],
272         pub ut_host: [::c_char; 128],
273         pub __ut_spare: [::c_char; 64],
274     }
275 
276     #[cfg(libc_union)]
277     pub union __c_anonymous_cr_pid {
278         __cr_unused: *mut ::c_void,
279         pub cr_pid: ::pid_t,
280     }
281 
282     pub struct xucred {
283         pub cr_version: ::c_uint,
284         pub cr_uid: ::uid_t,
285         pub cr_ngroups: ::c_short,
286         pub cr_groups: [::gid_t; 16],
287         #[cfg(libc_union)]
288         pub cr_pid__c_anonymous_union: __c_anonymous_cr_pid,
289         #[cfg(not(libc_union))]
290         __cr_unused1: *mut ::c_void,
291     }
292 
293     pub struct sockaddr_dl {
294         pub sdl_len: ::c_uchar,
295         pub sdl_family: ::c_uchar,
296         pub sdl_index: ::c_ushort,
297         pub sdl_type: ::c_uchar,
298         pub sdl_nlen: ::c_uchar,
299         pub sdl_alen: ::c_uchar,
300         pub sdl_slen: ::c_uchar,
301         pub sdl_data: [::c_char; 46],
302     }
303 
304     pub struct mq_attr {
305         pub mq_flags: ::c_long,
306         pub mq_maxmsg: ::c_long,
307         pub mq_msgsize: ::c_long,
308         pub mq_curmsgs: ::c_long,
309         __reserved: [::c_long; 4]
310     }
311 
312     pub struct sigevent {
313         pub sigev_notify: ::c_int,
314         pub sigev_signo: ::c_int,
315         pub sigev_value: ::sigval,
316         //The rest of the structure is actually a union.  We expose only
317         //sigev_notify_thread_id because it's the most useful union member.
318         pub sigev_notify_thread_id: ::lwpid_t,
319         #[cfg(target_pointer_width = "64")]
320         __unused1: ::c_int,
321         __unused2: [::c_long; 7]
322     }
323 
324     #[cfg(libc_union)]
325     pub union __c_anonymous_elf32_auxv_union {
326         pub a_val: ::c_int,
327     }
328 
329     pub struct Elf32_Auxinfo {
330         pub a_type: ::c_int,
331         #[cfg(libc_union)]
332         pub a_un: __c_anonymous_elf32_auxv_union,
333     }
334 }
335 
336 cfg_if! {
337     if #[cfg(feature = "extra_traits")] {
338         impl PartialEq for utmpx {
339             fn eq(&self, other: &utmpx) -> bool {
340                 self.ut_type == other.ut_type
341                     && self.ut_tv == other.ut_tv
342                     && self.ut_id == other.ut_id
343                     && self.ut_pid == other.ut_pid
344                     && self.ut_user == other.ut_user
345                     && self.ut_line == other.ut_line
346                     && self
347                     .ut_host
348                     .iter()
349                     .zip(other.ut_host.iter())
350                     .all(|(a,b)| a == b)
351                     && self
352                     .__ut_spare
353                     .iter()
354                     .zip(other.__ut_spare.iter())
355                     .all(|(a,b)| a == b)
356             }
357         }
358         impl Eq for utmpx {}
359         impl ::fmt::Debug for utmpx {
360             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
361                 f.debug_struct("utmpx")
362                     .field("ut_type", &self.ut_type)
363                     .field("ut_tv", &self.ut_tv)
364                     .field("ut_id", &self.ut_id)
365                     .field("ut_pid", &self.ut_pid)
366                     .field("ut_user", &self.ut_user)
367                     .field("ut_line", &self.ut_line)
368                     // FIXME: .field("ut_host", &self.ut_host)
369                     // FIXME: .field("__ut_spare", &self.__ut_spare)
370                     .finish()
371             }
372         }
373         impl ::hash::Hash for utmpx {
374             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
375                 self.ut_type.hash(state);
376                 self.ut_tv.hash(state);
377                 self.ut_id.hash(state);
378                 self.ut_pid.hash(state);
379                 self.ut_user.hash(state);
380                 self.ut_line.hash(state);
381                 self.ut_host.hash(state);
382                 self.__ut_spare.hash(state);
383             }
384         }
385 
386         #[cfg(libc_union)]
387         impl PartialEq for __c_anonymous_cr_pid {
388             fn eq(&self, other: &__c_anonymous_cr_pid) -> bool {
389                 unsafe { self.cr_pid == other.cr_pid}
390             }
391         }
392         #[cfg(libc_union)]
393         impl Eq for __c_anonymous_cr_pid {}
394         #[cfg(libc_union)]
395         impl ::fmt::Debug for __c_anonymous_cr_pid {
396             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
397                 f.debug_struct("cr_pid")
398                     .field("cr_pid", unsafe { &self.cr_pid })
399                     .finish()
400             }
401         }
402         #[cfg(libc_union)]
403         impl ::hash::Hash for __c_anonymous_cr_pid {
404             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
405                 unsafe { self.cr_pid.hash(state) };
406             }
407         }
408 
409         impl PartialEq for xucred {
410             fn eq(&self, other: &xucred) -> bool {
411                 #[cfg(libc_union)]
412                 let equal_cr_pid = self.cr_pid__c_anonymous_union
413                     == other.cr_pid__c_anonymous_union;
414                 #[cfg(not(libc_union))]
415                 let equal_cr_pid = self.__cr_unused1 == other.__cr_unused1;
416 
417                 self.cr_version == other.cr_version
418                     && self.cr_uid == other.cr_uid
419                     && self.cr_ngroups == other.cr_ngroups
420                     && self.cr_groups == other.cr_groups
421                     && equal_cr_pid
422             }
423         }
424         impl Eq for xucred {}
425         impl ::fmt::Debug for xucred {
426             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
427                 let mut struct_formatter = f.debug_struct("xucred");
428                 struct_formatter.field("cr_version", &self.cr_version);
429                 struct_formatter.field("cr_uid", &self.cr_uid);
430                 struct_formatter.field("cr_ngroups", &self.cr_ngroups);
431                 struct_formatter.field("cr_groups", &self.cr_groups);
432                 #[cfg(libc_union)]
433                 struct_formatter.field(
434                     "cr_pid__c_anonymous_union",
435                     &self.cr_pid__c_anonymous_union
436                 );
437                 struct_formatter.finish()
438             }
439         }
440         impl ::hash::Hash for xucred {
441             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
442                 self.cr_version.hash(state);
443                 self.cr_uid.hash(state);
444                 self.cr_ngroups.hash(state);
445                 self.cr_groups.hash(state);
446                 #[cfg(libc_union)]
447                 self.cr_pid__c_anonymous_union.hash(state);
448                 #[cfg(not(libc_union))]
449                 self.__cr_unused1.hash(state);
450             }
451         }
452 
453         impl PartialEq for sockaddr_dl {
454             fn eq(&self, other: &sockaddr_dl) -> bool {
455                 self.sdl_len == other.sdl_len
456                     && self.sdl_family == other.sdl_family
457                     && self.sdl_index == other.sdl_index
458                     && self.sdl_type == other.sdl_type
459                     && self.sdl_nlen == other.sdl_nlen
460                     && self.sdl_alen == other.sdl_alen
461                     && self.sdl_slen == other.sdl_slen
462                     && self
463                     .sdl_data
464                     .iter()
465                     .zip(other.sdl_data.iter())
466                     .all(|(a,b)| a == b)
467             }
468         }
469         impl Eq for sockaddr_dl {}
470         impl ::fmt::Debug for sockaddr_dl {
471             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
472                 f.debug_struct("sockaddr_dl")
473                     .field("sdl_len", &self.sdl_len)
474                     .field("sdl_family", &self.sdl_family)
475                     .field("sdl_index", &self.sdl_index)
476                     .field("sdl_type", &self.sdl_type)
477                     .field("sdl_nlen", &self.sdl_nlen)
478                     .field("sdl_alen", &self.sdl_alen)
479                     .field("sdl_slen", &self.sdl_slen)
480                     // FIXME: .field("sdl_data", &self.sdl_data)
481                     .finish()
482             }
483         }
484         impl ::hash::Hash for sockaddr_dl {
485             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
486                 self.sdl_len.hash(state);
487                 self.sdl_family.hash(state);
488                 self.sdl_index.hash(state);
489                 self.sdl_type.hash(state);
490                 self.sdl_nlen.hash(state);
491                 self.sdl_alen.hash(state);
492                 self.sdl_slen.hash(state);
493                 self.sdl_data.hash(state);
494             }
495         }
496 
497         impl PartialEq for mq_attr {
498             fn eq(&self, other: &mq_attr) -> bool {
499                 self.mq_flags == other.mq_flags &&
500                 self.mq_maxmsg == other.mq_maxmsg &&
501                 self.mq_msgsize == other.mq_msgsize &&
502                 self.mq_curmsgs == other.mq_curmsgs
503             }
504         }
505         impl Eq for mq_attr {}
506         impl ::fmt::Debug for mq_attr {
507             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
508                 f.debug_struct("mq_attr")
509                     .field("mq_flags", &self.mq_flags)
510                     .field("mq_maxmsg", &self.mq_maxmsg)
511                     .field("mq_msgsize", &self.mq_msgsize)
512                     .field("mq_curmsgs", &self.mq_curmsgs)
513                     .finish()
514             }
515         }
516         impl ::hash::Hash for mq_attr {
517             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
518                 self.mq_flags.hash(state);
519                 self.mq_maxmsg.hash(state);
520                 self.mq_msgsize.hash(state);
521                 self.mq_curmsgs.hash(state);
522             }
523         }
524 
525         impl PartialEq for sigevent {
526             fn eq(&self, other: &sigevent) -> bool {
527                 self.sigev_notify == other.sigev_notify
528                     && self.sigev_signo == other.sigev_signo
529                     && self.sigev_value == other.sigev_value
530                     && self.sigev_notify_thread_id
531                         == other.sigev_notify_thread_id
532             }
533         }
534         impl Eq for sigevent {}
535         impl ::fmt::Debug for sigevent {
536             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
537                 f.debug_struct("sigevent")
538                     .field("sigev_notify", &self.sigev_notify)
539                     .field("sigev_signo", &self.sigev_signo)
540                     .field("sigev_value", &self.sigev_value)
541                     .field("sigev_notify_thread_id",
542                            &self.sigev_notify_thread_id)
543                     .finish()
544             }
545         }
546         impl ::hash::Hash for sigevent {
547             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
548                 self.sigev_notify.hash(state);
549                 self.sigev_signo.hash(state);
550                 self.sigev_value.hash(state);
551                 self.sigev_notify_thread_id.hash(state);
552             }
553         }
554         #[cfg(libc_union)]
555         impl PartialEq for __c_anonymous_elf32_auxv_union {
556             fn eq(&self, other: &__c_anonymous_elf32_auxv_union) -> bool {
557                 unsafe { self.a_val == other.a_val}
558             }
559         }
560         #[cfg(libc_union)]
561         impl Eq for __c_anonymous_elf32_auxv_union {}
562         #[cfg(libc_union)]
563         impl ::fmt::Debug for __c_anonymous_elf32_auxv_union {
564             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
565                 f.debug_struct("a_val")
566                     .field("a_val", unsafe { &self.a_val })
567                     .finish()
568             }
569         }
570         #[cfg(not(libc_union))]
571         impl PartialEq for Elf32_Auxinfo {
572             fn eq(&self, other: &Elf32_Auxinfo) -> bool {
573                 self.a_type == other.a_type
574             }
575         }
576         #[cfg(libc_union)]
577         impl PartialEq for Elf32_Auxinfo {
578             fn eq(&self, other: &Elf32_Auxinfo) -> bool {
579                 self.a_type == other.a_type
580                     && self.a_un == other.a_un
581             }
582         }
583         impl Eq for Elf32_Auxinfo {}
584         #[cfg(not(libc_union))]
585         impl ::fmt::Debug for Elf32_Auxinfo {
586             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
587                 f.debug_struct("Elf32_Auxinfo")
588                     .field("a_type", &self.a_type)
589                     .finish()
590             }
591         }
592         #[cfg(libc_union)]
593         impl ::fmt::Debug for Elf32_Auxinfo {
594             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
595                 f.debug_struct("Elf32_Auxinfo")
596                     .field("a_type", &self.a_type)
597                     .field("a_un", &self.a_un)
598                     .finish()
599             }
600         }
601     }
602 }
603 
604 pub const SIGEV_THREAD_ID: ::c_int = 4;
605 
606 pub const EXTATTR_NAMESPACE_EMPTY: ::c_int = 0;
607 pub const EXTATTR_NAMESPACE_USER: ::c_int = 1;
608 pub const EXTATTR_NAMESPACE_SYSTEM: ::c_int = 2;
609 
610 pub const PTHREAD_STACK_MIN: ::size_t = MINSIGSTKSZ;
611 pub const PTHREAD_MUTEX_ADAPTIVE_NP: ::c_int = 4;
612 pub const SIGSTKSZ: ::size_t = MINSIGSTKSZ + 32768;
613 pub const SF_NODISKIO: ::c_int = 0x00000001;
614 pub const SF_MNOWAIT: ::c_int = 0x00000002;
615 pub const SF_SYNC: ::c_int = 0x00000004;
616 pub const SF_USER_READAHEAD: ::c_int = 0x00000008;
617 pub const SF_NOCACHE: ::c_int = 0x00000010;
618 pub const O_CLOEXEC: ::c_int = 0x00100000;
619 pub const O_DIRECTORY: ::c_int = 0x00020000;
620 pub const O_EXEC: ::c_int = 0x00040000;
621 pub const O_TTY_INIT: ::c_int = 0x00080000;
622 pub const F_GETLK: ::c_int = 11;
623 pub const F_SETLK: ::c_int = 12;
624 pub const F_SETLKW: ::c_int = 13;
625 pub const ENOTCAPABLE: ::c_int = 93;
626 pub const ECAPMODE: ::c_int = 94;
627 pub const ENOTRECOVERABLE: ::c_int = 95;
628 pub const EOWNERDEAD: ::c_int = 96;
629 pub const RLIMIT_NPTS: ::c_int = 11;
630 pub const RLIMIT_SWAP: ::c_int = 12;
631 pub const RLIMIT_KQUEUES: ::c_int = 13;
632 pub const RLIMIT_UMTXP: ::c_int = 14;
633 #[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
634 pub const RLIM_NLIMITS: ::rlim_t = 15;
635 
636 pub const NI_NOFQDN: ::c_int = 0x00000001;
637 pub const NI_NUMERICHOST: ::c_int = 0x00000002;
638 pub const NI_NAMEREQD: ::c_int = 0x00000004;
639 pub const NI_NUMERICSERV: ::c_int = 0x00000008;
640 pub const NI_DGRAM: ::c_int = 0x00000010;
641 pub const NI_NUMERICSCOPE: ::c_int = 0x00000020;
642 
643 pub const Q_GETQUOTA: ::c_int = 0x700;
644 pub const Q_SETQUOTA: ::c_int = 0x800;
645 
646 pub const MAP_GUARD: ::c_int = 0x00002000;
647 pub const MAP_EXCL: ::c_int = 0x00004000;
648 pub const MAP_PREFAULT_READ: ::c_int = 0x00040000;
649 pub const MAP_ALIGNED_SUPER: ::c_int = 1 << 24;
650 
651 pub const POSIX_FADV_NORMAL: ::c_int = 0;
652 pub const POSIX_FADV_RANDOM: ::c_int = 1;
653 pub const POSIX_FADV_SEQUENTIAL: ::c_int = 2;
654 pub const POSIX_FADV_WILLNEED: ::c_int = 3;
655 pub const POSIX_FADV_DONTNEED: ::c_int = 4;
656 pub const POSIX_FADV_NOREUSE: ::c_int = 5;
657 
658 pub const POLLINIGNEOF: ::c_short = 0x2000;
659 
660 pub const EVFILT_READ: i16 = -1;
661 pub const EVFILT_WRITE: i16 = -2;
662 pub const EVFILT_AIO: i16 = -3;
663 pub const EVFILT_VNODE: i16 = -4;
664 pub const EVFILT_PROC: i16 = -5;
665 pub const EVFILT_SIGNAL: i16 = -6;
666 pub const EVFILT_TIMER: i16 = -7;
667 pub const EVFILT_PROCDESC: i16 = -8;
668 pub const EVFILT_FS: i16 = -9;
669 pub const EVFILT_LIO: i16 = -10;
670 pub const EVFILT_USER: i16 = -11;
671 pub const EVFILT_SENDFILE: i16 = -12;
672 pub const EVFILT_EMPTY: i16 = -13;
673 
674 pub const EV_ADD: u16 = 0x1;
675 pub const EV_DELETE: u16 = 0x2;
676 pub const EV_ENABLE: u16 = 0x4;
677 pub const EV_DISABLE: u16 = 0x8;
678 pub const EV_ONESHOT: u16 = 0x10;
679 pub const EV_CLEAR: u16 = 0x20;
680 pub const EV_RECEIPT: u16 = 0x40;
681 pub const EV_DISPATCH: u16 = 0x80;
682 pub const EV_DROP: u16 = 0x1000;
683 pub const EV_FLAG1: u16 = 0x2000;
684 pub const EV_ERROR: u16 = 0x4000;
685 pub const EV_EOF: u16 = 0x8000;
686 pub const EV_SYSFLAGS: u16 = 0xf000;
687 
688 pub const NOTE_TRIGGER: u32 = 0x01000000;
689 pub const NOTE_FFNOP: u32 = 0x00000000;
690 pub const NOTE_FFAND: u32 = 0x40000000;
691 pub const NOTE_FFOR: u32 = 0x80000000;
692 pub const NOTE_FFCOPY: u32 = 0xc0000000;
693 pub const NOTE_FFCTRLMASK: u32 = 0xc0000000;
694 pub const NOTE_FFLAGSMASK: u32 = 0x00ffffff;
695 pub const NOTE_LOWAT: u32 = 0x00000001;
696 pub const NOTE_DELETE: u32 = 0x00000001;
697 pub const NOTE_WRITE: u32 = 0x00000002;
698 pub const NOTE_EXTEND: u32 = 0x00000004;
699 pub const NOTE_ATTRIB: u32 = 0x00000008;
700 pub const NOTE_LINK: u32 = 0x00000010;
701 pub const NOTE_RENAME: u32 = 0x00000020;
702 pub const NOTE_REVOKE: u32 = 0x00000040;
703 pub const NOTE_EXIT: u32 = 0x80000000;
704 pub const NOTE_FORK: u32 = 0x40000000;
705 pub const NOTE_EXEC: u32 = 0x20000000;
706 pub const NOTE_PDATAMASK: u32 = 0x000fffff;
707 pub const NOTE_PCTRLMASK: u32 = 0xf0000000;
708 pub const NOTE_TRACK: u32 = 0x00000001;
709 pub const NOTE_TRACKERR: u32 = 0x00000002;
710 pub const NOTE_CHILD: u32 = 0x00000004;
711 pub const NOTE_SECONDS: u32 = 0x00000001;
712 pub const NOTE_MSECONDS: u32 = 0x00000002;
713 pub const NOTE_USECONDS: u32 = 0x00000004;
714 pub const NOTE_NSECONDS: u32 = 0x00000008;
715 
716 pub const MADV_PROTECT: ::c_int = 10;
717 pub const RUSAGE_THREAD: ::c_int = 1;
718 
719 #[doc(hidden)]
720 #[deprecated(
721     since = "0.2.72",
722     note = "CTL_UNSPEC is deprecated. Use CTL_SYSCTL instead"
723 )]
724 pub const CTL_UNSPEC: ::c_int = 0;
725 pub const CTL_SYSCTL: ::c_int = 0;
726 pub const CTL_KERN: ::c_int = 1;
727 pub const CTL_VM: ::c_int = 2;
728 pub const CTL_VFS: ::c_int = 3;
729 pub const CTL_NET: ::c_int = 4;
730 pub const CTL_DEBUG: ::c_int = 5;
731 pub const CTL_HW: ::c_int = 6;
732 pub const CTL_MACHDEP: ::c_int = 7;
733 pub const CTL_USER: ::c_int = 8;
734 pub const CTL_P1003_1B: ::c_int = 9;
735 pub const CTL_SYSCTL_DEBUG: ::c_int = 0;
736 pub const CTL_SYSCTL_NAME: ::c_int = 1;
737 pub const CTL_SYSCTL_NEXT: ::c_int = 2;
738 pub const CTL_SYSCTL_NAME2OID: ::c_int = 3;
739 pub const CTL_SYSCTL_OIDFMT: ::c_int = 4;
740 pub const CTL_SYSCTL_OIDDESCR: ::c_int = 5;
741 pub const CTL_SYSCTL_OIDLABEL: ::c_int = 6;
742 pub const KERN_OSTYPE: ::c_int = 1;
743 pub const KERN_OSRELEASE: ::c_int = 2;
744 pub const KERN_OSREV: ::c_int = 3;
745 pub const KERN_VERSION: ::c_int = 4;
746 pub const KERN_MAXVNODES: ::c_int = 5;
747 pub const KERN_MAXPROC: ::c_int = 6;
748 pub const KERN_MAXFILES: ::c_int = 7;
749 pub const KERN_ARGMAX: ::c_int = 8;
750 pub const KERN_SECURELVL: ::c_int = 9;
751 pub const KERN_HOSTNAME: ::c_int = 10;
752 pub const KERN_HOSTID: ::c_int = 11;
753 pub const KERN_CLOCKRATE: ::c_int = 12;
754 pub const KERN_VNODE: ::c_int = 13;
755 pub const KERN_PROC: ::c_int = 14;
756 pub const KERN_FILE: ::c_int = 15;
757 pub const KERN_PROF: ::c_int = 16;
758 pub const KERN_POSIX1: ::c_int = 17;
759 pub const KERN_NGROUPS: ::c_int = 18;
760 pub const KERN_JOB_CONTROL: ::c_int = 19;
761 pub const KERN_SAVED_IDS: ::c_int = 20;
762 pub const KERN_BOOTTIME: ::c_int = 21;
763 pub const KERN_NISDOMAINNAME: ::c_int = 22;
764 pub const KERN_UPDATEINTERVAL: ::c_int = 23;
765 pub const KERN_OSRELDATE: ::c_int = 24;
766 pub const KERN_NTP_PLL: ::c_int = 25;
767 pub const KERN_BOOTFILE: ::c_int = 26;
768 pub const KERN_MAXFILESPERPROC: ::c_int = 27;
769 pub const KERN_MAXPROCPERUID: ::c_int = 28;
770 pub const KERN_DUMPDEV: ::c_int = 29;
771 pub const KERN_IPC: ::c_int = 30;
772 pub const KERN_DUMMY: ::c_int = 31;
773 pub const KERN_PS_STRINGS: ::c_int = 32;
774 pub const KERN_USRSTACK: ::c_int = 33;
775 pub const KERN_LOGSIGEXIT: ::c_int = 34;
776 pub const KERN_IOV_MAX: ::c_int = 35;
777 pub const KERN_HOSTUUID: ::c_int = 36;
778 pub const KERN_ARND: ::c_int = 37;
779 pub const KERN_PROC_ALL: ::c_int = 0;
780 pub const KERN_PROC_PID: ::c_int = 1;
781 pub const KERN_PROC_PGRP: ::c_int = 2;
782 pub const KERN_PROC_SESSION: ::c_int = 3;
783 pub const KERN_PROC_TTY: ::c_int = 4;
784 pub const KERN_PROC_UID: ::c_int = 5;
785 pub const KERN_PROC_RUID: ::c_int = 6;
786 pub const KERN_PROC_ARGS: ::c_int = 7;
787 pub const KERN_PROC_PROC: ::c_int = 8;
788 pub const KERN_PROC_SV_NAME: ::c_int = 9;
789 pub const KERN_PROC_RGID: ::c_int = 10;
790 pub const KERN_PROC_GID: ::c_int = 11;
791 pub const KERN_PROC_PATHNAME: ::c_int = 12;
792 pub const KERN_PROC_OVMMAP: ::c_int = 13;
793 pub const KERN_PROC_OFILEDESC: ::c_int = 14;
794 pub const KERN_PROC_KSTACK: ::c_int = 15;
795 pub const KERN_PROC_INC_THREAD: ::c_int = 0x10;
796 pub const KERN_PROC_VMMAP: ::c_int = 32;
797 pub const KERN_PROC_FILEDESC: ::c_int = 33;
798 pub const KERN_PROC_GROUPS: ::c_int = 34;
799 pub const KERN_PROC_ENV: ::c_int = 35;
800 pub const KERN_PROC_AUXV: ::c_int = 36;
801 pub const KERN_PROC_RLIMIT: ::c_int = 37;
802 pub const KERN_PROC_PS_STRINGS: ::c_int = 38;
803 pub const KERN_PROC_UMASK: ::c_int = 39;
804 pub const KERN_PROC_OSREL: ::c_int = 40;
805 pub const KERN_PROC_SIGTRAMP: ::c_int = 41;
806 pub const KIPC_MAXSOCKBUF: ::c_int = 1;
807 pub const KIPC_SOCKBUF_WASTE: ::c_int = 2;
808 pub const KIPC_SOMAXCONN: ::c_int = 3;
809 pub const KIPC_MAX_LINKHDR: ::c_int = 4;
810 pub const KIPC_MAX_PROTOHDR: ::c_int = 5;
811 pub const KIPC_MAX_HDR: ::c_int = 6;
812 pub const KIPC_MAX_DATALEN: ::c_int = 7;
813 pub const HW_MACHINE: ::c_int = 1;
814 pub const HW_MODEL: ::c_int = 2;
815 pub const HW_NCPU: ::c_int = 3;
816 pub const HW_BYTEORDER: ::c_int = 4;
817 pub const HW_PHYSMEM: ::c_int = 5;
818 pub const HW_USERMEM: ::c_int = 6;
819 pub const HW_PAGESIZE: ::c_int = 7;
820 pub const HW_DISKNAMES: ::c_int = 8;
821 pub const HW_DISKSTATS: ::c_int = 9;
822 pub const HW_FLOATINGPT: ::c_int = 10;
823 pub const HW_MACHINE_ARCH: ::c_int = 11;
824 pub const HW_REALMEM: ::c_int = 12;
825 pub const USER_CS_PATH: ::c_int = 1;
826 pub const USER_BC_BASE_MAX: ::c_int = 2;
827 pub const USER_BC_DIM_MAX: ::c_int = 3;
828 pub const USER_BC_SCALE_MAX: ::c_int = 4;
829 pub const USER_BC_STRING_MAX: ::c_int = 5;
830 pub const USER_COLL_WEIGHTS_MAX: ::c_int = 6;
831 pub const USER_EXPR_NEST_MAX: ::c_int = 7;
832 pub const USER_LINE_MAX: ::c_int = 8;
833 pub const USER_RE_DUP_MAX: ::c_int = 9;
834 pub const USER_POSIX2_VERSION: ::c_int = 10;
835 pub const USER_POSIX2_C_BIND: ::c_int = 11;
836 pub const USER_POSIX2_C_DEV: ::c_int = 12;
837 pub const USER_POSIX2_CHAR_TERM: ::c_int = 13;
838 pub const USER_POSIX2_FORT_DEV: ::c_int = 14;
839 pub const USER_POSIX2_FORT_RUN: ::c_int = 15;
840 pub const USER_POSIX2_LOCALEDEF: ::c_int = 16;
841 pub const USER_POSIX2_SW_DEV: ::c_int = 17;
842 pub const USER_POSIX2_UPE: ::c_int = 18;
843 pub const USER_STREAM_MAX: ::c_int = 19;
844 pub const USER_TZNAME_MAX: ::c_int = 20;
845 pub const CTL_P1003_1B_ASYNCHRONOUS_IO: ::c_int = 1;
846 pub const CTL_P1003_1B_MAPPED_FILES: ::c_int = 2;
847 pub const CTL_P1003_1B_MEMLOCK: ::c_int = 3;
848 pub const CTL_P1003_1B_MEMLOCK_RANGE: ::c_int = 4;
849 pub const CTL_P1003_1B_MEMORY_PROTECTION: ::c_int = 5;
850 pub const CTL_P1003_1B_MESSAGE_PASSING: ::c_int = 6;
851 pub const CTL_P1003_1B_PRIORITIZED_IO: ::c_int = 7;
852 pub const CTL_P1003_1B_PRIORITY_SCHEDULING: ::c_int = 8;
853 pub const CTL_P1003_1B_REALTIME_SIGNALS: ::c_int = 9;
854 pub const CTL_P1003_1B_SEMAPHORES: ::c_int = 10;
855 pub const CTL_P1003_1B_FSYNC: ::c_int = 11;
856 pub const CTL_P1003_1B_SHARED_MEMORY_OBJECTS: ::c_int = 12;
857 pub const CTL_P1003_1B_SYNCHRONIZED_IO: ::c_int = 13;
858 pub const CTL_P1003_1B_TIMERS: ::c_int = 14;
859 pub const CTL_P1003_1B_AIO_LISTIO_MAX: ::c_int = 15;
860 pub const CTL_P1003_1B_AIO_MAX: ::c_int = 16;
861 pub const CTL_P1003_1B_AIO_PRIO_DELTA_MAX: ::c_int = 17;
862 pub const CTL_P1003_1B_DELAYTIMER_MAX: ::c_int = 18;
863 pub const CTL_P1003_1B_MQ_OPEN_MAX: ::c_int = 19;
864 pub const CTL_P1003_1B_PAGESIZE: ::c_int = 20;
865 pub const CTL_P1003_1B_RTSIG_MAX: ::c_int = 21;
866 pub const CTL_P1003_1B_SEM_NSEMS_MAX: ::c_int = 22;
867 pub const CTL_P1003_1B_SEM_VALUE_MAX: ::c_int = 23;
868 pub const CTL_P1003_1B_SIGQUEUE_MAX: ::c_int = 24;
869 pub const CTL_P1003_1B_TIMER_MAX: ::c_int = 25;
870 pub const TIOCGPTN: ::c_uint = 0x4004740f;
871 pub const TIOCPTMASTER: ::c_uint = 0x2000741c;
872 pub const TIOCSIG: ::c_uint = 0x2004745f;
873 pub const TIOCM_DCD: ::c_int = 0x40;
874 pub const H4DISC: ::c_int = 0x7;
875 
876 pub const BIOCSETFNR: ::c_ulong = 0x80104282;
877 
878 pub const FIONWRITE: ::c_ulong = 0x40046677;
879 pub const FIONSPACE: ::c_ulong = 0x40046676;
880 pub const FIOSEEKDATA: ::c_ulong = 0xc0086661;
881 pub const FIOSEEKHOLE: ::c_ulong = 0xc0086662;
882 
883 pub const JAIL_API_VERSION: u32 = 2;
884 pub const JAIL_CREATE: ::c_int = 0x01;
885 pub const JAIL_UPDATE: ::c_int = 0x02;
886 pub const JAIL_ATTACH: ::c_int = 0x04;
887 pub const JAIL_DYING: ::c_int = 0x08;
888 pub const JAIL_SET_MASK: ::c_int = 0x0f;
889 pub const JAIL_GET_MASK: ::c_int = 0x08;
890 pub const JAIL_SYS_DISABLE: ::c_int = 0;
891 pub const JAIL_SYS_NEW: ::c_int = 1;
892 pub const JAIL_SYS_INHERIT: ::c_int = 2;
893 
894 pub const MNT_ACLS: ::c_int = 0x08000000;
895 pub const MNT_BYFSID: ::c_int = 0x08000000;
896 pub const MNT_GJOURNAL: ::c_int = 0x02000000;
897 pub const MNT_MULTILABEL: ::c_int = 0x04000000;
898 pub const MNT_NFS4ACLS: ::c_int = 0x00000010;
899 pub const MNT_SNAPSHOT: ::c_int = 0x01000000;
900 pub const MNT_UNION: ::c_int = 0x00000020;
901 pub const MNT_EXPUBLIC: ::c_int = 0x20000000;
902 pub const MNT_NONBUSY: ::c_int = 0x04000000;
903 
904 pub const SO_BINTIME: ::c_int = 0x2000;
905 pub const SO_NO_OFFLOAD: ::c_int = 0x4000;
906 pub const SO_NO_DDP: ::c_int = 0x8000;
907 pub const SO_REUSEPORT_LB: ::c_int = 0x10000;
908 pub const SO_LABEL: ::c_int = 0x1009;
909 pub const SO_PEERLABEL: ::c_int = 0x1010;
910 pub const SO_LISTENQLIMIT: ::c_int = 0x1011;
911 pub const SO_LISTENQLEN: ::c_int = 0x1012;
912 pub const SO_LISTENINCQLEN: ::c_int = 0x1013;
913 pub const SO_SETFIB: ::c_int = 0x1014;
914 pub const SO_USER_COOKIE: ::c_int = 0x1015;
915 pub const SO_PROTOCOL: ::c_int = 0x1016;
916 pub const SO_PROTOTYPE: ::c_int = SO_PROTOCOL;
917 pub const SO_VENDOR: ::c_int = 0x80000000;
918 
919 pub const LOCAL_CREDS: ::c_int = 2;
920 pub const LOCAL_CONNWAIT: ::c_int = 4;
921 pub const LOCAL_VENDOR: ::c_int = SO_VENDOR;
922 
923 pub const PT_LWPINFO: ::c_int = 13;
924 pub const PT_GETNUMLWPS: ::c_int = 14;
925 pub const PT_GETLWPLIST: ::c_int = 15;
926 pub const PT_CLEARSTEP: ::c_int = 16;
927 pub const PT_SETSTEP: ::c_int = 17;
928 pub const PT_SUSPEND: ::c_int = 18;
929 pub const PT_RESUME: ::c_int = 19;
930 pub const PT_TO_SCE: ::c_int = 20;
931 pub const PT_TO_SCX: ::c_int = 21;
932 pub const PT_SYSCALL: ::c_int = 22;
933 pub const PT_FOLLOW_FORK: ::c_int = 23;
934 pub const PT_LWP_EVENTS: ::c_int = 24;
935 pub const PT_GET_EVENT_MASK: ::c_int = 25;
936 pub const PT_SET_EVENT_MASK: ::c_int = 26;
937 pub const PT_GETREGS: ::c_int = 33;
938 pub const PT_SETREGS: ::c_int = 34;
939 pub const PT_GETFPREGS: ::c_int = 35;
940 pub const PT_SETFPREGS: ::c_int = 36;
941 pub const PT_GETDBREGS: ::c_int = 37;
942 pub const PT_SETDBREGS: ::c_int = 38;
943 pub const PT_VM_TIMESTAMP: ::c_int = 40;
944 pub const PT_VM_ENTRY: ::c_int = 41;
945 pub const PT_FIRSTMACH: ::c_int = 64;
946 
947 pub const PTRACE_EXEC: ::c_int = 0x0001;
948 pub const PTRACE_SCE: ::c_int = 0x0002;
949 pub const PTRACE_SCX: ::c_int = 0x0004;
950 pub const PTRACE_SYSCALL: ::c_int = PTRACE_SCE | PTRACE_SCX;
951 pub const PTRACE_FORK: ::c_int = 0x0008;
952 pub const PTRACE_LWP: ::c_int = 0x0010;
953 pub const PTRACE_VFORK: ::c_int = 0x0020;
954 pub const PTRACE_DEFAULT: ::c_int = PTRACE_EXEC;
955 
956 pub const PROC_SPROTECT: ::c_int = 1;
957 pub const PROC_REAP_ACQUIRE: ::c_int = 2;
958 pub const PROC_REAP_RELEASE: ::c_int = 3;
959 pub const PROC_REAP_STATUS: ::c_int = 4;
960 pub const PROC_REAP_GETPIDS: ::c_int = 5;
961 pub const PROC_REAP_KILL: ::c_int = 6;
962 pub const PROC_TRACE_CTL: ::c_int = 7;
963 pub const PROC_TRACE_STATUS: ::c_int = 8;
964 pub const PROC_TRAPCAP_CTL: ::c_int = 9;
965 pub const PROC_TRAPCAP_STATUS: ::c_int = 10;
966 pub const PROC_PDEATHSIG_CTL: ::c_int = 11;
967 pub const PROC_PDEATHSIG_STATUS: ::c_int = 12;
968 pub const PROC_STACKGAP_CTL: ::c_int = 17;
969 pub const PROC_STACKGAP_STATUS: ::c_int = 18;
970 
971 pub const AF_SLOW: ::c_int = 33;
972 pub const AF_SCLUSTER: ::c_int = 34;
973 pub const AF_ARP: ::c_int = 35;
974 pub const AF_BLUETOOTH: ::c_int = 36;
975 pub const AF_IEEE80211: ::c_int = 37;
976 pub const AF_INET_SDP: ::c_int = 40;
977 pub const AF_INET6_SDP: ::c_int = 42;
978 
979 // https://github.com/freebsd/freebsd/blob/master/sys/net/if.h#L140
980 pub const IFF_UP: ::c_int = 0x1; // (n) interface is up
981 pub const IFF_BROADCAST: ::c_int = 0x2; // (i) broadcast address valid
982 pub const IFF_DEBUG: ::c_int = 0x4; // (n) turn on debugging
983 pub const IFF_LOOPBACK: ::c_int = 0x8; // (i) is a loopback net
984 pub const IFF_POINTOPOINT: ::c_int = 0x10; // (i) is a point-to-point link
985                                            // 0x20           was IFF_SMART
986 pub const IFF_RUNNING: ::c_int = 0x40; // (d) resources allocated
987 #[doc(hidden)]
988 #[deprecated(
989     since = "0.2.54",
990     note = "IFF_DRV_RUNNING is deprecated. Use the portable IFF_RUNNING instead"
991 )]
992 pub const IFF_DRV_RUNNING: ::c_int = 0x40;
993 pub const IFF_NOARP: ::c_int = 0x80; // (n) no address resolution protocol
994 pub const IFF_PROMISC: ::c_int = 0x100; // (n) receive all packets
995 pub const IFF_ALLMULTI: ::c_int = 0x200; // (n) receive all multicast packets
996 pub const IFF_OACTIVE: ::c_int = 0x400; // (d) tx hardware queue is full
997 #[doc(hidden)]
998 #[deprecated(since = "0.2.54", note = "Use the portable `IFF_OACTIVE` instead")]
999 pub const IFF_DRV_OACTIVE: ::c_int = 0x400;
1000 pub const IFF_SIMPLEX: ::c_int = 0x800; // (i) can't hear own transmissions
1001 pub const IFF_LINK0: ::c_int = 0x1000; // per link layer defined bit
1002 pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit
1003 pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit
1004 pub const IFF_ALTPHYS: ::c_int = IFF_LINK2; // use alternate physical connection
1005 pub const IFF_MULTICAST: ::c_int = 0x8000; // (i) supports multicast
1006                                            // (i) unconfigurable using ioctl(2)
1007 pub const IFF_CANTCONFIG: ::c_int = 0x10000;
1008 pub const IFF_PPROMISC: ::c_int = 0x20000; // (n) user-requested promisc mode
1009 pub const IFF_MONITOR: ::c_int = 0x40000; // (n) user-requested monitor mode
1010 pub const IFF_STATICARP: ::c_int = 0x80000; // (n) static ARP
1011 pub const IFF_DYING: ::c_int = 0x200000; // (n) interface is winding down
1012 pub const IFF_RENAMING: ::c_int = 0x400000; // (n) interface is being renamed
1013 
1014 // sys/netinet/in.h
1015 // Protocols (RFC 1700)
1016 // NOTE: These are in addition to the constants defined in src/unix/mod.rs
1017 
1018 // IPPROTO_IP defined in src/unix/mod.rs
1019 /// IP6 hop-by-hop options
1020 pub const IPPROTO_HOPOPTS: ::c_int = 0;
1021 // IPPROTO_ICMP defined in src/unix/mod.rs
1022 /// group mgmt protocol
1023 pub const IPPROTO_IGMP: ::c_int = 2;
1024 /// gateway^2 (deprecated)
1025 pub const IPPROTO_GGP: ::c_int = 3;
1026 /// for compatibility
1027 pub const IPPROTO_IPIP: ::c_int = 4;
1028 // IPPROTO_TCP defined in src/unix/mod.rs
1029 /// Stream protocol II.
1030 pub const IPPROTO_ST: ::c_int = 7;
1031 /// exterior gateway protocol
1032 pub const IPPROTO_EGP: ::c_int = 8;
1033 /// private interior gateway
1034 pub const IPPROTO_PIGP: ::c_int = 9;
1035 /// BBN RCC Monitoring
1036 pub const IPPROTO_RCCMON: ::c_int = 10;
1037 /// network voice protocol
1038 pub const IPPROTO_NVPII: ::c_int = 11;
1039 /// pup
1040 pub const IPPROTO_PUP: ::c_int = 12;
1041 /// Argus
1042 pub const IPPROTO_ARGUS: ::c_int = 13;
1043 /// EMCON
1044 pub const IPPROTO_EMCON: ::c_int = 14;
1045 /// Cross Net Debugger
1046 pub const IPPROTO_XNET: ::c_int = 15;
1047 /// Chaos
1048 pub const IPPROTO_CHAOS: ::c_int = 16;
1049 // IPPROTO_UDP defined in src/unix/mod.rs
1050 /// Multiplexing
1051 pub const IPPROTO_MUX: ::c_int = 18;
1052 /// DCN Measurement Subsystems
1053 pub const IPPROTO_MEAS: ::c_int = 19;
1054 /// Host Monitoring
1055 pub const IPPROTO_HMP: ::c_int = 20;
1056 /// Packet Radio Measurement
1057 pub const IPPROTO_PRM: ::c_int = 21;
1058 /// xns idp
1059 pub const IPPROTO_IDP: ::c_int = 22;
1060 /// Trunk-1
1061 pub const IPPROTO_TRUNK1: ::c_int = 23;
1062 /// Trunk-2
1063 pub const IPPROTO_TRUNK2: ::c_int = 24;
1064 /// Leaf-1
1065 pub const IPPROTO_LEAF1: ::c_int = 25;
1066 /// Leaf-2
1067 pub const IPPROTO_LEAF2: ::c_int = 26;
1068 /// Reliable Data
1069 pub const IPPROTO_RDP: ::c_int = 27;
1070 /// Reliable Transaction
1071 pub const IPPROTO_IRTP: ::c_int = 28;
1072 /// tp-4 w/ class negotiation
1073 pub const IPPROTO_TP: ::c_int = 29;
1074 /// Bulk Data Transfer
1075 pub const IPPROTO_BLT: ::c_int = 30;
1076 /// Network Services
1077 pub const IPPROTO_NSP: ::c_int = 31;
1078 /// Merit Internodal
1079 pub const IPPROTO_INP: ::c_int = 32;
1080 #[doc(hidden)]
1081 #[deprecated(
1082     since = "0.2.72",
1083     note = "IPPROTO_SEP is deprecated. Use IPPROTO_DCCP instead"
1084 )]
1085 pub const IPPROTO_SEP: ::c_int = 33;
1086 /// Datagram Congestion Control Protocol
1087 pub const IPPROTO_DCCP: ::c_int = 33;
1088 /// Third Party Connect
1089 pub const IPPROTO_3PC: ::c_int = 34;
1090 /// InterDomain Policy Routing
1091 pub const IPPROTO_IDPR: ::c_int = 35;
1092 /// XTP
1093 pub const IPPROTO_XTP: ::c_int = 36;
1094 /// Datagram Delivery
1095 pub const IPPROTO_DDP: ::c_int = 37;
1096 /// Control Message Transport
1097 pub const IPPROTO_CMTP: ::c_int = 38;
1098 /// TP++ Transport
1099 pub const IPPROTO_TPXX: ::c_int = 39;
1100 /// IL transport protocol
1101 pub const IPPROTO_IL: ::c_int = 40;
1102 // IPPROTO_IPV6 defined in src/unix/mod.rs
1103 /// Source Demand Routing
1104 pub const IPPROTO_SDRP: ::c_int = 42;
1105 /// IP6 routing header
1106 pub const IPPROTO_ROUTING: ::c_int = 43;
1107 /// IP6 fragmentation header
1108 pub const IPPROTO_FRAGMENT: ::c_int = 44;
1109 /// InterDomain Routing
1110 pub const IPPROTO_IDRP: ::c_int = 45;
1111 /// resource reservation
1112 pub const IPPROTO_RSVP: ::c_int = 46;
1113 /// General Routing Encap.
1114 pub const IPPROTO_GRE: ::c_int = 47;
1115 /// Mobile Host Routing
1116 pub const IPPROTO_MHRP: ::c_int = 48;
1117 /// BHA
1118 pub const IPPROTO_BHA: ::c_int = 49;
1119 /// IP6 Encap Sec. Payload
1120 pub const IPPROTO_ESP: ::c_int = 50;
1121 /// IP6 Auth Header
1122 pub const IPPROTO_AH: ::c_int = 51;
1123 /// Integ. Net Layer Security
1124 pub const IPPROTO_INLSP: ::c_int = 52;
1125 /// IP with encryption
1126 pub const IPPROTO_SWIPE: ::c_int = 53;
1127 /// Next Hop Resolution
1128 pub const IPPROTO_NHRP: ::c_int = 54;
1129 /// IP Mobility
1130 pub const IPPROTO_MOBILE: ::c_int = 55;
1131 /// Transport Layer Security
1132 pub const IPPROTO_TLSP: ::c_int = 56;
1133 /// SKIP
1134 pub const IPPROTO_SKIP: ::c_int = 57;
1135 // IPPROTO_ICMPV6 defined in src/unix/mod.rs
1136 /// IP6 no next header
1137 pub const IPPROTO_NONE: ::c_int = 59;
1138 /// IP6 destination option
1139 pub const IPPROTO_DSTOPTS: ::c_int = 60;
1140 /// any host internal protocol
1141 pub const IPPROTO_AHIP: ::c_int = 61;
1142 /// CFTP
1143 pub const IPPROTO_CFTP: ::c_int = 62;
1144 /// "hello" routing protocol
1145 pub const IPPROTO_HELLO: ::c_int = 63;
1146 /// SATNET/Backroom EXPAK
1147 pub const IPPROTO_SATEXPAK: ::c_int = 64;
1148 /// Kryptolan
1149 pub const IPPROTO_KRYPTOLAN: ::c_int = 65;
1150 /// Remote Virtual Disk
1151 pub const IPPROTO_RVD: ::c_int = 66;
1152 /// Pluribus Packet Core
1153 pub const IPPROTO_IPPC: ::c_int = 67;
1154 /// Any distributed FS
1155 pub const IPPROTO_ADFS: ::c_int = 68;
1156 /// Satnet Monitoring
1157 pub const IPPROTO_SATMON: ::c_int = 69;
1158 /// VISA Protocol
1159 pub const IPPROTO_VISA: ::c_int = 70;
1160 /// Packet Core Utility
1161 pub const IPPROTO_IPCV: ::c_int = 71;
1162 /// Comp. Prot. Net. Executive
1163 pub const IPPROTO_CPNX: ::c_int = 72;
1164 /// Comp. Prot. HeartBeat
1165 pub const IPPROTO_CPHB: ::c_int = 73;
1166 /// Wang Span Network
1167 pub const IPPROTO_WSN: ::c_int = 74;
1168 /// Packet Video Protocol
1169 pub const IPPROTO_PVP: ::c_int = 75;
1170 /// BackRoom SATNET Monitoring
1171 pub const IPPROTO_BRSATMON: ::c_int = 76;
1172 /// Sun net disk proto (temp.)
1173 pub const IPPROTO_ND: ::c_int = 77;
1174 /// WIDEBAND Monitoring
1175 pub const IPPROTO_WBMON: ::c_int = 78;
1176 /// WIDEBAND EXPAK
1177 pub const IPPROTO_WBEXPAK: ::c_int = 79;
1178 /// ISO cnlp
1179 pub const IPPROTO_EON: ::c_int = 80;
1180 /// VMTP
1181 pub const IPPROTO_VMTP: ::c_int = 81;
1182 /// Secure VMTP
1183 pub const IPPROTO_SVMTP: ::c_int = 82;
1184 /// Banyon VINES
1185 pub const IPPROTO_VINES: ::c_int = 83;
1186 /// TTP
1187 pub const IPPROTO_TTP: ::c_int = 84;
1188 /// NSFNET-IGP
1189 pub const IPPROTO_IGP: ::c_int = 85;
1190 /// dissimilar gateway prot.
1191 pub const IPPROTO_DGP: ::c_int = 86;
1192 /// TCF
1193 pub const IPPROTO_TCF: ::c_int = 87;
1194 /// Cisco/GXS IGRP
1195 pub const IPPROTO_IGRP: ::c_int = 88;
1196 /// OSPFIGP
1197 pub const IPPROTO_OSPFIGP: ::c_int = 89;
1198 /// Strite RPC protocol
1199 pub const IPPROTO_SRPC: ::c_int = 90;
1200 /// Locus Address Resoloution
1201 pub const IPPROTO_LARP: ::c_int = 91;
1202 /// Multicast Transport
1203 pub const IPPROTO_MTP: ::c_int = 92;
1204 /// AX.25 Frames
1205 pub const IPPROTO_AX25: ::c_int = 93;
1206 /// IP encapsulated in IP
1207 pub const IPPROTO_IPEIP: ::c_int = 94;
1208 /// Mobile Int.ing control
1209 pub const IPPROTO_MICP: ::c_int = 95;
1210 /// Semaphore Comm. security
1211 pub const IPPROTO_SCCSP: ::c_int = 96;
1212 /// Ethernet IP encapsulation
1213 pub const IPPROTO_ETHERIP: ::c_int = 97;
1214 /// encapsulation header
1215 pub const IPPROTO_ENCAP: ::c_int = 98;
1216 /// any private encr. scheme
1217 pub const IPPROTO_APES: ::c_int = 99;
1218 /// GMTP
1219 pub const IPPROTO_GMTP: ::c_int = 100;
1220 /// payload compression (IPComp)
1221 pub const IPPROTO_IPCOMP: ::c_int = 108;
1222 /// SCTP
1223 pub const IPPROTO_SCTP: ::c_int = 132;
1224 /// IPv6 Mobility Header
1225 pub const IPPROTO_MH: ::c_int = 135;
1226 /// UDP-Lite
1227 pub const IPPROTO_UDPLITE: ::c_int = 136;
1228 /// IP6 Host Identity Protocol
1229 pub const IPPROTO_HIP: ::c_int = 139;
1230 /// IP6 Shim6 Protocol
1231 pub const IPPROTO_SHIM6: ::c_int = 140;
1232 
1233 /* 101-254: Partly Unassigned */
1234 /// Protocol Independent Mcast
1235 pub const IPPROTO_PIM: ::c_int = 103;
1236 /// CARP
1237 pub const IPPROTO_CARP: ::c_int = 112;
1238 /// PGM
1239 pub const IPPROTO_PGM: ::c_int = 113;
1240 /// MPLS-in-IP
1241 pub const IPPROTO_MPLS: ::c_int = 137;
1242 /// PFSYNC
1243 pub const IPPROTO_PFSYNC: ::c_int = 240;
1244 
1245 /* 255: Reserved */
1246 /* BSD Private, local use, namespace incursion, no longer used */
1247 /// OLD divert pseudo-proto
1248 pub const IPPROTO_OLD_DIVERT: ::c_int = 254;
1249 pub const IPPROTO_MAX: ::c_int = 256;
1250 /// last return value of *_input(), meaning "all job for this pkt is done".
1251 pub const IPPROTO_DONE: ::c_int = 257;
1252 
1253 /* Only used internally, so can be outside the range of valid IP protocols. */
1254 /// divert pseudo-protocol
1255 pub const IPPROTO_DIVERT: ::c_int = 258;
1256 /// SeND pseudo-protocol
1257 pub const IPPROTO_SEND: ::c_int = 259;
1258 
1259 // sys/netinet/TCP.h
1260 pub const TCP_MD5SIG: ::c_int = 16;
1261 pub const TCP_INFO: ::c_int = 32;
1262 pub const TCP_CONGESTION: ::c_int = 64;
1263 pub const TCP_CCALGOOPT: ::c_int = 65;
1264 pub const TCP_KEEPINIT: ::c_int = 128;
1265 pub const TCP_FASTOPEN: ::c_int = 1025;
1266 pub const TCP_PCAP_OUT: ::c_int = 2048;
1267 pub const TCP_PCAP_IN: ::c_int = 4096;
1268 
1269 pub const IP_BINDANY: ::c_int = 24;
1270 pub const IP_BINDMULTI: ::c_int = 25;
1271 pub const IP_RSS_LISTEN_BUCKET: ::c_int = 26;
1272 pub const IP_ORIGDSTADDR: ::c_int = 27;
1273 pub const IP_RECVORIGDSTADDR: ::c_int = IP_ORIGDSTADDR;
1274 
1275 pub const IP_RECVTOS: ::c_int = 68;
1276 
1277 pub const IPV6_BINDANY: ::c_int = 64;
1278 pub const IPV6_ORIGDSTADDR: ::c_int = 72;
1279 pub const IPV6_RECVORIGDSTADDR: ::c_int = IPV6_ORIGDSTADDR;
1280 
1281 pub const PF_SLOW: ::c_int = AF_SLOW;
1282 pub const PF_SCLUSTER: ::c_int = AF_SCLUSTER;
1283 pub const PF_ARP: ::c_int = AF_ARP;
1284 pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH;
1285 pub const PF_IEEE80211: ::c_int = AF_IEEE80211;
1286 pub const PF_INET_SDP: ::c_int = AF_INET_SDP;
1287 pub const PF_INET6_SDP: ::c_int = AF_INET6_SDP;
1288 
1289 pub const NET_RT_DUMP: ::c_int = 1;
1290 pub const NET_RT_FLAGS: ::c_int = 2;
1291 pub const NET_RT_IFLIST: ::c_int = 3;
1292 pub const NET_RT_IFMALIST: ::c_int = 4;
1293 pub const NET_RT_IFLISTL: ::c_int = 5;
1294 
1295 // System V IPC
1296 pub const IPC_INFO: ::c_int = 3;
1297 pub const MSG_NOERROR: ::c_int = 0o10000;
1298 pub const SHM_LOCK: ::c_int = 11;
1299 pub const SHM_UNLOCK: ::c_int = 12;
1300 pub const SHM_STAT: ::c_int = 13;
1301 pub const SHM_INFO: ::c_int = 14;
1302 pub const SHM_ANON: *mut ::c_char = 1 as *mut ::c_char;
1303 
1304 // The *_MAXID constants never should've been used outside of the
1305 // FreeBSD base system.  And with the exception of CTL_P1003_1B_MAXID,
1306 // they were all removed in svn r262489.  They remain here for backwards
1307 // compatibility only, and are scheduled to be removed in libc 1.0.0.
1308 #[doc(hidden)]
1309 #[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")]
1310 pub const CTL_MAXID: ::c_int = 10;
1311 #[doc(hidden)]
1312 #[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")]
1313 pub const KERN_MAXID: ::c_int = 38;
1314 #[doc(hidden)]
1315 #[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")]
1316 pub const HW_MAXID: ::c_int = 13;
1317 #[doc(hidden)]
1318 #[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")]
1319 pub const USER_MAXID: ::c_int = 21;
1320 #[doc(hidden)]
1321 #[deprecated(since = "0.2.74", note = "Removed in FreeBSD 13")]
1322 pub const CTL_P1003_1B_MAXID: ::c_int = 26;
1323 
1324 pub const MSG_NOTIFICATION: ::c_int = 0x00002000;
1325 pub const MSG_NBIO: ::c_int = 0x00004000;
1326 pub const MSG_COMPAT: ::c_int = 0x00008000;
1327 pub const MSG_CMSG_CLOEXEC: ::c_int = 0x00040000;
1328 pub const MSG_NOSIGNAL: ::c_int = 0x20000;
1329 
1330 // utmpx entry types
1331 pub const EMPTY: ::c_short = 0;
1332 pub const BOOT_TIME: ::c_short = 1;
1333 pub const OLD_TIME: ::c_short = 2;
1334 pub const NEW_TIME: ::c_short = 3;
1335 pub const USER_PROCESS: ::c_short = 4;
1336 pub const INIT_PROCESS: ::c_short = 5;
1337 pub const LOGIN_PROCESS: ::c_short = 6;
1338 pub const DEAD_PROCESS: ::c_short = 7;
1339 pub const SHUTDOWN_TIME: ::c_short = 8;
1340 // utmp database types
1341 pub const UTXDB_ACTIVE: ::c_int = 0;
1342 pub const UTXDB_LASTLOGIN: ::c_int = 1;
1343 pub const UTXDB_LOG: ::c_int = 2;
1344 
1345 pub const LC_COLLATE_MASK: ::c_int = 1 << 0;
1346 pub const LC_CTYPE_MASK: ::c_int = 1 << 1;
1347 pub const LC_MONETARY_MASK: ::c_int = 1 << 2;
1348 pub const LC_NUMERIC_MASK: ::c_int = 1 << 3;
1349 pub const LC_TIME_MASK: ::c_int = 1 << 4;
1350 pub const LC_MESSAGES_MASK: ::c_int = 1 << 5;
1351 pub const LC_ALL_MASK: ::c_int = LC_COLLATE_MASK
1352     | LC_CTYPE_MASK
1353     | LC_MESSAGES_MASK
1354     | LC_MONETARY_MASK
1355     | LC_NUMERIC_MASK
1356     | LC_TIME_MASK;
1357 
1358 pub const WSTOPPED: ::c_int = 2; // same as WUNTRACED
1359 pub const WCONTINUED: ::c_int = 4;
1360 pub const WNOWAIT: ::c_int = 8;
1361 pub const WEXITED: ::c_int = 16;
1362 pub const WTRAPPED: ::c_int = 32;
1363 
1364 // FreeBSD defines a great many more of these, we only expose the
1365 // standardized ones.
1366 pub const P_PID: idtype_t = 0;
1367 pub const P_PGID: idtype_t = 2;
1368 pub const P_ALL: idtype_t = 7;
1369 
1370 pub const UTIME_OMIT: c_long = -2;
1371 pub const UTIME_NOW: c_long = -1;
1372 
1373 pub const B460800: ::speed_t = 460800;
1374 pub const B921600: ::speed_t = 921600;
1375 
1376 pub const AT_FDCWD: ::c_int = -100;
1377 pub const AT_EACCESS: ::c_int = 0x100;
1378 pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x200;
1379 pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400;
1380 pub const AT_REMOVEDIR: ::c_int = 0x800;
1381 
1382 pub const AT_NULL: ::c_int = 0;
1383 pub const AT_IGNORE: ::c_int = 1;
1384 pub const AT_EXECFD: ::c_int = 2;
1385 pub const AT_PHDR: ::c_int = 3;
1386 pub const AT_PHENT: ::c_int = 4;
1387 pub const AT_PHNUM: ::c_int = 5;
1388 pub const AT_PAGESZ: ::c_int = 6;
1389 pub const AT_BASE: ::c_int = 7;
1390 pub const AT_FLAGS: ::c_int = 8;
1391 pub const AT_ENTRY: ::c_int = 9;
1392 pub const AT_NOTELF: ::c_int = 10;
1393 pub const AT_UID: ::c_int = 11;
1394 pub const AT_EUID: ::c_int = 12;
1395 pub const AT_GID: ::c_int = 13;
1396 pub const AT_EGID: ::c_int = 14;
1397 pub const AT_EXECPATH: ::c_int = 15;
1398 
1399 pub const TABDLY: ::tcflag_t = 0x00000004;
1400 pub const TAB0: ::tcflag_t = 0x00000000;
1401 pub const TAB3: ::tcflag_t = 0x00000004;
1402 
1403 pub const _PC_ACL_NFS4: ::c_int = 64;
1404 
1405 pub const _SC_CPUSET_SIZE: ::c_int = 122;
1406 
1407 pub const _UUID_NODE_LEN: usize = 6;
1408 
1409 // Flags which can be passed to pdfork(2)
1410 pub const PD_DAEMON: ::c_int = 0x00000001;
1411 pub const PD_CLOEXEC: ::c_int = 0x00000002;
1412 pub const PD_ALLOWED_AT_FORK: ::c_int = PD_DAEMON | PD_CLOEXEC;
1413 
1414 // Values for struct rtprio (type_ field)
1415 pub const RTP_PRIO_REALTIME: ::c_ushort = 2;
1416 pub const RTP_PRIO_NORMAL: ::c_ushort = 3;
1417 pub const RTP_PRIO_IDLE: ::c_ushort = 4;
1418 
1419 pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x01;
1420 pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x02;
1421 pub const POSIX_SPAWN_SETSCHEDPARAM: ::c_int = 0x04;
1422 pub const POSIX_SPAWN_SETSCHEDULER: ::c_int = 0x08;
1423 pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x10;
1424 pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x20;
1425 
1426 // Flags for chflags(2)
1427 pub const UF_SYSTEM: ::c_ulong = 0x00000080;
1428 pub const UF_SPARSE: ::c_ulong = 0x00000100;
1429 pub const UF_OFFLINE: ::c_ulong = 0x00000200;
1430 pub const UF_REPARSE: ::c_ulong = 0x00000400;
1431 pub const UF_ARCHIVE: ::c_ulong = 0x00000800;
1432 pub const UF_READONLY: ::c_ulong = 0x00001000;
1433 pub const UF_HIDDEN: ::c_ulong = 0x00008000;
1434 pub const SF_SNAPSHOT: ::c_ulong = 0x00200000;
1435 
1436 pub const F_OGETLK: ::c_int = 7;
1437 pub const F_OSETLK: ::c_int = 8;
1438 pub const F_OSETLKW: ::c_int = 9;
1439 pub const F_DUP2FD: ::c_int = 10;
1440 pub const F_SETLK_REMOTE: ::c_int = 14;
1441 pub const F_READAHEAD: ::c_int = 15;
1442 pub const F_RDAHEAD: ::c_int = 16;
1443 pub const F_DUP2FD_CLOEXEC: ::c_int = 18;
1444 
1445 // For realhostname* api
1446 pub const HOSTNAME_FOUND: ::c_int = 0;
1447 pub const HOSTNAME_INCORRECTNAME: ::c_int = 1;
1448 pub const HOSTNAME_INVALIDADDR: ::c_int = 2;
1449 pub const HOSTNAME_INVALIDNAME: ::c_int = 3;
1450 
1451 // For rfork
1452 pub const RFFDG: ::c_int = 4;
1453 pub const RFPROC: ::c_int = 16;
1454 pub const RFMEM: ::c_int = 32;
1455 pub const RFNOWAIT: ::c_int = 64;
1456 pub const RFCFDG: ::c_int = 4096;
1457 pub const RFTHREAD: ::c_int = 8192;
1458 pub const RFLINUXTHPN: ::c_int = 65536;
1459 pub const RFTSIGZMB: ::c_int = 524288;
1460 pub const RFSPAWN: ::c_int = 2147483648;
1461 
1462 pub const MALLOCX_ZERO: ::c_int = 0x40;
1463 
1464 const_fn! {
1465     {const} fn _ALIGN(p: usize) -> usize {
1466         (p + _ALIGNBYTES) & !_ALIGNBYTES
1467     }
1468 }
1469 
1470 f! {
1471     pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar {
1472         (cmsg as *mut ::c_uchar)
1473             .offset(_ALIGN(::mem::size_of::<::cmsghdr>()) as isize)
1474     }
1475 
1476     pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
1477         _ALIGN(::mem::size_of::<::cmsghdr>()) as ::c_uint + length
1478     }
1479 
1480     pub fn CMSG_NXTHDR(mhdr: *const ::msghdr, cmsg: *const ::cmsghdr)
1481         -> *mut ::cmsghdr
1482     {
1483         if cmsg.is_null() {
1484             return ::CMSG_FIRSTHDR(mhdr);
1485         };
1486         let next = cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize)
1487             + _ALIGN(::mem::size_of::<::cmsghdr>());
1488         let max = (*mhdr).msg_control as usize
1489             + (*mhdr).msg_controllen as usize;
1490         if next > max {
1491             0 as *mut ::cmsghdr
1492         } else {
1493             (cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize))
1494                 as *mut ::cmsghdr
1495         }
1496     }
1497 
1498     pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {
1499         (_ALIGN(::mem::size_of::<::cmsghdr>()) + _ALIGN(length as usize))
1500             as ::c_uint
1501     }
1502 
1503     pub fn MALLOCX_ALIGN(lg: ::c_uint) -> ::c_int {
1504         ffsl(lg as ::c_long - 1)
1505     }
1506 
1507     pub {const} fn MALLOCX_TCACHE(tc: ::c_int) -> ::c_int {
1508         (tc + 2) << 8 as ::c_int
1509     }
1510 
1511     pub {const} fn MALLOCX_ARENA(a: ::c_int) -> ::c_int {
1512         (a + 1) << 20 as ::c_int
1513     }
1514 
1515     pub fn SOCKCREDSIZE(ngrps: usize) -> usize {
1516         let ngrps = if ngrps > 0 {
1517             ngrps - 1
1518         } else {
1519             0
1520         };
1521         ::mem::size_of::<sockcred>() + ::mem::size_of::<::gid_t>() * ngrps
1522     }
1523 
1524     pub fn uname(buf: *mut ::utsname) -> ::c_int {
1525         __xuname(256, buf as *mut ::c_void)
1526     }
1527 
1528     pub fn CPU_ZERO(cpuset: &mut cpuset_t) -> () {
1529         for slot in cpuset.__bits.iter_mut() {
1530             *slot = 0;
1531         }
1532     }
1533 
1534     pub fn CPU_FILL(cpuset: &mut cpuset_t) -> () {
1535         for slot in cpuset.__bits.iter_mut() {
1536             *slot = !0;
1537         }
1538     }
1539 
1540     pub fn CPU_SET(cpu: usize, cpuset: &mut cpuset_t) -> () {
1541         let bitset_bits = ::mem::size_of::<::c_long>();
1542         let (idx, offset) = (cpu / bitset_bits, cpu % bitset_bits);
1543         cpuset.__bits[idx] |= 1 << offset;
1544         ()
1545     }
1546 
1547     pub fn CPU_CLR(cpu: usize, cpuset: &mut cpuset_t) -> () {
1548         let bitset_bits = ::mem::size_of::<::c_long>();
1549         let (idx, offset) = (cpu / bitset_bits, cpu % bitset_bits);
1550         cpuset.__bits[idx] &= !(1 << offset);
1551         ()
1552     }
1553 
1554     pub fn CPU_ISSET(cpu: usize, cpuset: &cpuset_t) -> bool {
1555         let bitset_bits = ::mem::size_of::<::c_long>();
1556         let (idx, offset) = (cpu / bitset_bits, cpu % bitset_bits);
1557         0 != cpuset.__bits[idx] & (1 << offset)
1558     }
1559 }
1560 
1561 safe_f! {
1562     pub {const} fn WIFSIGNALED(status: ::c_int) -> bool {
1563         (status & 0o177) != 0o177 && (status & 0o177) != 0 && status != 0x13
1564     }
1565 }
1566 
1567 extern "C" {
__error() -> *mut ::c_int1568     pub fn __error() -> *mut ::c_int;
1569 
aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int1570     pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
aio_error(aiocbp: *const aiocb) -> ::c_int1571     pub fn aio_error(aiocbp: *const aiocb) -> ::c_int;
aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int1572     pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
aio_read(aiocbp: *mut aiocb) -> ::c_int1573     pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int;
aio_return(aiocbp: *mut aiocb) -> ::ssize_t1574     pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t;
aio_suspend( aiocb_list: *const *const aiocb, nitems: ::c_int, timeout: *const ::timespec, ) -> ::c_int1575     pub fn aio_suspend(
1576         aiocb_list: *const *const aiocb,
1577         nitems: ::c_int,
1578         timeout: *const ::timespec,
1579     ) -> ::c_int;
aio_write(aiocbp: *mut aiocb) -> ::c_int1580     pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
1581 
extattr_delete_fd( fd: ::c_int, attrnamespace: ::c_int, attrname: *const ::c_char, ) -> ::c_int1582     pub fn extattr_delete_fd(
1583         fd: ::c_int,
1584         attrnamespace: ::c_int,
1585         attrname: *const ::c_char,
1586     ) -> ::c_int;
extattr_delete_file( path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char, ) -> ::c_int1587     pub fn extattr_delete_file(
1588         path: *const ::c_char,
1589         attrnamespace: ::c_int,
1590         attrname: *const ::c_char,
1591     ) -> ::c_int;
extattr_delete_link( path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char, ) -> ::c_int1592     pub fn extattr_delete_link(
1593         path: *const ::c_char,
1594         attrnamespace: ::c_int,
1595         attrname: *const ::c_char,
1596     ) -> ::c_int;
extattr_get_fd( fd: ::c_int, attrnamespace: ::c_int, attrname: *const ::c_char, data: *mut ::c_void, nbytes: ::size_t, ) -> ::ssize_t1597     pub fn extattr_get_fd(
1598         fd: ::c_int,
1599         attrnamespace: ::c_int,
1600         attrname: *const ::c_char,
1601         data: *mut ::c_void,
1602         nbytes: ::size_t,
1603     ) -> ::ssize_t;
extattr_get_file( path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char, data: *mut ::c_void, nbytes: ::size_t, ) -> ::ssize_t1604     pub fn extattr_get_file(
1605         path: *const ::c_char,
1606         attrnamespace: ::c_int,
1607         attrname: *const ::c_char,
1608         data: *mut ::c_void,
1609         nbytes: ::size_t,
1610     ) -> ::ssize_t;
extattr_get_link( path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char, data: *mut ::c_void, nbytes: ::size_t, ) -> ::ssize_t1611     pub fn extattr_get_link(
1612         path: *const ::c_char,
1613         attrnamespace: ::c_int,
1614         attrname: *const ::c_char,
1615         data: *mut ::c_void,
1616         nbytes: ::size_t,
1617     ) -> ::ssize_t;
extattr_list_fd( fd: ::c_int, attrnamespace: ::c_int, data: *mut ::c_void, nbytes: ::size_t, ) -> ::ssize_t1618     pub fn extattr_list_fd(
1619         fd: ::c_int,
1620         attrnamespace: ::c_int,
1621         data: *mut ::c_void,
1622         nbytes: ::size_t,
1623     ) -> ::ssize_t;
extattr_list_file( path: *const ::c_char, attrnamespace: ::c_int, data: *mut ::c_void, nbytes: ::size_t, ) -> ::ssize_t1624     pub fn extattr_list_file(
1625         path: *const ::c_char,
1626         attrnamespace: ::c_int,
1627         data: *mut ::c_void,
1628         nbytes: ::size_t,
1629     ) -> ::ssize_t;
extattr_list_link( path: *const ::c_char, attrnamespace: ::c_int, data: *mut ::c_void, nbytes: ::size_t, ) -> ::ssize_t1630     pub fn extattr_list_link(
1631         path: *const ::c_char,
1632         attrnamespace: ::c_int,
1633         data: *mut ::c_void,
1634         nbytes: ::size_t,
1635     ) -> ::ssize_t;
extattr_set_fd( fd: ::c_int, attrnamespace: ::c_int, attrname: *const ::c_char, data: *const ::c_void, nbytes: ::size_t, ) -> ::ssize_t1636     pub fn extattr_set_fd(
1637         fd: ::c_int,
1638         attrnamespace: ::c_int,
1639         attrname: *const ::c_char,
1640         data: *const ::c_void,
1641         nbytes: ::size_t,
1642     ) -> ::ssize_t;
extattr_set_file( path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char, data: *const ::c_void, nbytes: ::size_t, ) -> ::ssize_t1643     pub fn extattr_set_file(
1644         path: *const ::c_char,
1645         attrnamespace: ::c_int,
1646         attrname: *const ::c_char,
1647         data: *const ::c_void,
1648         nbytes: ::size_t,
1649     ) -> ::ssize_t;
extattr_set_link( path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char, data: *const ::c_void, nbytes: ::size_t, ) -> ::ssize_t1650     pub fn extattr_set_link(
1651         path: *const ::c_char,
1652         attrnamespace: ::c_int,
1653         attrname: *const ::c_char,
1654         data: *const ::c_void,
1655         nbytes: ::size_t,
1656     ) -> ::ssize_t;
1657 
jail(jail: *mut ::jail) -> ::c_int1658     pub fn jail(jail: *mut ::jail) -> ::c_int;
jail_attach(jid: ::c_int) -> ::c_int1659     pub fn jail_attach(jid: ::c_int) -> ::c_int;
jail_remove(jid: ::c_int) -> ::c_int1660     pub fn jail_remove(jid: ::c_int) -> ::c_int;
jail_get(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int1661     pub fn jail_get(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int;
jail_set(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int1662     pub fn jail_set(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int;
1663 
lio_listio( mode: ::c_int, aiocb_list: *const *mut aiocb, nitems: ::c_int, sevp: *mut sigevent, ) -> ::c_int1664     pub fn lio_listio(
1665         mode: ::c_int,
1666         aiocb_list: *const *mut aiocb,
1667         nitems: ::c_int,
1668         sevp: *mut sigevent,
1669     ) -> ::c_int;
1670 
posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int1671     pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int;
posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, advise: ::c_int) -> ::c_int1672     pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, advise: ::c_int) -> ::c_int;
mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int1673     pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int;
mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int1674     pub fn mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int;
1675 
getutxuser(user: *const ::c_char) -> *mut utmpx1676     pub fn getutxuser(user: *const ::c_char) -> *mut utmpx;
setutxdb(_type: ::c_int, file: *const ::c_char) -> ::c_int1677     pub fn setutxdb(_type: ::c_int, file: *const ::c_char) -> ::c_int;
1678 
aio_waitcomplete(iocbp: *mut *mut aiocb, timeout: *mut ::timespec) -> ::ssize_t1679     pub fn aio_waitcomplete(iocbp: *mut *mut aiocb, timeout: *mut ::timespec) -> ::ssize_t;
mq_getfd_np(mqd: ::mqd_t) -> ::c_int1680     pub fn mq_getfd_np(mqd: ::mqd_t) -> ::c_int;
1681 
waitid( idtype: idtype_t, id: ::id_t, infop: *mut ::siginfo_t, options: ::c_int, ) -> ::c_int1682     pub fn waitid(
1683         idtype: idtype_t,
1684         id: ::id_t,
1685         infop: *mut ::siginfo_t,
1686         options: ::c_int,
1687     ) -> ::c_int;
1688 
ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t1689     pub fn ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t;
shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int1690     pub fn shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int;
shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void1691     pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void;
shmdt(shmaddr: *const ::c_void) -> ::c_int1692     pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int;
shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int1693     pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int;
msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut ::msqid_ds) -> ::c_int1694     pub fn msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut ::msqid_ds) -> ::c_int;
msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int1695     pub fn msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int;
msgsnd( msqid: ::c_int, msgp: *const ::c_void, msgsz: ::size_t, msgflg: ::c_int, ) -> ::c_int1696     pub fn msgsnd(
1697         msqid: ::c_int,
1698         msgp: *const ::c_void,
1699         msgsz: ::size_t,
1700         msgflg: ::c_int,
1701     ) -> ::c_int;
cfmakesane(termios: *mut ::termios)1702     pub fn cfmakesane(termios: *mut ::termios);
fexecve( fd: ::c_int, argv: *const *const ::c_char, envp: *const *const ::c_char, ) -> ::c_int1703     pub fn fexecve(
1704         fd: ::c_int,
1705         argv: *const *const ::c_char,
1706         envp: *const *const ::c_char,
1707     ) -> ::c_int;
1708 
pdfork(fdp: *mut ::c_int, flags: ::c_int) -> ::pid_t1709     pub fn pdfork(fdp: *mut ::c_int, flags: ::c_int) -> ::pid_t;
pdgetpid(fd: ::c_int, pidp: *mut ::pid_t) -> ::c_int1710     pub fn pdgetpid(fd: ::c_int, pidp: *mut ::pid_t) -> ::c_int;
pdkill(fd: ::c_int, signum: ::c_int) -> ::c_int1711     pub fn pdkill(fd: ::c_int, signum: ::c_int) -> ::c_int;
1712 
rtprio_thread(function: ::c_int, lwpid: ::lwpid_t, rtp: *mut super::rtprio) -> ::c_int1713     pub fn rtprio_thread(function: ::c_int, lwpid: ::lwpid_t, rtp: *mut super::rtprio) -> ::c_int;
1714 
posix_spawn( pid: *mut ::pid_t, path: *const ::c_char, file_actions: *const ::posix_spawn_file_actions_t, attrp: *const ::posix_spawnattr_t, argv: *const *mut ::c_char, envp: *const *mut ::c_char, ) -> ::c_int1715     pub fn posix_spawn(
1716         pid: *mut ::pid_t,
1717         path: *const ::c_char,
1718         file_actions: *const ::posix_spawn_file_actions_t,
1719         attrp: *const ::posix_spawnattr_t,
1720         argv: *const *mut ::c_char,
1721         envp: *const *mut ::c_char,
1722     ) -> ::c_int;
posix_spawnp( pid: *mut ::pid_t, file: *const ::c_char, file_actions: *const ::posix_spawn_file_actions_t, attrp: *const ::posix_spawnattr_t, argv: *const *mut ::c_char, envp: *const *mut ::c_char, ) -> ::c_int1723     pub fn posix_spawnp(
1724         pid: *mut ::pid_t,
1725         file: *const ::c_char,
1726         file_actions: *const ::posix_spawn_file_actions_t,
1727         attrp: *const ::posix_spawnattr_t,
1728         argv: *const *mut ::c_char,
1729         envp: *const *mut ::c_char,
1730     ) -> ::c_int;
posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int1731     pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int;
posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int1732     pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int;
posix_spawnattr_getsigdefault( attr: *const posix_spawnattr_t, default: *mut ::sigset_t, ) -> ::c_int1733     pub fn posix_spawnattr_getsigdefault(
1734         attr: *const posix_spawnattr_t,
1735         default: *mut ::sigset_t,
1736     ) -> ::c_int;
posix_spawnattr_setsigdefault( attr: *mut posix_spawnattr_t, default: *const ::sigset_t, ) -> ::c_int1737     pub fn posix_spawnattr_setsigdefault(
1738         attr: *mut posix_spawnattr_t,
1739         default: *const ::sigset_t,
1740     ) -> ::c_int;
posix_spawnattr_getsigmask( attr: *const posix_spawnattr_t, default: *mut ::sigset_t, ) -> ::c_int1741     pub fn posix_spawnattr_getsigmask(
1742         attr: *const posix_spawnattr_t,
1743         default: *mut ::sigset_t,
1744     ) -> ::c_int;
posix_spawnattr_setsigmask( attr: *mut posix_spawnattr_t, default: *const ::sigset_t, ) -> ::c_int1745     pub fn posix_spawnattr_setsigmask(
1746         attr: *mut posix_spawnattr_t,
1747         default: *const ::sigset_t,
1748     ) -> ::c_int;
posix_spawnattr_getflags( attr: *const posix_spawnattr_t, flags: *mut ::c_short, ) -> ::c_int1749     pub fn posix_spawnattr_getflags(
1750         attr: *const posix_spawnattr_t,
1751         flags: *mut ::c_short,
1752     ) -> ::c_int;
posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int1753     pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int;
posix_spawnattr_getpgroup( attr: *const posix_spawnattr_t, flags: *mut ::pid_t, ) -> ::c_int1754     pub fn posix_spawnattr_getpgroup(
1755         attr: *const posix_spawnattr_t,
1756         flags: *mut ::pid_t,
1757     ) -> ::c_int;
posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int1758     pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int;
posix_spawnattr_getschedpolicy( attr: *const posix_spawnattr_t, flags: *mut ::c_int, ) -> ::c_int1759     pub fn posix_spawnattr_getschedpolicy(
1760         attr: *const posix_spawnattr_t,
1761         flags: *mut ::c_int,
1762     ) -> ::c_int;
posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: ::c_int) -> ::c_int1763     pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: ::c_int) -> ::c_int;
posix_spawnattr_getschedparam( attr: *const posix_spawnattr_t, param: *mut ::sched_param, ) -> ::c_int1764     pub fn posix_spawnattr_getschedparam(
1765         attr: *const posix_spawnattr_t,
1766         param: *mut ::sched_param,
1767     ) -> ::c_int;
posix_spawnattr_setschedparam( attr: *mut posix_spawnattr_t, param: *const ::sched_param, ) -> ::c_int1768     pub fn posix_spawnattr_setschedparam(
1769         attr: *mut posix_spawnattr_t,
1770         param: *const ::sched_param,
1771     ) -> ::c_int;
1772 
posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> ::c_int1773     pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> ::c_int;
posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> ::c_int1774     pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> ::c_int;
posix_spawn_file_actions_addopen( actions: *mut posix_spawn_file_actions_t, fd: ::c_int, path: *const ::c_char, oflag: ::c_int, mode: ::mode_t, ) -> ::c_int1775     pub fn posix_spawn_file_actions_addopen(
1776         actions: *mut posix_spawn_file_actions_t,
1777         fd: ::c_int,
1778         path: *const ::c_char,
1779         oflag: ::c_int,
1780         mode: ::mode_t,
1781     ) -> ::c_int;
posix_spawn_file_actions_addclose( actions: *mut posix_spawn_file_actions_t, fd: ::c_int, ) -> ::c_int1782     pub fn posix_spawn_file_actions_addclose(
1783         actions: *mut posix_spawn_file_actions_t,
1784         fd: ::c_int,
1785     ) -> ::c_int;
posix_spawn_file_actions_adddup2( actions: *mut posix_spawn_file_actions_t, fd: ::c_int, newfd: ::c_int, ) -> ::c_int1786     pub fn posix_spawn_file_actions_adddup2(
1787         actions: *mut posix_spawn_file_actions_t,
1788         fd: ::c_int,
1789         newfd: ::c_int,
1790     ) -> ::c_int;
1791 
uuidgen(store: *mut uuid, count: ::c_int) -> ::c_int1792     pub fn uuidgen(store: *mut uuid, count: ::c_int) -> ::c_int;
1793 
thr_kill(id: ::c_long, sig: ::c_int) -> ::c_int1794     pub fn thr_kill(id: ::c_long, sig: ::c_int) -> ::c_int;
thr_kill2(pid: ::pid_t, id: ::c_long, sig: ::c_int) -> ::c_int1795     pub fn thr_kill2(pid: ::pid_t, id: ::c_long, sig: ::c_int) -> ::c_int;
thr_self(tid: *mut ::c_long) -> ::c_int1796     pub fn thr_self(tid: *mut ::c_long) -> ::c_int;
pthread_getthreadid_np() -> ::c_int1797     pub fn pthread_getthreadid_np() -> ::c_int;
pthread_getaffinity_np( td: ::pthread_t, cpusetsize: ::size_t, cpusetp: *mut cpuset_t, ) -> ::c_int1798     pub fn pthread_getaffinity_np(
1799         td: ::pthread_t,
1800         cpusetsize: ::size_t,
1801         cpusetp: *mut cpuset_t,
1802     ) -> ::c_int;
pthread_setaffinity_np( td: ::pthread_t, cpusetsize: ::size_t, cpusetp: *const cpuset_t, ) -> ::c_int1803     pub fn pthread_setaffinity_np(
1804         td: ::pthread_t,
1805         cpusetsize: ::size_t,
1806         cpusetp: *const cpuset_t,
1807     ) -> ::c_int;
1808 
pthread_spin_init(lock: *mut pthread_spinlock_t, pshared: ::c_int) -> ::c_int1809     pub fn pthread_spin_init(lock: *mut pthread_spinlock_t, pshared: ::c_int) -> ::c_int;
pthread_spin_destroy(lock: *mut pthread_spinlock_t) -> ::c_int1810     pub fn pthread_spin_destroy(lock: *mut pthread_spinlock_t) -> ::c_int;
pthread_spin_lock(lock: *mut pthread_spinlock_t) -> ::c_int1811     pub fn pthread_spin_lock(lock: *mut pthread_spinlock_t) -> ::c_int;
pthread_spin_trylock(lock: *mut pthread_spinlock_t) -> ::c_int1812     pub fn pthread_spin_trylock(lock: *mut pthread_spinlock_t) -> ::c_int;
pthread_spin_unlock(lock: *mut pthread_spinlock_t) -> ::c_int1813     pub fn pthread_spin_unlock(lock: *mut pthread_spinlock_t) -> ::c_int;
1814 
1815     #[cfg_attr(all(target_os = "freebsd", freebsd11), link_name = "statfs@FBSD_1.0")]
statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int1816     pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
1817     #[cfg_attr(all(target_os = "freebsd", freebsd11), link_name = "fstatfs@FBSD_1.0")]
fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int1818     pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
1819 
dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int1820     pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int;
__xuname(nmln: ::c_int, buf: *mut ::c_void) -> ::c_int1821     pub fn __xuname(nmln: ::c_int, buf: *mut ::c_void) -> ::c_int;
1822 
sendmmsg( sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::size_t, flags: ::c_int, ) -> ::ssize_t1823     pub fn sendmmsg(
1824         sockfd: ::c_int,
1825         msgvec: *mut ::mmsghdr,
1826         vlen: ::size_t,
1827         flags: ::c_int,
1828     ) -> ::ssize_t;
recvmmsg( sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::size_t, flags: ::c_int, timeout: *const ::timespec, ) -> ::ssize_t1829     pub fn recvmmsg(
1830         sockfd: ::c_int,
1831         msgvec: *mut ::mmsghdr,
1832         vlen: ::size_t,
1833         flags: ::c_int,
1834         timeout: *const ::timespec,
1835     ) -> ::ssize_t;
memmem( haystack: *const ::c_void, haystacklen: ::size_t, needle: *const ::c_void, needlelen: ::size_t, ) -> *mut ::c_void1836     pub fn memmem(
1837         haystack: *const ::c_void,
1838         haystacklen: ::size_t,
1839         needle: *const ::c_void,
1840         needlelen: ::size_t,
1841     ) -> *mut ::c_void;
1842 
nmount(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int1843     pub fn nmount(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int;
setproctitle(fmt: *const ::c_char, ...)1844     pub fn setproctitle(fmt: *const ::c_char, ...);
rfork(flags: ::c_int) -> ::c_int1845     pub fn rfork(flags: ::c_int) -> ::c_int;
cpuset_getaffinity( level: cpulevel_t, which: cpuwhich_t, id: ::id_t, setsize: ::size_t, mask: *mut cpuset_t, ) -> ::c_int1846     pub fn cpuset_getaffinity(
1847         level: cpulevel_t,
1848         which: cpuwhich_t,
1849         id: ::id_t,
1850         setsize: ::size_t,
1851         mask: *mut cpuset_t,
1852     ) -> ::c_int;
cpuset_setaffinity( level: cpulevel_t, which: cpuwhich_t, id: ::id_t, setsize: ::size_t, mask: *const cpuset_t, ) -> ::c_int1853     pub fn cpuset_setaffinity(
1854         level: cpulevel_t,
1855         which: cpuwhich_t,
1856         id: ::id_t,
1857         setsize: ::size_t,
1858         mask: *const cpuset_t,
1859     ) -> ::c_int;
cap_enter() -> ::c_int1860     pub fn cap_enter() -> ::c_int;
cap_getmode(modep: *mut ::c_uint) -> ::c_int1861     pub fn cap_getmode(modep: *mut ::c_uint) -> ::c_int;
__cap_rights_init(version: ::c_int, rights: *mut cap_rights_t, ...) -> *mut cap_rights_t1862     pub fn __cap_rights_init(version: ::c_int, rights: *mut cap_rights_t, ...)
1863         -> *mut cap_rights_t;
__cap_rights_set(rights: *mut cap_rights_t, ...) -> *mut cap_rights_t1864     pub fn __cap_rights_set(rights: *mut cap_rights_t, ...) -> *mut cap_rights_t;
__cap_rights_clear(rights: *mut cap_rights_t, ...) -> *mut cap_rights_t1865     pub fn __cap_rights_clear(rights: *mut cap_rights_t, ...) -> *mut cap_rights_t;
__cap_rights_is_set(rights: *const cap_rights_t, ...) -> bool1866     pub fn __cap_rights_is_set(rights: *const cap_rights_t, ...) -> bool;
cap_rights_is_valid(rights: *const cap_rights_t) -> bool1867     pub fn cap_rights_is_valid(rights: *const cap_rights_t) -> bool;
cap_rights_limit(fd: ::c_int, rights: *const cap_rights_t) -> ::c_int1868     pub fn cap_rights_limit(fd: ::c_int, rights: *const cap_rights_t) -> ::c_int;
cap_rights_merge(dst: *mut cap_rights_t, src: *const cap_rights_t) -> *mut cap_rights_t1869     pub fn cap_rights_merge(dst: *mut cap_rights_t, src: *const cap_rights_t) -> *mut cap_rights_t;
cap_rights_remove(dst: *mut cap_rights_t, src: *const cap_rights_t) -> *mut cap_rights_t1870     pub fn cap_rights_remove(dst: *mut cap_rights_t, src: *const cap_rights_t)
1871         -> *mut cap_rights_t;
cap_rights_contains(big: *const cap_rights_t, little: *const cap_rights_t) -> bool1872     pub fn cap_rights_contains(big: *const cap_rights_t, little: *const cap_rights_t) -> bool;
1873 
reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void1874     pub fn reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void;
1875 
ffs(value: ::c_int) -> ::c_int1876     pub fn ffs(value: ::c_int) -> ::c_int;
ffsl(value: ::c_long) -> ::c_int1877     pub fn ffsl(value: ::c_long) -> ::c_int;
ffsll(value: ::c_longlong) -> ::c_int1878     pub fn ffsll(value: ::c_longlong) -> ::c_int;
fls(value: ::c_int) -> ::c_int1879     pub fn fls(value: ::c_int) -> ::c_int;
flsl(value: ::c_long) -> ::c_int1880     pub fn flsl(value: ::c_long) -> ::c_int;
flsll(value: ::c_longlong) -> ::c_int1881     pub fn flsll(value: ::c_longlong) -> ::c_int;
malloc_usable_size(ptr: *const ::c_void) -> ::size_t1882     pub fn malloc_usable_size(ptr: *const ::c_void) -> ::size_t;
malloc_stats_print( write_cb: unsafe extern "C" fn(*mut ::c_void, *const ::c_char), cbopaque: *mut ::c_void, opt: *const ::c_char, )1883     pub fn malloc_stats_print(
1884         write_cb: unsafe extern "C" fn(*mut ::c_void, *const ::c_char),
1885         cbopaque: *mut ::c_void,
1886         opt: *const ::c_char,
1887     );
mallctl( name: *const ::c_char, oldp: *mut ::c_void, oldlenp: *mut ::size_t, newp: *mut ::c_void, newlen: ::size_t, ) -> ::c_int1888     pub fn mallctl(
1889         name: *const ::c_char,
1890         oldp: *mut ::c_void,
1891         oldlenp: *mut ::size_t,
1892         newp: *mut ::c_void,
1893         newlen: ::size_t,
1894     ) -> ::c_int;
mallctlnametomib( name: *const ::c_char, mibp: *mut ::size_t, miplen: *mut ::size_t, ) -> ::c_int1895     pub fn mallctlnametomib(
1896         name: *const ::c_char,
1897         mibp: *mut ::size_t,
1898         miplen: *mut ::size_t,
1899     ) -> ::c_int;
mallctlbymib( mib: *const ::size_t, mible: ::size_t, oldp: *mut ::c_void, oldlenp: *mut ::size_t, newp: *mut ::c_void, newlen: ::size_t, ) -> ::c_int1900     pub fn mallctlbymib(
1901         mib: *const ::size_t,
1902         mible: ::size_t,
1903         oldp: *mut ::c_void,
1904         oldlenp: *mut ::size_t,
1905         newp: *mut ::c_void,
1906         newlen: ::size_t,
1907     ) -> ::c_int;
mallocx(size: ::size_t, flags: ::c_int) -> *mut ::c_void1908     pub fn mallocx(size: ::size_t, flags: ::c_int) -> *mut ::c_void;
rallocx(ptr: *mut ::c_void, size: ::size_t, flags: ::c_int) -> *mut ::c_void1909     pub fn rallocx(ptr: *mut ::c_void, size: ::size_t, flags: ::c_int) -> *mut ::c_void;
xallocx(ptr: *mut ::c_void, size: ::size_t, extra: ::size_t, flags: ::c_int) -> ::size_t1910     pub fn xallocx(ptr: *mut ::c_void, size: ::size_t, extra: ::size_t, flags: ::c_int)
1911         -> ::size_t;
sallocx(ptr: *const ::c_void, flags: ::c_int) -> ::size_t1912     pub fn sallocx(ptr: *const ::c_void, flags: ::c_int) -> ::size_t;
dallocx(ptr: *mut ::c_void, flags: ::c_int)1913     pub fn dallocx(ptr: *mut ::c_void, flags: ::c_int);
sdallocx(ptr: *mut ::c_void, size: ::size_t, flags: ::c_int)1914     pub fn sdallocx(ptr: *mut ::c_void, size: ::size_t, flags: ::c_int);
nallocx(size: ::size_t, flags: ::c_int) -> ::size_t1915     pub fn nallocx(size: ::size_t, flags: ::c_int) -> ::size_t;
1916 
procctl(idtype: ::idtype_t, id: ::id_t, cmd: ::c_int, data: *mut ::c_void) -> ::c_int1917     pub fn procctl(idtype: ::idtype_t, id: ::id_t, cmd: ::c_int, data: *mut ::c_void) -> ::c_int;
1918 }
1919 
1920 #[link(name = "util")]
1921 extern "C" {
extattr_namespace_to_string( attrnamespace: ::c_int, string: *mut *mut ::c_char, ) -> ::c_int1922     pub fn extattr_namespace_to_string(
1923         attrnamespace: ::c_int,
1924         string: *mut *mut ::c_char,
1925     ) -> ::c_int;
extattr_string_to_namespace( string: *const ::c_char, attrnamespace: *mut ::c_int, ) -> ::c_int1926     pub fn extattr_string_to_namespace(
1927         string: *const ::c_char,
1928         attrnamespace: *mut ::c_int,
1929     ) -> ::c_int;
realhostname(host: *mut ::c_char, hsize: ::size_t, ip: *const ::in_addr) -> ::c_int1930     pub fn realhostname(host: *mut ::c_char, hsize: ::size_t, ip: *const ::in_addr) -> ::c_int;
realhostname_sa( host: *mut ::c_char, hsize: ::size_t, addr: *mut ::sockaddr, addrlen: ::c_int, ) -> ::c_int1931     pub fn realhostname_sa(
1932         host: *mut ::c_char,
1933         hsize: ::size_t,
1934         addr: *mut ::sockaddr,
1935         addrlen: ::c_int,
1936     ) -> ::c_int;
1937 
kld_isloaded(name: *const ::c_char) -> ::c_int1938     pub fn kld_isloaded(name: *const ::c_char) -> ::c_int;
kld_load(name: *const ::c_char) -> ::c_int1939     pub fn kld_load(name: *const ::c_char) -> ::c_int;
1940 
kinfo_getvmmap(pid: ::pid_t, cntp: *mut ::c_int) -> *mut kinfo_vmentry1941     pub fn kinfo_getvmmap(pid: ::pid_t, cntp: *mut ::c_int) -> *mut kinfo_vmentry;
1942 
hexdump(ptr: *const ::c_void, length: ::c_int, hdr: *const ::c_char, flags: ::c_int)1943     pub fn hexdump(ptr: *const ::c_void, length: ::c_int, hdr: *const ::c_char, flags: ::c_int);
humanize_number( buf: *mut ::c_char, len: ::size_t, number: i64, suffix: *const ::c_char, scale: ::c_int, flags: ::c_int, ) -> ::c_int1944     pub fn humanize_number(
1945         buf: *mut ::c_char,
1946         len: ::size_t,
1947         number: i64,
1948         suffix: *const ::c_char,
1949         scale: ::c_int,
1950         flags: ::c_int,
1951     ) -> ::c_int;
1952 }
1953 
1954 #[link(name = "procstat")]
1955 extern "C" {
procstat_open_sysctl() -> *mut procstat1956     pub fn procstat_open_sysctl() -> *mut procstat;
procstat_getfiles( procstat: *mut procstat, kp: *mut kinfo_proc, mmapped: ::c_int, ) -> *mut filestat_list1957     pub fn procstat_getfiles(
1958         procstat: *mut procstat,
1959         kp: *mut kinfo_proc,
1960         mmapped: ::c_int,
1961     ) -> *mut filestat_list;
procstat_freefiles(procstat: *mut procstat, head: *mut filestat_list)1962     pub fn procstat_freefiles(procstat: *mut procstat, head: *mut filestat_list);
procstat_getprocs( procstat: *mut procstat, what: ::c_int, arg: ::c_int, count: *mut ::c_uint, ) -> *mut kinfo_proc1963     pub fn procstat_getprocs(
1964         procstat: *mut procstat,
1965         what: ::c_int,
1966         arg: ::c_int,
1967         count: *mut ::c_uint,
1968     ) -> *mut kinfo_proc;
procstat_freeprocs(procstat: *mut procstat, p: *mut kinfo_proc)1969     pub fn procstat_freeprocs(procstat: *mut procstat, p: *mut kinfo_proc);
procstat_getvmmap( procstat: *mut procstat, kp: *mut kinfo_proc, count: *mut ::c_uint, ) -> *mut kinfo_vmentry1970     pub fn procstat_getvmmap(
1971         procstat: *mut procstat,
1972         kp: *mut kinfo_proc,
1973         count: *mut ::c_uint,
1974     ) -> *mut kinfo_vmentry;
procstat_freevmmap(procstat: *mut procstat, vmmap: *mut kinfo_vmentry)1975     pub fn procstat_freevmmap(procstat: *mut procstat, vmmap: *mut kinfo_vmentry);
procstat_close(procstat: *mut procstat)1976     pub fn procstat_close(procstat: *mut procstat);
1977 }
1978 
1979 #[link(name = "rt")]
1980 extern "C" {
timer_create(clock_id: clockid_t, evp: *mut sigevent, timerid: *mut timer_t) -> ::c_int1981     pub fn timer_create(clock_id: clockid_t, evp: *mut sigevent, timerid: *mut timer_t) -> ::c_int;
timer_delete(timerid: timer_t) -> ::c_int1982     pub fn timer_delete(timerid: timer_t) -> ::c_int;
timer_getoverrun(timerid: timer_t) -> ::c_int1983     pub fn timer_getoverrun(timerid: timer_t) -> ::c_int;
timer_gettime(timerid: timer_t, value: *mut itimerspec) -> ::c_int1984     pub fn timer_gettime(timerid: timer_t, value: *mut itimerspec) -> ::c_int;
timer_settime( timerid: timer_t, flags: ::c_int, value: *const itimerspec, ovalue: *mut itimerspec, ) -> ::c_int1985     pub fn timer_settime(
1986         timerid: timer_t,
1987         flags: ::c_int,
1988         value: *const itimerspec,
1989         ovalue: *mut itimerspec,
1990     ) -> ::c_int;
1991 }
1992 
1993 cfg_if! {
1994     if #[cfg(freebsd13)] {
1995         mod freebsd13;
1996         pub use self::freebsd13::*;
1997     } else if #[cfg(freebsd12)] {
1998         mod freebsd12;
1999         pub use self::freebsd12::*;
2000     } else if #[cfg(any(freebsd10, freebsd11))] {
2001         mod freebsd11;
2002         pub use self::freebsd11::*;
2003     } else {
2004         // Unknown freebsd version
2005     }
2006 }
2007 
2008 cfg_if! {
2009     if #[cfg(target_arch = "x86")] {
2010         mod x86;
2011         pub use self::x86::*;
2012     } else if #[cfg(target_arch = "x86_64")] {
2013         mod x86_64;
2014         pub use self::x86_64::*;
2015     } else if #[cfg(target_arch = "aarch64")] {
2016         mod aarch64;
2017         pub use self::aarch64::*;
2018     } else if #[cfg(target_arch = "arm")] {
2019         mod arm;
2020         pub use self::arm::*;
2021     } else if #[cfg(target_arch = "powerpc64")] {
2022         mod powerpc64;
2023         pub use self::powerpc64::*;
2024     } else if #[cfg(target_arch = "powerpc")] {
2025         mod powerpc;
2026         pub use self::powerpc::*;
2027     } else {
2028         // Unknown target_arch
2029     }
2030 }
2031