1 pub type fflags_t = u32;
2 pub type clock_t = i32;
3 
4 pub type vm_prot_t = u_char;
5 pub type kvaddr_t = u64;
6 pub type segsz_t = isize;
7 pub type __fixpt_t = u32;
8 pub type fixpt_t = __fixpt_t;
9 pub type __lwpid_t = i32;
10 pub type lwpid_t = __lwpid_t;
11 pub type blksize_t = i32;
12 pub type clockid_t = ::c_int;
13 pub type sem_t = _sem;
14 pub type timer_t = *mut __c_anonymous__timer;
15 
16 pub type fsblkcnt_t = u64;
17 pub type fsfilcnt_t = u64;
18 pub type idtype_t = ::c_uint;
19 
20 pub type msglen_t = ::c_ulong;
21 pub type msgqnum_t = ::c_ulong;
22 
23 pub type cpulevel_t = ::c_int;
24 pub type cpuwhich_t = ::c_int;
25 
26 pub type mqd_t = *mut ::c_void;
27 pub type posix_spawnattr_t = *mut ::c_void;
28 pub type posix_spawn_file_actions_t = *mut ::c_void;
29 
30 pub type pthread_spinlock_t = *mut __c_anonymous_pthread_spinlock;
31 pub type pthread_barrierattr_t = *mut __c_anonymous_pthread_barrierattr;
32 pub type pthread_barrier_t = *mut __c_anonymous_pthread_barrier;
33 
34 pub type uuid_t = ::uuid;
35 pub type u_int = ::c_uint;
36 pub type u_char = ::c_uchar;
37 pub type u_long = ::c_ulong;
38 pub type u_short = ::c_ushort;
39 
40 // It's an alias over "struct __kvm_t". However, its fields aren't supposed to be used directly,
41 // making the type definition system dependent. Better not bind it exactly.
42 pub type kvm_t = ::c_void;
43 
44 s! {
45     pub struct aiocb {
46         pub aio_fildes: ::c_int,
47         pub aio_offset: ::off_t,
48         pub aio_buf: *mut ::c_void,
49         pub aio_nbytes: ::size_t,
50         __unused1: [::c_int; 2],
51         __unused2: *mut ::c_void,
52         pub aio_lio_opcode: ::c_int,
53         pub aio_reqprio: ::c_int,
54         // unused 3 through 5 are the __aiocb_private structure
55         __unused3: ::c_long,
56         __unused4: ::c_long,
57         __unused5: *mut ::c_void,
58         pub aio_sigevent: sigevent
59     }
60 
61     pub struct jail {
62         pub version: u32,
63         pub path: *mut ::c_char,
64         pub hostname: *mut ::c_char,
65         pub jailname: *mut ::c_char,
66         pub ip4s: ::c_uint,
67         pub ip6s: ::c_uint,
68         pub ip4: *mut ::in_addr,
69         pub ip6: *mut ::in6_addr,
70     }
71 
72     pub struct statvfs {
73         pub f_bavail: ::fsblkcnt_t,
74         pub f_bfree: ::fsblkcnt_t,
75         pub f_blocks: ::fsblkcnt_t,
76         pub f_favail: ::fsfilcnt_t,
77         pub f_ffree: ::fsfilcnt_t,
78         pub f_files: ::fsfilcnt_t,
79         pub f_bsize: ::c_ulong,
80         pub f_flag: ::c_ulong,
81         pub f_frsize: ::c_ulong,
82         pub f_fsid: ::c_ulong,
83         pub f_namemax: ::c_ulong,
84     }
85 
86     // internal structure has changed over time
87     pub struct _sem {
88         data: [u32; 4],
89     }
90     pub struct sembuf {
91         pub sem_num: ::c_ushort,
92         pub sem_op: ::c_short,
93         pub sem_flg: ::c_short,
94     }
95 
96     pub struct msqid_ds {
97         pub msg_perm: ::ipc_perm,
98         __unused1: *mut ::c_void,
99         __unused2: *mut ::c_void,
100         pub msg_cbytes: ::msglen_t,
101         pub msg_qnum: ::msgqnum_t,
102         pub msg_qbytes: ::msglen_t,
103         pub msg_lspid: ::pid_t,
104         pub msg_lrpid: ::pid_t,
105         pub msg_stime: ::time_t,
106         pub msg_rtime: ::time_t,
107         pub msg_ctime: ::time_t,
108     }
109 
110     pub struct stack_t {
111         pub ss_sp: *mut ::c_void,
112         pub ss_size: ::size_t,
113         pub ss_flags: ::c_int,
114     }
115 
116     pub struct mmsghdr {
117         pub msg_hdr: ::msghdr,
118         pub msg_len: ::ssize_t,
119     }
120 
121     pub struct sockcred {
122         pub sc_uid: ::uid_t,
123         pub sc_euid: ::uid_t,
124         pub sc_gid: ::gid_t,
125         pub sc_egid: ::gid_t,
126         pub sc_ngroups: ::c_int,
127         pub sc_groups: [::gid_t; 1],
128     }
129 
130     pub struct accept_filter_arg {
131         pub af_name: [::c_char; 16],
132         af_arg: [[::c_char; 10]; 24],
133     }
134 
135     pub struct ptrace_vm_entry {
136         pub pve_entry: ::c_int,
137         pub pve_timestamp: ::c_int,
138         pub pve_start: ::c_ulong,
139         pub pve_end: ::c_ulong,
140         pub pve_offset: ::c_ulong,
141         pub pve_prot: ::c_uint,
142         pub pve_pathlen: ::c_uint,
143         pub pve_fileid: ::c_long,
144         pub pve_fsid: u32,
145         pub pve_path: *mut ::c_char,
146     }
147 
148     pub struct ptrace_lwpinfo {
149         pub pl_lwpid: lwpid_t,
150         pub pl_event: ::c_int,
151         pub pl_flags: ::c_int,
152         pub pl_sigmask: ::sigset_t,
153         pub pl_siglist: ::sigset_t,
154         pub pl_siginfo: ::siginfo_t,
155         pub pl_tdname: [::c_char; ::MAXCOMLEN as usize + 1],
156         pub pl_child_pid: ::pid_t,
157         pub pl_syscall_code: ::c_uint,
158         pub pl_syscall_narg: ::c_uint,
159     }
160 
161     pub struct ptrace_sc_ret {
162         pub sr_retval: [::register_t; 2],
163         pub sr_error: ::c_int,
164     }
165 
166     pub struct cpuset_t {
167         #[cfg(target_pointer_width = "64")]
168         __bits: [::c_long; 4],
169         #[cfg(target_pointer_width = "32")]
170         __bits: [::c_long; 8],
171     }
172 
173     pub struct cap_rights_t {
174         cr_rights: [u64; 2],
175     }
176 
177     pub struct umutex {
178         m_owner: ::lwpid_t,
179         m_flags: u32,
180         m_ceilings: [u32; 2],
181         m_rb_link: ::uintptr_t,
182         #[cfg(target_pointer_width = "32")]
183         m_pad: u32,
184         m_spare: [u32; 2],
185 
186     }
187 
188     pub struct ucond {
189         c_has_waiters: u32,
190         c_flags: u32,
191         c_clockid: u32,
192         c_spare: [u32; 1],
193     }
194 
195     pub struct uuid {
196         pub time_low: u32,
197         pub time_mid: u16,
198         pub time_hi_and_version: u16,
199         pub clock_seq_hi_and_reserved: u8,
200         pub clock_seq_low: u8,
201         pub node: [u8; _UUID_NODE_LEN],
202     }
203 
204     pub struct __c_anonymous_pthread_spinlock {
205         s_clock: umutex,
206     }
207 
208     pub struct __c_anonymous_pthread_barrierattr {
209         pshared: ::c_int,
210     }
211 
212     pub struct __c_anonymous_pthread_barrier {
213         b_lock: umutex,
214         b_cv: ucond,
215         b_cycle: i64,
216         b_count: ::c_int,
217         b_waiters: ::c_int,
218         b_refcount: ::c_int,
219         b_destroying: ::c_int,
220     }
221 
222     pub struct kinfo_vmentry {
223         pub kve_structsize: ::c_int,
224         pub kve_type: ::c_int,
225         pub kve_start: u64,
226         pub kve_end: u64,
227         pub kve_offset: u64,
228         pub kve_vn_fileid: u64,
229         #[cfg(not(freebsd11))]
230         pub kve_vn_fsid_freebsd11: u32,
231         #[cfg(freebsd11)]
232         pub kve_vn_fsid: u32,
233         pub kve_flags: ::c_int,
234         pub kve_resident: ::c_int,
235         pub kve_private_resident: ::c_int,
236         pub kve_protection: ::c_int,
237         pub kve_ref_count: ::c_int,
238         pub kve_shadow_count: ::c_int,
239         pub kve_vn_type: ::c_int,
240         pub kve_vn_size: u64,
241         #[cfg(not(freebsd11))]
242         pub kve_vn_rdev_freebsd11: u32,
243         #[cfg(freebsd11)]
244         pub kve_vn_rdev: u32,
245         pub kve_vn_mode: u16,
246         pub kve_status: u16,
247         #[cfg(not(freebsd11))]
248         pub kve_vn_fsid: u64,
249         #[cfg(not(freebsd11))]
250         pub kve_vn_rdev: u64,
251         #[cfg(not(freebsd11))]
252         _kve_is_spare: [::c_int; 8],
253         #[cfg(freebsd11)]
254         _kve_is_spare: [::c_int; 12],
255         pub kve_path: [[::c_char; 32]; 32],
256     }
257 
258     pub struct filestat {
259         fs_type: ::c_int,
260         fs_flags: ::c_int,
261         fs_fflags: ::c_int,
262         fs_uflags: ::c_int,
263         fs_fd: ::c_int,
264         fs_ref_count: ::c_int,
265         fs_offset: ::off_t,
266         fs_typedep: *mut ::c_void,
267         fs_path: *mut ::c_char,
268         next: *mut filestat,
269         fs_cap_rights: cap_rights_t,
270     }
271 
272     pub struct filestat_list {
273         stqh_first: *mut filestat,
274         stqh_last: *mut *mut filestat,
275     }
276 
277     pub struct procstat {
278         tpe: ::c_int,
279         kd: ::uintptr_t,
280         vmentries: *mut ::c_void,
281         files: *mut ::c_void,
282         argv: *mut ::c_void,
283         envv: *mut ::c_void,
284         core: ::uintptr_t,
285     }
286 
287     pub struct itimerspec {
288         pub it_interval: ::timespec,
289         pub it_value: ::timespec,
290     }
291 
292     pub struct __c_anonymous__timer {
293         _priv: [::c_int; 3],
294     }
295 
296     /// Used to hold a copy of the command line, if it had a sane length.
297     pub struct pargs {
298         /// Reference count.
299         pub ar_ref: u_int,
300         /// Length.
301         pub ar_length: u_int,
302         /// Arguments.
303         pub ar_args: [::c_uchar; 1],
304     }
305 
306     pub struct priority {
307         /// Scheduling class.
308         pub pri_class: u_char,
309         /// Normal priority level.
310         pub pri_level: u_char,
311         /// Priority before propagation.
312         pub pri_native: u_char,
313         /// User priority based on p_cpu and p_nice.
314         pub pri_user: u_char,
315     }
316 
317     pub struct kvm_swap {
318         pub ksw_devname: [::c_char; 32],
319         pub ksw_used: u_int,
320         pub ksw_total: u_int,
321         pub ksw_flags: ::c_int,
322         pub ksw_reserved1: u_int,
323         pub ksw_reserved2: u_int,
324     }
325 
326     pub struct nlist {
327         /// symbol name (in memory)
328         pub n_name: *const ::c_char,
329         /// type defines
330         pub n_type: ::c_uchar,
331         /// "type" and binding information
332         pub n_other: ::c_char,
333         /// used by stab entries
334         pub n_desc: ::c_short,
335         pub n_value: ::c_ulong,
336     }
337 
338     pub struct kvm_nlist {
339         pub n_name: *const ::c_char,
340         pub n_type: ::c_uchar,
341         pub n_value: ::kvaddr_t,
342     }
343 
344     pub struct __c_anonymous_sem {
345         _priv: ::uintptr_t,
346     }
347 
348     pub struct semid_ds {
349         pub sem_perm: ::ipc_perm,
350         pub __sem_base: *mut __c_anonymous_sem,
351         pub sem_nsems: ::c_ushort,
352         pub sem_otime: ::time_t,
353         pub sem_ctime: ::time_t,
354     }
355 
356     pub struct vmtotal {
357         pub t_vm: u64,
358         pub t_avm: u64,
359         pub t_rm: u64,
360         pub t_arm: u64,
361         pub t_vmshr: u64,
362         pub t_avmshr: u64,
363         pub t_rmshr: u64,
364         pub t_armshr: u64,
365         pub t_free: u64,
366         pub t_rq: i16,
367         pub t_dw: i16,
368         pub t_pw: i16,
369         pub t_sl: i16,
370         pub t_sw: i16,
371         pub t_pad: [u16; 3],
372     }
373 
374     pub struct rusage_ext {
375         pub rux_runtime: u64,
376         pub rux_uticks: u64,
377         pub rux_sticks: u64,
378         pub rux_iticks: u64,
379         pub rux_uu: u64,
380         pub rux_su: u64,
381         pub rux_tu: u64,
382     }
383 }
384 
385 s_no_extra_traits! {
386     pub struct utmpx {
387         pub ut_type: ::c_short,
388         pub ut_tv: ::timeval,
389         pub ut_id: [::c_char; 8],
390         pub ut_pid: ::pid_t,
391         pub ut_user: [::c_char; 32],
392         pub ut_line: [::c_char; 16],
393         pub ut_host: [::c_char; 128],
394         pub __ut_spare: [::c_char; 64],
395     }
396 
397     #[cfg(libc_union)]
398     pub union __c_anonymous_cr_pid {
399         __cr_unused: *mut ::c_void,
400         pub cr_pid: ::pid_t,
401     }
402 
403     pub struct xucred {
404         pub cr_version: ::c_uint,
405         pub cr_uid: ::uid_t,
406         pub cr_ngroups: ::c_short,
407         pub cr_groups: [::gid_t; 16],
408         #[cfg(libc_union)]
409         pub cr_pid__c_anonymous_union: __c_anonymous_cr_pid,
410         #[cfg(not(libc_union))]
411         __cr_unused1: *mut ::c_void,
412     }
413 
414     pub struct sockaddr_dl {
415         pub sdl_len: ::c_uchar,
416         pub sdl_family: ::c_uchar,
417         pub sdl_index: ::c_ushort,
418         pub sdl_type: ::c_uchar,
419         pub sdl_nlen: ::c_uchar,
420         pub sdl_alen: ::c_uchar,
421         pub sdl_slen: ::c_uchar,
422         pub sdl_data: [::c_char; 46],
423     }
424 
425     pub struct mq_attr {
426         pub mq_flags: ::c_long,
427         pub mq_maxmsg: ::c_long,
428         pub mq_msgsize: ::c_long,
429         pub mq_curmsgs: ::c_long,
430         __reserved: [::c_long; 4]
431     }
432 
433     pub struct sigevent {
434         pub sigev_notify: ::c_int,
435         pub sigev_signo: ::c_int,
436         pub sigev_value: ::sigval,
437         //The rest of the structure is actually a union.  We expose only
438         //sigev_notify_thread_id because it's the most useful union member.
439         pub sigev_notify_thread_id: ::lwpid_t,
440         #[cfg(target_pointer_width = "64")]
441         __unused1: ::c_int,
442         __unused2: [::c_long; 7]
443     }
444 
445     #[cfg(libc_union)]
446     pub union __c_anonymous_elf32_auxv_union {
447         pub a_val: ::c_int,
448     }
449 
450     pub struct Elf32_Auxinfo {
451         pub a_type: ::c_int,
452         #[cfg(libc_union)]
453         pub a_un: __c_anonymous_elf32_auxv_union,
454     }
455 }
456 
457 cfg_if! {
458     if #[cfg(feature = "extra_traits")] {
459         impl PartialEq for utmpx {
460             fn eq(&self, other: &utmpx) -> bool {
461                 self.ut_type == other.ut_type
462                     && self.ut_tv == other.ut_tv
463                     && self.ut_id == other.ut_id
464                     && self.ut_pid == other.ut_pid
465                     && self.ut_user == other.ut_user
466                     && self.ut_line == other.ut_line
467                     && self
468                     .ut_host
469                     .iter()
470                     .zip(other.ut_host.iter())
471                     .all(|(a,b)| a == b)
472                     && self
473                     .__ut_spare
474                     .iter()
475                     .zip(other.__ut_spare.iter())
476                     .all(|(a,b)| a == b)
477             }
478         }
479         impl Eq for utmpx {}
480         impl ::fmt::Debug for utmpx {
481             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
482                 f.debug_struct("utmpx")
483                     .field("ut_type", &self.ut_type)
484                     .field("ut_tv", &self.ut_tv)
485                     .field("ut_id", &self.ut_id)
486                     .field("ut_pid", &self.ut_pid)
487                     .field("ut_user", &self.ut_user)
488                     .field("ut_line", &self.ut_line)
489                     // FIXME: .field("ut_host", &self.ut_host)
490                     // FIXME: .field("__ut_spare", &self.__ut_spare)
491                     .finish()
492             }
493         }
494         impl ::hash::Hash for utmpx {
495             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
496                 self.ut_type.hash(state);
497                 self.ut_tv.hash(state);
498                 self.ut_id.hash(state);
499                 self.ut_pid.hash(state);
500                 self.ut_user.hash(state);
501                 self.ut_line.hash(state);
502                 self.ut_host.hash(state);
503                 self.__ut_spare.hash(state);
504             }
505         }
506 
507         #[cfg(libc_union)]
508         impl PartialEq for __c_anonymous_cr_pid {
509             fn eq(&self, other: &__c_anonymous_cr_pid) -> bool {
510                 unsafe { self.cr_pid == other.cr_pid}
511             }
512         }
513         #[cfg(libc_union)]
514         impl Eq for __c_anonymous_cr_pid {}
515         #[cfg(libc_union)]
516         impl ::fmt::Debug for __c_anonymous_cr_pid {
517             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
518                 f.debug_struct("cr_pid")
519                     .field("cr_pid", unsafe { &self.cr_pid })
520                     .finish()
521             }
522         }
523         #[cfg(libc_union)]
524         impl ::hash::Hash for __c_anonymous_cr_pid {
525             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
526                 unsafe { self.cr_pid.hash(state) };
527             }
528         }
529 
530         impl PartialEq for xucred {
531             fn eq(&self, other: &xucred) -> bool {
532                 #[cfg(libc_union)]
533                 let equal_cr_pid = self.cr_pid__c_anonymous_union
534                     == other.cr_pid__c_anonymous_union;
535                 #[cfg(not(libc_union))]
536                 let equal_cr_pid = self.__cr_unused1 == other.__cr_unused1;
537 
538                 self.cr_version == other.cr_version
539                     && self.cr_uid == other.cr_uid
540                     && self.cr_ngroups == other.cr_ngroups
541                     && self.cr_groups == other.cr_groups
542                     && equal_cr_pid
543             }
544         }
545         impl Eq for xucred {}
546         impl ::fmt::Debug for xucred {
547             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
548                 let mut struct_formatter = f.debug_struct("xucred");
549                 struct_formatter.field("cr_version", &self.cr_version);
550                 struct_formatter.field("cr_uid", &self.cr_uid);
551                 struct_formatter.field("cr_ngroups", &self.cr_ngroups);
552                 struct_formatter.field("cr_groups", &self.cr_groups);
553                 #[cfg(libc_union)]
554                 struct_formatter.field(
555                     "cr_pid__c_anonymous_union",
556                     &self.cr_pid__c_anonymous_union
557                 );
558                 struct_formatter.finish()
559             }
560         }
561         impl ::hash::Hash for xucred {
562             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
563                 self.cr_version.hash(state);
564                 self.cr_uid.hash(state);
565                 self.cr_ngroups.hash(state);
566                 self.cr_groups.hash(state);
567                 #[cfg(libc_union)]
568                 self.cr_pid__c_anonymous_union.hash(state);
569                 #[cfg(not(libc_union))]
570                 self.__cr_unused1.hash(state);
571             }
572         }
573 
574         impl PartialEq for sockaddr_dl {
575             fn eq(&self, other: &sockaddr_dl) -> bool {
576                 self.sdl_len == other.sdl_len
577                     && self.sdl_family == other.sdl_family
578                     && self.sdl_index == other.sdl_index
579                     && self.sdl_type == other.sdl_type
580                     && self.sdl_nlen == other.sdl_nlen
581                     && self.sdl_alen == other.sdl_alen
582                     && self.sdl_slen == other.sdl_slen
583                     && self
584                     .sdl_data
585                     .iter()
586                     .zip(other.sdl_data.iter())
587                     .all(|(a,b)| a == b)
588             }
589         }
590         impl Eq for sockaddr_dl {}
591         impl ::fmt::Debug for sockaddr_dl {
592             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
593                 f.debug_struct("sockaddr_dl")
594                     .field("sdl_len", &self.sdl_len)
595                     .field("sdl_family", &self.sdl_family)
596                     .field("sdl_index", &self.sdl_index)
597                     .field("sdl_type", &self.sdl_type)
598                     .field("sdl_nlen", &self.sdl_nlen)
599                     .field("sdl_alen", &self.sdl_alen)
600                     .field("sdl_slen", &self.sdl_slen)
601                     // FIXME: .field("sdl_data", &self.sdl_data)
602                     .finish()
603             }
604         }
605         impl ::hash::Hash for sockaddr_dl {
606             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
607                 self.sdl_len.hash(state);
608                 self.sdl_family.hash(state);
609                 self.sdl_index.hash(state);
610                 self.sdl_type.hash(state);
611                 self.sdl_nlen.hash(state);
612                 self.sdl_alen.hash(state);
613                 self.sdl_slen.hash(state);
614                 self.sdl_data.hash(state);
615             }
616         }
617 
618         impl PartialEq for mq_attr {
619             fn eq(&self, other: &mq_attr) -> bool {
620                 self.mq_flags == other.mq_flags &&
621                 self.mq_maxmsg == other.mq_maxmsg &&
622                 self.mq_msgsize == other.mq_msgsize &&
623                 self.mq_curmsgs == other.mq_curmsgs
624             }
625         }
626         impl Eq for mq_attr {}
627         impl ::fmt::Debug for mq_attr {
628             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
629                 f.debug_struct("mq_attr")
630                     .field("mq_flags", &self.mq_flags)
631                     .field("mq_maxmsg", &self.mq_maxmsg)
632                     .field("mq_msgsize", &self.mq_msgsize)
633                     .field("mq_curmsgs", &self.mq_curmsgs)
634                     .finish()
635             }
636         }
637         impl ::hash::Hash for mq_attr {
638             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
639                 self.mq_flags.hash(state);
640                 self.mq_maxmsg.hash(state);
641                 self.mq_msgsize.hash(state);
642                 self.mq_curmsgs.hash(state);
643             }
644         }
645 
646         impl PartialEq for sigevent {
647             fn eq(&self, other: &sigevent) -> bool {
648                 self.sigev_notify == other.sigev_notify
649                     && self.sigev_signo == other.sigev_signo
650                     && self.sigev_value == other.sigev_value
651                     && self.sigev_notify_thread_id
652                         == other.sigev_notify_thread_id
653             }
654         }
655         impl Eq for sigevent {}
656         impl ::fmt::Debug for sigevent {
657             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
658                 f.debug_struct("sigevent")
659                     .field("sigev_notify", &self.sigev_notify)
660                     .field("sigev_signo", &self.sigev_signo)
661                     .field("sigev_value", &self.sigev_value)
662                     .field("sigev_notify_thread_id",
663                            &self.sigev_notify_thread_id)
664                     .finish()
665             }
666         }
667         impl ::hash::Hash for sigevent {
668             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
669                 self.sigev_notify.hash(state);
670                 self.sigev_signo.hash(state);
671                 self.sigev_value.hash(state);
672                 self.sigev_notify_thread_id.hash(state);
673             }
674         }
675         #[cfg(libc_union)]
676         impl PartialEq for __c_anonymous_elf32_auxv_union {
677             fn eq(&self, other: &__c_anonymous_elf32_auxv_union) -> bool {
678                 unsafe { self.a_val == other.a_val}
679             }
680         }
681         #[cfg(libc_union)]
682         impl Eq for __c_anonymous_elf32_auxv_union {}
683         #[cfg(libc_union)]
684         impl ::fmt::Debug for __c_anonymous_elf32_auxv_union {
685             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
686                 f.debug_struct("a_val")
687                     .field("a_val", unsafe { &self.a_val })
688                     .finish()
689             }
690         }
691         #[cfg(not(libc_union))]
692         impl PartialEq for Elf32_Auxinfo {
693             fn eq(&self, other: &Elf32_Auxinfo) -> bool {
694                 self.a_type == other.a_type
695             }
696         }
697         #[cfg(libc_union)]
698         impl PartialEq for Elf32_Auxinfo {
699             fn eq(&self, other: &Elf32_Auxinfo) -> bool {
700                 self.a_type == other.a_type
701                     && self.a_un == other.a_un
702             }
703         }
704         impl Eq for Elf32_Auxinfo {}
705         #[cfg(not(libc_union))]
706         impl ::fmt::Debug for Elf32_Auxinfo {
707             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
708                 f.debug_struct("Elf32_Auxinfo")
709                     .field("a_type", &self.a_type)
710                     .finish()
711             }
712         }
713         #[cfg(libc_union)]
714         impl ::fmt::Debug for Elf32_Auxinfo {
715             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
716                 f.debug_struct("Elf32_Auxinfo")
717                     .field("a_type", &self.a_type)
718                     .field("a_un", &self.a_un)
719                     .finish()
720             }
721         }
722     }
723 }
724 
725 pub const SIGEV_THREAD_ID: ::c_int = 4;
726 
727 pub const EXTATTR_NAMESPACE_EMPTY: ::c_int = 0;
728 pub const EXTATTR_NAMESPACE_USER: ::c_int = 1;
729 pub const EXTATTR_NAMESPACE_SYSTEM: ::c_int = 2;
730 
731 pub const PTHREAD_STACK_MIN: ::size_t = MINSIGSTKSZ;
732 pub const PTHREAD_MUTEX_ADAPTIVE_NP: ::c_int = 4;
733 pub const PTHREAD_MUTEX_STALLED: ::c_int = 0;
734 pub const PTHREAD_MUTEX_ROBUST: ::c_int = 1;
735 pub const SIGSTKSZ: ::size_t = MINSIGSTKSZ + 32768;
736 pub const SF_NODISKIO: ::c_int = 0x00000001;
737 pub const SF_MNOWAIT: ::c_int = 0x00000002;
738 pub const SF_SYNC: ::c_int = 0x00000004;
739 pub const SF_USER_READAHEAD: ::c_int = 0x00000008;
740 pub const SF_NOCACHE: ::c_int = 0x00000010;
741 pub const O_CLOEXEC: ::c_int = 0x00100000;
742 pub const O_DIRECTORY: ::c_int = 0x00020000;
743 pub const O_EXEC: ::c_int = 0x00040000;
744 pub const O_TTY_INIT: ::c_int = 0x00080000;
745 pub const F_GETLK: ::c_int = 11;
746 pub const F_SETLK: ::c_int = 12;
747 pub const F_SETLKW: ::c_int = 13;
748 pub const ENOTCAPABLE: ::c_int = 93;
749 pub const ECAPMODE: ::c_int = 94;
750 pub const ENOTRECOVERABLE: ::c_int = 95;
751 pub const EOWNERDEAD: ::c_int = 96;
752 pub const EINTEGRITY: ::c_int = 97;
753 pub const RLIMIT_NPTS: ::c_int = 11;
754 pub const RLIMIT_SWAP: ::c_int = 12;
755 pub const RLIMIT_KQUEUES: ::c_int = 13;
756 pub const RLIMIT_UMTXP: ::c_int = 14;
757 #[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
758 pub const RLIM_NLIMITS: ::rlim_t = 15;
759 pub const RLIM_SAVED_MAX: ::rlim_t = ::RLIM_INFINITY;
760 pub const RLIM_SAVED_CUR: ::rlim_t = ::RLIM_INFINITY;
761 
762 pub const CP_USER: ::c_int = 0;
763 pub const CP_NICE: ::c_int = 1;
764 pub const CP_SYS: ::c_int = 2;
765 pub const CP_INTR: ::c_int = 3;
766 pub const CP_IDLE: ::c_int = 4;
767 pub const CPUSTATES: ::c_int = 5;
768 
769 pub const NI_NOFQDN: ::c_int = 0x00000001;
770 pub const NI_NUMERICHOST: ::c_int = 0x00000002;
771 pub const NI_NAMEREQD: ::c_int = 0x00000004;
772 pub const NI_NUMERICSERV: ::c_int = 0x00000008;
773 pub const NI_DGRAM: ::c_int = 0x00000010;
774 pub const NI_NUMERICSCOPE: ::c_int = 0x00000020;
775 
776 pub const XU_NGROUPS: ::c_int = 16;
777 
778 pub const Q_GETQUOTA: ::c_int = 0x700;
779 pub const Q_SETQUOTA: ::c_int = 0x800;
780 
781 pub const MAP_GUARD: ::c_int = 0x00002000;
782 pub const MAP_EXCL: ::c_int = 0x00004000;
783 pub const MAP_PREFAULT_READ: ::c_int = 0x00040000;
784 pub const MAP_ALIGNED_SUPER: ::c_int = 1 << 24;
785 
786 pub const POSIX_FADV_NORMAL: ::c_int = 0;
787 pub const POSIX_FADV_RANDOM: ::c_int = 1;
788 pub const POSIX_FADV_SEQUENTIAL: ::c_int = 2;
789 pub const POSIX_FADV_WILLNEED: ::c_int = 3;
790 pub const POSIX_FADV_DONTNEED: ::c_int = 4;
791 pub const POSIX_FADV_NOREUSE: ::c_int = 5;
792 
793 pub const POLLINIGNEOF: ::c_short = 0x2000;
794 
795 pub const EVFILT_READ: i16 = -1;
796 pub const EVFILT_WRITE: i16 = -2;
797 pub const EVFILT_AIO: i16 = -3;
798 pub const EVFILT_VNODE: i16 = -4;
799 pub const EVFILT_PROC: i16 = -5;
800 pub const EVFILT_SIGNAL: i16 = -6;
801 pub const EVFILT_TIMER: i16 = -7;
802 pub const EVFILT_PROCDESC: i16 = -8;
803 pub const EVFILT_FS: i16 = -9;
804 pub const EVFILT_LIO: i16 = -10;
805 pub const EVFILT_USER: i16 = -11;
806 pub const EVFILT_SENDFILE: i16 = -12;
807 pub const EVFILT_EMPTY: i16 = -13;
808 
809 pub const EV_ADD: u16 = 0x1;
810 pub const EV_DELETE: u16 = 0x2;
811 pub const EV_ENABLE: u16 = 0x4;
812 pub const EV_DISABLE: u16 = 0x8;
813 pub const EV_ONESHOT: u16 = 0x10;
814 pub const EV_CLEAR: u16 = 0x20;
815 pub const EV_RECEIPT: u16 = 0x40;
816 pub const EV_DISPATCH: u16 = 0x80;
817 pub const EV_DROP: u16 = 0x1000;
818 pub const EV_FLAG1: u16 = 0x2000;
819 pub const EV_ERROR: u16 = 0x4000;
820 pub const EV_EOF: u16 = 0x8000;
821 pub const EV_SYSFLAGS: u16 = 0xf000;
822 
823 pub const NOTE_TRIGGER: u32 = 0x01000000;
824 pub const NOTE_FFNOP: u32 = 0x00000000;
825 pub const NOTE_FFAND: u32 = 0x40000000;
826 pub const NOTE_FFOR: u32 = 0x80000000;
827 pub const NOTE_FFCOPY: u32 = 0xc0000000;
828 pub const NOTE_FFCTRLMASK: u32 = 0xc0000000;
829 pub const NOTE_FFLAGSMASK: u32 = 0x00ffffff;
830 pub const NOTE_LOWAT: u32 = 0x00000001;
831 pub const NOTE_DELETE: u32 = 0x00000001;
832 pub const NOTE_WRITE: u32 = 0x00000002;
833 pub const NOTE_EXTEND: u32 = 0x00000004;
834 pub const NOTE_ATTRIB: u32 = 0x00000008;
835 pub const NOTE_LINK: u32 = 0x00000010;
836 pub const NOTE_RENAME: u32 = 0x00000020;
837 pub const NOTE_REVOKE: u32 = 0x00000040;
838 pub const NOTE_EXIT: u32 = 0x80000000;
839 pub const NOTE_FORK: u32 = 0x40000000;
840 pub const NOTE_EXEC: u32 = 0x20000000;
841 pub const NOTE_PDATAMASK: u32 = 0x000fffff;
842 pub const NOTE_PCTRLMASK: u32 = 0xf0000000;
843 pub const NOTE_TRACK: u32 = 0x00000001;
844 pub const NOTE_TRACKERR: u32 = 0x00000002;
845 pub const NOTE_CHILD: u32 = 0x00000004;
846 pub const NOTE_SECONDS: u32 = 0x00000001;
847 pub const NOTE_MSECONDS: u32 = 0x00000002;
848 pub const NOTE_USECONDS: u32 = 0x00000004;
849 pub const NOTE_NSECONDS: u32 = 0x00000008;
850 
851 pub const MADV_PROTECT: ::c_int = 10;
852 
853 #[doc(hidden)]
854 #[deprecated(
855     since = "0.2.72",
856     note = "CTL_UNSPEC is deprecated. Use CTL_SYSCTL instead"
857 )]
858 pub const CTL_UNSPEC: ::c_int = 0;
859 pub const CTL_SYSCTL: ::c_int = 0;
860 pub const CTL_KERN: ::c_int = 1;
861 pub const CTL_VM: ::c_int = 2;
862 pub const CTL_VFS: ::c_int = 3;
863 pub const CTL_NET: ::c_int = 4;
864 pub const CTL_DEBUG: ::c_int = 5;
865 pub const CTL_HW: ::c_int = 6;
866 pub const CTL_MACHDEP: ::c_int = 7;
867 pub const CTL_USER: ::c_int = 8;
868 pub const CTL_P1003_1B: ::c_int = 9;
869 
870 // sys/sysctl.h
871 pub const CTL_MAXNAME: ::c_int = 24;
872 
873 pub const CTLTYPE: ::c_int = 0xf;
874 pub const CTLTYPE_NODE: ::c_int = 1;
875 pub const CTLTYPE_INT: ::c_int = 2;
876 pub const CTLTYPE_STRING: ::c_int = 3;
877 pub const CTLTYPE_S64: ::c_int = 4;
878 pub const CTLTYPE_OPAQUE: ::c_int = 5;
879 pub const CTLTYPE_STRUCT: ::c_int = CTLTYPE_OPAQUE;
880 pub const CTLTYPE_UINT: ::c_int = 6;
881 pub const CTLTYPE_LONG: ::c_int = 7;
882 pub const CTLTYPE_ULONG: ::c_int = 8;
883 pub const CTLTYPE_U64: ::c_int = 9;
884 pub const CTLTYPE_U8: ::c_int = 0xa;
885 pub const CTLTYPE_U16: ::c_int = 0xb;
886 pub const CTLTYPE_S8: ::c_int = 0xc;
887 pub const CTLTYPE_S16: ::c_int = 0xd;
888 pub const CTLTYPE_S32: ::c_int = 0xe;
889 pub const CTLTYPE_U32: ::c_int = 0xf;
890 
891 pub const CTLFLAG_RD: ::c_int = 0x80000000;
892 pub const CTLFLAG_WR: ::c_int = 0x40000000;
893 pub const CTLFLAG_RW: ::c_int = CTLFLAG_RD | CTLFLAG_WR;
894 pub const CTLFLAG_DORMANT: ::c_int = 0x20000000;
895 pub const CTLFLAG_ANYBODY: ::c_int = 0x10000000;
896 pub const CTLFLAG_SECURE: ::c_int = 0x08000000;
897 pub const CTLFLAG_PRISON: ::c_int = 0x04000000;
898 pub const CTLFLAG_DYN: ::c_int = 0x02000000;
899 pub const CTLFLAG_SKIP: ::c_int = 0x01000000;
900 pub const CTLMASK_SECURE: ::c_int = 0x00F00000;
901 pub const CTLFLAG_TUN: ::c_int = 0x00080000;
902 pub const CTLFLAG_RDTUN: ::c_int = CTLFLAG_RD | CTLFLAG_TUN;
903 pub const CTLFLAG_RWTUN: ::c_int = CTLFLAG_RW | CTLFLAG_TUN;
904 pub const CTLFLAG_MPSAFE: ::c_int = 0x00040000;
905 pub const CTLFLAG_VNET: ::c_int = 0x00020000;
906 pub const CTLFLAG_DYING: ::c_int = 0x00010000;
907 pub const CTLFLAG_CAPRD: ::c_int = 0x00008000;
908 pub const CTLFLAG_CAPWR: ::c_int = 0x00004000;
909 pub const CTLFLAG_STATS: ::c_int = 0x00002000;
910 pub const CTLFLAG_NOFETCH: ::c_int = 0x00001000;
911 pub const CTLFLAG_CAPRW: ::c_int = CTLFLAG_CAPRD | CTLFLAG_CAPWR;
912 pub const CTLFLAG_NEEDGIANT: ::c_int = 0x00000800;
913 
914 pub const CTLSHIFT_SECURE: ::c_int = 20;
915 pub const CTLFLAG_SECURE1: ::c_int = CTLFLAG_SECURE | (0 << CTLSHIFT_SECURE);
916 pub const CTLFLAG_SECURE2: ::c_int = CTLFLAG_SECURE | (1 << CTLSHIFT_SECURE);
917 pub const CTLFLAG_SECURE3: ::c_int = CTLFLAG_SECURE | (2 << CTLSHIFT_SECURE);
918 
919 pub const OID_AUTO: ::c_int = -1;
920 
921 pub const CTL_SYSCTL_DEBUG: ::c_int = 0;
922 pub const CTL_SYSCTL_NAME: ::c_int = 1;
923 pub const CTL_SYSCTL_NEXT: ::c_int = 2;
924 pub const CTL_SYSCTL_NAME2OID: ::c_int = 3;
925 pub const CTL_SYSCTL_OIDFMT: ::c_int = 4;
926 pub const CTL_SYSCTL_OIDDESCR: ::c_int = 5;
927 pub const CTL_SYSCTL_OIDLABEL: ::c_int = 6;
928 pub const CTL_SYSCTL_NEXTNOSKIP: ::c_int = 7;
929 
930 pub const KERN_OSTYPE: ::c_int = 1;
931 pub const KERN_OSRELEASE: ::c_int = 2;
932 pub const KERN_OSREV: ::c_int = 3;
933 pub const KERN_VERSION: ::c_int = 4;
934 pub const KERN_MAXVNODES: ::c_int = 5;
935 pub const KERN_MAXPROC: ::c_int = 6;
936 pub const KERN_MAXFILES: ::c_int = 7;
937 pub const KERN_ARGMAX: ::c_int = 8;
938 pub const KERN_SECURELVL: ::c_int = 9;
939 pub const KERN_HOSTNAME: ::c_int = 10;
940 pub const KERN_HOSTID: ::c_int = 11;
941 pub const KERN_CLOCKRATE: ::c_int = 12;
942 pub const KERN_VNODE: ::c_int = 13;
943 pub const KERN_PROC: ::c_int = 14;
944 pub const KERN_FILE: ::c_int = 15;
945 pub const KERN_PROF: ::c_int = 16;
946 pub const KERN_POSIX1: ::c_int = 17;
947 pub const KERN_NGROUPS: ::c_int = 18;
948 pub const KERN_JOB_CONTROL: ::c_int = 19;
949 pub const KERN_SAVED_IDS: ::c_int = 20;
950 pub const KERN_BOOTTIME: ::c_int = 21;
951 pub const KERN_NISDOMAINNAME: ::c_int = 22;
952 pub const KERN_UPDATEINTERVAL: ::c_int = 23;
953 pub const KERN_OSRELDATE: ::c_int = 24;
954 pub const KERN_NTP_PLL: ::c_int = 25;
955 pub const KERN_BOOTFILE: ::c_int = 26;
956 pub const KERN_MAXFILESPERPROC: ::c_int = 27;
957 pub const KERN_MAXPROCPERUID: ::c_int = 28;
958 pub const KERN_DUMPDEV: ::c_int = 29;
959 pub const KERN_IPC: ::c_int = 30;
960 pub const KERN_DUMMY: ::c_int = 31;
961 pub const KERN_PS_STRINGS: ::c_int = 32;
962 pub const KERN_USRSTACK: ::c_int = 33;
963 pub const KERN_LOGSIGEXIT: ::c_int = 34;
964 pub const KERN_IOV_MAX: ::c_int = 35;
965 pub const KERN_HOSTUUID: ::c_int = 36;
966 pub const KERN_ARND: ::c_int = 37;
967 pub const KERN_MAXPHYS: ::c_int = 38;
968 pub const KERN_STACKTOP: ::c_int = 39;
969 
970 pub const KERN_PROC_ALL: ::c_int = 0;
971 pub const KERN_PROC_PID: ::c_int = 1;
972 pub const KERN_PROC_PGRP: ::c_int = 2;
973 pub const KERN_PROC_SESSION: ::c_int = 3;
974 pub const KERN_PROC_TTY: ::c_int = 4;
975 pub const KERN_PROC_UID: ::c_int = 5;
976 pub const KERN_PROC_RUID: ::c_int = 6;
977 pub const KERN_PROC_ARGS: ::c_int = 7;
978 pub const KERN_PROC_PROC: ::c_int = 8;
979 pub const KERN_PROC_SV_NAME: ::c_int = 9;
980 pub const KERN_PROC_RGID: ::c_int = 10;
981 pub const KERN_PROC_GID: ::c_int = 11;
982 pub const KERN_PROC_PATHNAME: ::c_int = 12;
983 pub const KERN_PROC_OVMMAP: ::c_int = 13;
984 pub const KERN_PROC_OFILEDESC: ::c_int = 14;
985 pub const KERN_PROC_KSTACK: ::c_int = 15;
986 pub const KERN_PROC_INC_THREAD: ::c_int = 0x10;
987 pub const KERN_PROC_VMMAP: ::c_int = 32;
988 pub const KERN_PROC_FILEDESC: ::c_int = 33;
989 pub const KERN_PROC_GROUPS: ::c_int = 34;
990 pub const KERN_PROC_ENV: ::c_int = 35;
991 pub const KERN_PROC_AUXV: ::c_int = 36;
992 pub const KERN_PROC_RLIMIT: ::c_int = 37;
993 pub const KERN_PROC_PS_STRINGS: ::c_int = 38;
994 pub const KERN_PROC_UMASK: ::c_int = 39;
995 pub const KERN_PROC_OSREL: ::c_int = 40;
996 pub const KERN_PROC_SIGTRAMP: ::c_int = 41;
997 pub const KERN_PROC_CWD: ::c_int = 42;
998 pub const KERN_PROC_NFDS: ::c_int = 43;
999 pub const KERN_PROC_SIGFASTBLK: ::c_int = 44;
1000 
1001 pub const KIPC_MAXSOCKBUF: ::c_int = 1;
1002 pub const KIPC_SOCKBUF_WASTE: ::c_int = 2;
1003 pub const KIPC_SOMAXCONN: ::c_int = 3;
1004 pub const KIPC_MAX_LINKHDR: ::c_int = 4;
1005 pub const KIPC_MAX_PROTOHDR: ::c_int = 5;
1006 pub const KIPC_MAX_HDR: ::c_int = 6;
1007 pub const KIPC_MAX_DATALEN: ::c_int = 7;
1008 
1009 pub const HW_MACHINE: ::c_int = 1;
1010 pub const HW_MODEL: ::c_int = 2;
1011 pub const HW_NCPU: ::c_int = 3;
1012 pub const HW_BYTEORDER: ::c_int = 4;
1013 pub const HW_PHYSMEM: ::c_int = 5;
1014 pub const HW_USERMEM: ::c_int = 6;
1015 pub const HW_PAGESIZE: ::c_int = 7;
1016 pub const HW_DISKNAMES: ::c_int = 8;
1017 pub const HW_DISKSTATS: ::c_int = 9;
1018 pub const HW_FLOATINGPT: ::c_int = 10;
1019 pub const HW_MACHINE_ARCH: ::c_int = 11;
1020 pub const HW_REALMEM: ::c_int = 12;
1021 
1022 pub const USER_CS_PATH: ::c_int = 1;
1023 pub const USER_BC_BASE_MAX: ::c_int = 2;
1024 pub const USER_BC_DIM_MAX: ::c_int = 3;
1025 pub const USER_BC_SCALE_MAX: ::c_int = 4;
1026 pub const USER_BC_STRING_MAX: ::c_int = 5;
1027 pub const USER_COLL_WEIGHTS_MAX: ::c_int = 6;
1028 pub const USER_EXPR_NEST_MAX: ::c_int = 7;
1029 pub const USER_LINE_MAX: ::c_int = 8;
1030 pub const USER_RE_DUP_MAX: ::c_int = 9;
1031 pub const USER_POSIX2_VERSION: ::c_int = 10;
1032 pub const USER_POSIX2_C_BIND: ::c_int = 11;
1033 pub const USER_POSIX2_C_DEV: ::c_int = 12;
1034 pub const USER_POSIX2_CHAR_TERM: ::c_int = 13;
1035 pub const USER_POSIX2_FORT_DEV: ::c_int = 14;
1036 pub const USER_POSIX2_FORT_RUN: ::c_int = 15;
1037 pub const USER_POSIX2_LOCALEDEF: ::c_int = 16;
1038 pub const USER_POSIX2_SW_DEV: ::c_int = 17;
1039 pub const USER_POSIX2_UPE: ::c_int = 18;
1040 pub const USER_STREAM_MAX: ::c_int = 19;
1041 pub const USER_TZNAME_MAX: ::c_int = 20;
1042 pub const USER_LOCALBASE: ::c_int = 21;
1043 
1044 pub const CTL_P1003_1B_ASYNCHRONOUS_IO: ::c_int = 1;
1045 pub const CTL_P1003_1B_MAPPED_FILES: ::c_int = 2;
1046 pub const CTL_P1003_1B_MEMLOCK: ::c_int = 3;
1047 pub const CTL_P1003_1B_MEMLOCK_RANGE: ::c_int = 4;
1048 pub const CTL_P1003_1B_MEMORY_PROTECTION: ::c_int = 5;
1049 pub const CTL_P1003_1B_MESSAGE_PASSING: ::c_int = 6;
1050 pub const CTL_P1003_1B_PRIORITIZED_IO: ::c_int = 7;
1051 pub const CTL_P1003_1B_PRIORITY_SCHEDULING: ::c_int = 8;
1052 pub const CTL_P1003_1B_REALTIME_SIGNALS: ::c_int = 9;
1053 pub const CTL_P1003_1B_SEMAPHORES: ::c_int = 10;
1054 pub const CTL_P1003_1B_FSYNC: ::c_int = 11;
1055 pub const CTL_P1003_1B_SHARED_MEMORY_OBJECTS: ::c_int = 12;
1056 pub const CTL_P1003_1B_SYNCHRONIZED_IO: ::c_int = 13;
1057 pub const CTL_P1003_1B_TIMERS: ::c_int = 14;
1058 pub const CTL_P1003_1B_AIO_LISTIO_MAX: ::c_int = 15;
1059 pub const CTL_P1003_1B_AIO_MAX: ::c_int = 16;
1060 pub const CTL_P1003_1B_AIO_PRIO_DELTA_MAX: ::c_int = 17;
1061 pub const CTL_P1003_1B_DELAYTIMER_MAX: ::c_int = 18;
1062 pub const CTL_P1003_1B_MQ_OPEN_MAX: ::c_int = 19;
1063 pub const CTL_P1003_1B_PAGESIZE: ::c_int = 20;
1064 pub const CTL_P1003_1B_RTSIG_MAX: ::c_int = 21;
1065 pub const CTL_P1003_1B_SEM_NSEMS_MAX: ::c_int = 22;
1066 pub const CTL_P1003_1B_SEM_VALUE_MAX: ::c_int = 23;
1067 pub const CTL_P1003_1B_SIGQUEUE_MAX: ::c_int = 24;
1068 pub const CTL_P1003_1B_TIMER_MAX: ::c_int = 25;
1069 
1070 pub const TIOCGPTN: ::c_uint = 0x4004740f;
1071 pub const TIOCPTMASTER: ::c_uint = 0x2000741c;
1072 pub const TIOCSIG: ::c_uint = 0x2004745f;
1073 pub const TIOCM_DCD: ::c_int = 0x40;
1074 pub const H4DISC: ::c_int = 0x7;
1075 
1076 pub const VM_TOTAL: ::c_int = 1;
1077 
1078 pub const BIOCSETFNR: ::c_ulong = 0x80104282;
1079 
1080 pub const FIODGNAME: ::c_ulong = 0x80106678;
1081 pub const FIONWRITE: ::c_ulong = 0x40046677;
1082 pub const FIONSPACE: ::c_ulong = 0x40046676;
1083 pub const FIOSEEKDATA: ::c_ulong = 0xc0086661;
1084 pub const FIOSEEKHOLE: ::c_ulong = 0xc0086662;
1085 
1086 pub const JAIL_API_VERSION: u32 = 2;
1087 pub const JAIL_CREATE: ::c_int = 0x01;
1088 pub const JAIL_UPDATE: ::c_int = 0x02;
1089 pub const JAIL_ATTACH: ::c_int = 0x04;
1090 pub const JAIL_DYING: ::c_int = 0x08;
1091 pub const JAIL_SET_MASK: ::c_int = 0x0f;
1092 pub const JAIL_GET_MASK: ::c_int = 0x08;
1093 pub const JAIL_SYS_DISABLE: ::c_int = 0;
1094 pub const JAIL_SYS_NEW: ::c_int = 1;
1095 pub const JAIL_SYS_INHERIT: ::c_int = 2;
1096 
1097 pub const MNT_ACLS: ::c_int = 0x08000000;
1098 pub const MNT_BYFSID: ::c_int = 0x08000000;
1099 pub const MNT_GJOURNAL: ::c_int = 0x02000000;
1100 pub const MNT_MULTILABEL: ::c_int = 0x04000000;
1101 pub const MNT_NFS4ACLS: ::c_int = 0x00000010;
1102 pub const MNT_SNAPSHOT: ::c_int = 0x01000000;
1103 pub const MNT_UNION: ::c_int = 0x00000020;
1104 pub const MNT_EXPUBLIC: ::c_int = 0x20000000;
1105 pub const MNT_NONBUSY: ::c_int = 0x04000000;
1106 
1107 pub const SCM_CREDS2: ::c_int = 0x08;
1108 
1109 pub const SO_BINTIME: ::c_int = 0x2000;
1110 pub const SO_NO_OFFLOAD: ::c_int = 0x4000;
1111 pub const SO_NO_DDP: ::c_int = 0x8000;
1112 pub const SO_REUSEPORT_LB: ::c_int = 0x10000;
1113 pub const SO_LABEL: ::c_int = 0x1009;
1114 pub const SO_PEERLABEL: ::c_int = 0x1010;
1115 pub const SO_LISTENQLIMIT: ::c_int = 0x1011;
1116 pub const SO_LISTENQLEN: ::c_int = 0x1012;
1117 pub const SO_LISTENINCQLEN: ::c_int = 0x1013;
1118 pub const SO_SETFIB: ::c_int = 0x1014;
1119 pub const SO_USER_COOKIE: ::c_int = 0x1015;
1120 pub const SO_PROTOCOL: ::c_int = 0x1016;
1121 pub const SO_PROTOTYPE: ::c_int = SO_PROTOCOL;
1122 pub const SO_DOMAIN: ::c_int = 0x1019;
1123 pub const SO_VENDOR: ::c_int = 0x80000000;
1124 
1125 pub const LOCAL_CREDS: ::c_int = 2;
1126 pub const LOCAL_CREDS_PERSISTENT: ::c_int = 3;
1127 pub const LOCAL_CONNWAIT: ::c_int = 4;
1128 pub const LOCAL_VENDOR: ::c_int = SO_VENDOR;
1129 
1130 pub const PL_EVENT_NONE: ::c_int = 0;
1131 pub const PL_EVENT_SIGNAL: ::c_int = 1;
1132 pub const PL_FLAG_SA: ::c_int = 0x01;
1133 pub const PL_FLAG_BOUND: ::c_int = 0x02;
1134 pub const PL_FLAG_SCE: ::c_int = 0x04;
1135 pub const PL_FLAG_SCX: ::c_int = 0x08;
1136 pub const PL_FLAG_EXEC: ::c_int = 0x10;
1137 pub const PL_FLAG_SI: ::c_int = 0x20;
1138 pub const PL_FLAG_FORKED: ::c_int = 0x40;
1139 pub const PL_FLAG_CHILD: ::c_int = 0x80;
1140 pub const PL_FLAG_BORN: ::c_int = 0x100;
1141 pub const PL_FLAG_EXITED: ::c_int = 0x200;
1142 pub const PL_FLAG_VFORKED: ::c_int = 0x400;
1143 pub const PL_FLAG_VFORK_DONE: ::c_int = 0x800;
1144 
1145 pub const PT_LWPINFO: ::c_int = 13;
1146 pub const PT_GETNUMLWPS: ::c_int = 14;
1147 pub const PT_GETLWPLIST: ::c_int = 15;
1148 pub const PT_CLEARSTEP: ::c_int = 16;
1149 pub const PT_SETSTEP: ::c_int = 17;
1150 pub const PT_SUSPEND: ::c_int = 18;
1151 pub const PT_RESUME: ::c_int = 19;
1152 pub const PT_TO_SCE: ::c_int = 20;
1153 pub const PT_TO_SCX: ::c_int = 21;
1154 pub const PT_SYSCALL: ::c_int = 22;
1155 pub const PT_FOLLOW_FORK: ::c_int = 23;
1156 pub const PT_LWP_EVENTS: ::c_int = 24;
1157 pub const PT_GET_EVENT_MASK: ::c_int = 25;
1158 pub const PT_SET_EVENT_MASK: ::c_int = 26;
1159 pub const PT_GET_SC_ARGS: ::c_int = 27;
1160 pub const PT_GET_SC_RET: ::c_int = 28;
1161 pub const PT_GETREGS: ::c_int = 33;
1162 pub const PT_SETREGS: ::c_int = 34;
1163 pub const PT_GETFPREGS: ::c_int = 35;
1164 pub const PT_SETFPREGS: ::c_int = 36;
1165 pub const PT_GETDBREGS: ::c_int = 37;
1166 pub const PT_SETDBREGS: ::c_int = 38;
1167 pub const PT_VM_TIMESTAMP: ::c_int = 40;
1168 pub const PT_VM_ENTRY: ::c_int = 41;
1169 pub const PT_FIRSTMACH: ::c_int = 64;
1170 
1171 pub const PTRACE_EXEC: ::c_int = 0x0001;
1172 pub const PTRACE_SCE: ::c_int = 0x0002;
1173 pub const PTRACE_SCX: ::c_int = 0x0004;
1174 pub const PTRACE_SYSCALL: ::c_int = PTRACE_SCE | PTRACE_SCX;
1175 pub const PTRACE_FORK: ::c_int = 0x0008;
1176 pub const PTRACE_LWP: ::c_int = 0x0010;
1177 pub const PTRACE_VFORK: ::c_int = 0x0020;
1178 pub const PTRACE_DEFAULT: ::c_int = PTRACE_EXEC;
1179 
1180 pub const PROC_SPROTECT: ::c_int = 1;
1181 pub const PROC_REAP_ACQUIRE: ::c_int = 2;
1182 pub const PROC_REAP_RELEASE: ::c_int = 3;
1183 pub const PROC_REAP_STATUS: ::c_int = 4;
1184 pub const PROC_REAP_GETPIDS: ::c_int = 5;
1185 pub const PROC_REAP_KILL: ::c_int = 6;
1186 pub const PROC_TRACE_CTL: ::c_int = 7;
1187 pub const PROC_TRACE_STATUS: ::c_int = 8;
1188 pub const PROC_TRAPCAP_CTL: ::c_int = 9;
1189 pub const PROC_TRAPCAP_STATUS: ::c_int = 10;
1190 pub const PROC_PDEATHSIG_CTL: ::c_int = 11;
1191 pub const PROC_PDEATHSIG_STATUS: ::c_int = 12;
1192 pub const PROC_ASLR_CTL: ::c_int = 13;
1193 pub const PROC_ASLR_STATUS: ::c_int = 14;
1194 pub const PROC_PROTMAX_CTL: ::c_int = 15;
1195 pub const PROC_PROTMAX_STATUS: ::c_int = 16;
1196 pub const PROC_STACKGAP_CTL: ::c_int = 17;
1197 pub const PROC_STACKGAP_STATUS: ::c_int = 18;
1198 pub const PROC_PROCCTL_MD_MIN: ::c_int = 0x10000000;
1199 
1200 pub const PPROT_SET: ::c_int = 1;
1201 pub const PPROT_CLEAR: ::c_int = 2;
1202 pub const PPROT_DESCEND: ::c_int = 0x10;
1203 pub const PPROT_INHERIT: ::c_int = 0x20;
1204 
1205 pub const PROC_TRACE_CTL_ENABLE: ::c_int = 1;
1206 pub const PROC_TRACE_CTL_DISABLE: ::c_int = 2;
1207 pub const PROC_TRACE_CTL_DISABLE_EXEC: ::c_int = 3;
1208 
1209 pub const PROC_TRAPCAP_CTL_ENABLE: ::c_int = 1;
1210 pub const PROC_TRAPCAP_CTL_DISABLE: ::c_int = 2;
1211 
1212 pub const PROC_ASLR_FORCE_ENABLE: ::c_int = 1;
1213 pub const PROC_ASLR_FORCE_DISABLE: ::c_int = 2;
1214 pub const PROC_ASLR_NOFORCE: ::c_int = 3;
1215 pub const PROC_ASLR_ACTIVE: ::c_int = 0x80000000;
1216 
1217 pub const PROC_PROTMAX_FORCE_ENABLE: ::c_int = 1;
1218 pub const PROC_PROTMAX_FORCE_DISABLE: ::c_int = 2;
1219 pub const PROC_PROTMAX_NOFORCE: ::c_int = 3;
1220 pub const PROC_PROTMAX_ACTIVE: ::c_int = 0x80000000;
1221 
1222 pub const PROC_STACKGAP_ENABLE: ::c_int = 0x0001;
1223 pub const PROC_STACKGAP_DISABLE: ::c_int = 0x0002;
1224 pub const PROC_STACKGAP_ENABLE_EXEC: ::c_int = 0x0004;
1225 pub const PROC_STACKGAP_DISABLE_EXEC: ::c_int = 0x0008;
1226 
1227 pub const AF_SLOW: ::c_int = 33;
1228 pub const AF_SCLUSTER: ::c_int = 34;
1229 pub const AF_ARP: ::c_int = 35;
1230 pub const AF_BLUETOOTH: ::c_int = 36;
1231 pub const AF_IEEE80211: ::c_int = 37;
1232 pub const AF_INET_SDP: ::c_int = 40;
1233 pub const AF_INET6_SDP: ::c_int = 42;
1234 
1235 // https://github.com/freebsd/freebsd/blob/master/sys/net/if.h#L140
1236 pub const IFF_UP: ::c_int = 0x1; // (n) interface is up
1237 pub const IFF_BROADCAST: ::c_int = 0x2; // (i) broadcast address valid
1238 pub const IFF_DEBUG: ::c_int = 0x4; // (n) turn on debugging
1239 pub const IFF_LOOPBACK: ::c_int = 0x8; // (i) is a loopback net
1240 pub const IFF_POINTOPOINT: ::c_int = 0x10; // (i) is a point-to-point link
1241                                            // 0x20           was IFF_SMART
1242 pub const IFF_RUNNING: ::c_int = 0x40; // (d) resources allocated
1243 #[doc(hidden)]
1244 #[deprecated(
1245     since = "0.2.54",
1246     note = "IFF_DRV_RUNNING is deprecated. Use the portable IFF_RUNNING instead"
1247 )]
1248 pub const IFF_DRV_RUNNING: ::c_int = 0x40;
1249 pub const IFF_NOARP: ::c_int = 0x80; // (n) no address resolution protocol
1250 pub const IFF_PROMISC: ::c_int = 0x100; // (n) receive all packets
1251 pub const IFF_ALLMULTI: ::c_int = 0x200; // (n) receive all multicast packets
1252 pub const IFF_OACTIVE: ::c_int = 0x400; // (d) tx hardware queue is full
1253 #[doc(hidden)]
1254 #[deprecated(since = "0.2.54", note = "Use the portable `IFF_OACTIVE` instead")]
1255 pub const IFF_DRV_OACTIVE: ::c_int = 0x400;
1256 pub const IFF_SIMPLEX: ::c_int = 0x800; // (i) can't hear own transmissions
1257 pub const IFF_LINK0: ::c_int = 0x1000; // per link layer defined bit
1258 pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit
1259 pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit
1260 pub const IFF_ALTPHYS: ::c_int = IFF_LINK2; // use alternate physical connection
1261 pub const IFF_MULTICAST: ::c_int = 0x8000; // (i) supports multicast
1262                                            // (i) unconfigurable using ioctl(2)
1263 pub const IFF_CANTCONFIG: ::c_int = 0x10000;
1264 pub const IFF_PPROMISC: ::c_int = 0x20000; // (n) user-requested promisc mode
1265 pub const IFF_MONITOR: ::c_int = 0x40000; // (n) user-requested monitor mode
1266 pub const IFF_STATICARP: ::c_int = 0x80000; // (n) static ARP
1267 pub const IFF_DYING: ::c_int = 0x200000; // (n) interface is winding down
1268 pub const IFF_RENAMING: ::c_int = 0x400000; // (n) interface is being renamed
1269 
1270 // sys/netinet/in.h
1271 // Protocols (RFC 1700)
1272 // NOTE: These are in addition to the constants defined in src/unix/mod.rs
1273 
1274 // IPPROTO_IP defined in src/unix/mod.rs
1275 /// IP6 hop-by-hop options
1276 pub const IPPROTO_HOPOPTS: ::c_int = 0;
1277 // IPPROTO_ICMP defined in src/unix/mod.rs
1278 /// group mgmt protocol
1279 pub const IPPROTO_IGMP: ::c_int = 2;
1280 /// gateway^2 (deprecated)
1281 pub const IPPROTO_GGP: ::c_int = 3;
1282 /// for compatibility
1283 pub const IPPROTO_IPIP: ::c_int = 4;
1284 // IPPROTO_TCP defined in src/unix/mod.rs
1285 /// Stream protocol II.
1286 pub const IPPROTO_ST: ::c_int = 7;
1287 /// exterior gateway protocol
1288 pub const IPPROTO_EGP: ::c_int = 8;
1289 /// private interior gateway
1290 pub const IPPROTO_PIGP: ::c_int = 9;
1291 /// BBN RCC Monitoring
1292 pub const IPPROTO_RCCMON: ::c_int = 10;
1293 /// network voice protocol
1294 pub const IPPROTO_NVPII: ::c_int = 11;
1295 /// pup
1296 pub const IPPROTO_PUP: ::c_int = 12;
1297 /// Argus
1298 pub const IPPROTO_ARGUS: ::c_int = 13;
1299 /// EMCON
1300 pub const IPPROTO_EMCON: ::c_int = 14;
1301 /// Cross Net Debugger
1302 pub const IPPROTO_XNET: ::c_int = 15;
1303 /// Chaos
1304 pub const IPPROTO_CHAOS: ::c_int = 16;
1305 // IPPROTO_UDP defined in src/unix/mod.rs
1306 /// Multiplexing
1307 pub const IPPROTO_MUX: ::c_int = 18;
1308 /// DCN Measurement Subsystems
1309 pub const IPPROTO_MEAS: ::c_int = 19;
1310 /// Host Monitoring
1311 pub const IPPROTO_HMP: ::c_int = 20;
1312 /// Packet Radio Measurement
1313 pub const IPPROTO_PRM: ::c_int = 21;
1314 /// xns idp
1315 pub const IPPROTO_IDP: ::c_int = 22;
1316 /// Trunk-1
1317 pub const IPPROTO_TRUNK1: ::c_int = 23;
1318 /// Trunk-2
1319 pub const IPPROTO_TRUNK2: ::c_int = 24;
1320 /// Leaf-1
1321 pub const IPPROTO_LEAF1: ::c_int = 25;
1322 /// Leaf-2
1323 pub const IPPROTO_LEAF2: ::c_int = 26;
1324 /// Reliable Data
1325 pub const IPPROTO_RDP: ::c_int = 27;
1326 /// Reliable Transaction
1327 pub const IPPROTO_IRTP: ::c_int = 28;
1328 /// tp-4 w/ class negotiation
1329 pub const IPPROTO_TP: ::c_int = 29;
1330 /// Bulk Data Transfer
1331 pub const IPPROTO_BLT: ::c_int = 30;
1332 /// Network Services
1333 pub const IPPROTO_NSP: ::c_int = 31;
1334 /// Merit Internodal
1335 pub const IPPROTO_INP: ::c_int = 32;
1336 #[doc(hidden)]
1337 #[deprecated(
1338     since = "0.2.72",
1339     note = "IPPROTO_SEP is deprecated. Use IPPROTO_DCCP instead"
1340 )]
1341 pub const IPPROTO_SEP: ::c_int = 33;
1342 /// Datagram Congestion Control Protocol
1343 pub const IPPROTO_DCCP: ::c_int = 33;
1344 /// Third Party Connect
1345 pub const IPPROTO_3PC: ::c_int = 34;
1346 /// InterDomain Policy Routing
1347 pub const IPPROTO_IDPR: ::c_int = 35;
1348 /// XTP
1349 pub const IPPROTO_XTP: ::c_int = 36;
1350 /// Datagram Delivery
1351 pub const IPPROTO_DDP: ::c_int = 37;
1352 /// Control Message Transport
1353 pub const IPPROTO_CMTP: ::c_int = 38;
1354 /// TP++ Transport
1355 pub const IPPROTO_TPXX: ::c_int = 39;
1356 /// IL transport protocol
1357 pub const IPPROTO_IL: ::c_int = 40;
1358 // IPPROTO_IPV6 defined in src/unix/mod.rs
1359 /// Source Demand Routing
1360 pub const IPPROTO_SDRP: ::c_int = 42;
1361 /// IP6 routing header
1362 pub const IPPROTO_ROUTING: ::c_int = 43;
1363 /// IP6 fragmentation header
1364 pub const IPPROTO_FRAGMENT: ::c_int = 44;
1365 /// InterDomain Routing
1366 pub const IPPROTO_IDRP: ::c_int = 45;
1367 /// resource reservation
1368 pub const IPPROTO_RSVP: ::c_int = 46;
1369 /// General Routing Encap.
1370 pub const IPPROTO_GRE: ::c_int = 47;
1371 /// Mobile Host Routing
1372 pub const IPPROTO_MHRP: ::c_int = 48;
1373 /// BHA
1374 pub const IPPROTO_BHA: ::c_int = 49;
1375 /// IP6 Encap Sec. Payload
1376 pub const IPPROTO_ESP: ::c_int = 50;
1377 /// IP6 Auth Header
1378 pub const IPPROTO_AH: ::c_int = 51;
1379 /// Integ. Net Layer Security
1380 pub const IPPROTO_INLSP: ::c_int = 52;
1381 /// IP with encryption
1382 pub const IPPROTO_SWIPE: ::c_int = 53;
1383 /// Next Hop Resolution
1384 pub const IPPROTO_NHRP: ::c_int = 54;
1385 /// IP Mobility
1386 pub const IPPROTO_MOBILE: ::c_int = 55;
1387 /// Transport Layer Security
1388 pub const IPPROTO_TLSP: ::c_int = 56;
1389 /// SKIP
1390 pub const IPPROTO_SKIP: ::c_int = 57;
1391 // IPPROTO_ICMPV6 defined in src/unix/mod.rs
1392 /// IP6 no next header
1393 pub const IPPROTO_NONE: ::c_int = 59;
1394 /// IP6 destination option
1395 pub const IPPROTO_DSTOPTS: ::c_int = 60;
1396 /// any host internal protocol
1397 pub const IPPROTO_AHIP: ::c_int = 61;
1398 /// CFTP
1399 pub const IPPROTO_CFTP: ::c_int = 62;
1400 /// "hello" routing protocol
1401 pub const IPPROTO_HELLO: ::c_int = 63;
1402 /// SATNET/Backroom EXPAK
1403 pub const IPPROTO_SATEXPAK: ::c_int = 64;
1404 /// Kryptolan
1405 pub const IPPROTO_KRYPTOLAN: ::c_int = 65;
1406 /// Remote Virtual Disk
1407 pub const IPPROTO_RVD: ::c_int = 66;
1408 /// Pluribus Packet Core
1409 pub const IPPROTO_IPPC: ::c_int = 67;
1410 /// Any distributed FS
1411 pub const IPPROTO_ADFS: ::c_int = 68;
1412 /// Satnet Monitoring
1413 pub const IPPROTO_SATMON: ::c_int = 69;
1414 /// VISA Protocol
1415 pub const IPPROTO_VISA: ::c_int = 70;
1416 /// Packet Core Utility
1417 pub const IPPROTO_IPCV: ::c_int = 71;
1418 /// Comp. Prot. Net. Executive
1419 pub const IPPROTO_CPNX: ::c_int = 72;
1420 /// Comp. Prot. HeartBeat
1421 pub const IPPROTO_CPHB: ::c_int = 73;
1422 /// Wang Span Network
1423 pub const IPPROTO_WSN: ::c_int = 74;
1424 /// Packet Video Protocol
1425 pub const IPPROTO_PVP: ::c_int = 75;
1426 /// BackRoom SATNET Monitoring
1427 pub const IPPROTO_BRSATMON: ::c_int = 76;
1428 /// Sun net disk proto (temp.)
1429 pub const IPPROTO_ND: ::c_int = 77;
1430 /// WIDEBAND Monitoring
1431 pub const IPPROTO_WBMON: ::c_int = 78;
1432 /// WIDEBAND EXPAK
1433 pub const IPPROTO_WBEXPAK: ::c_int = 79;
1434 /// ISO cnlp
1435 pub const IPPROTO_EON: ::c_int = 80;
1436 /// VMTP
1437 pub const IPPROTO_VMTP: ::c_int = 81;
1438 /// Secure VMTP
1439 pub const IPPROTO_SVMTP: ::c_int = 82;
1440 /// Banyon VINES
1441 pub const IPPROTO_VINES: ::c_int = 83;
1442 /// TTP
1443 pub const IPPROTO_TTP: ::c_int = 84;
1444 /// NSFNET-IGP
1445 pub const IPPROTO_IGP: ::c_int = 85;
1446 /// dissimilar gateway prot.
1447 pub const IPPROTO_DGP: ::c_int = 86;
1448 /// TCF
1449 pub const IPPROTO_TCF: ::c_int = 87;
1450 /// Cisco/GXS IGRP
1451 pub const IPPROTO_IGRP: ::c_int = 88;
1452 /// OSPFIGP
1453 pub const IPPROTO_OSPFIGP: ::c_int = 89;
1454 /// Strite RPC protocol
1455 pub const IPPROTO_SRPC: ::c_int = 90;
1456 /// Locus Address Resoloution
1457 pub const IPPROTO_LARP: ::c_int = 91;
1458 /// Multicast Transport
1459 pub const IPPROTO_MTP: ::c_int = 92;
1460 /// AX.25 Frames
1461 pub const IPPROTO_AX25: ::c_int = 93;
1462 /// IP encapsulated in IP
1463 pub const IPPROTO_IPEIP: ::c_int = 94;
1464 /// Mobile Int.ing control
1465 pub const IPPROTO_MICP: ::c_int = 95;
1466 /// Semaphore Comm. security
1467 pub const IPPROTO_SCCSP: ::c_int = 96;
1468 /// Ethernet IP encapsulation
1469 pub const IPPROTO_ETHERIP: ::c_int = 97;
1470 /// encapsulation header
1471 pub const IPPROTO_ENCAP: ::c_int = 98;
1472 /// any private encr. scheme
1473 pub const IPPROTO_APES: ::c_int = 99;
1474 /// GMTP
1475 pub const IPPROTO_GMTP: ::c_int = 100;
1476 /// payload compression (IPComp)
1477 pub const IPPROTO_IPCOMP: ::c_int = 108;
1478 /// SCTP
1479 pub const IPPROTO_SCTP: ::c_int = 132;
1480 /// IPv6 Mobility Header
1481 pub const IPPROTO_MH: ::c_int = 135;
1482 /// UDP-Lite
1483 pub const IPPROTO_UDPLITE: ::c_int = 136;
1484 /// IP6 Host Identity Protocol
1485 pub const IPPROTO_HIP: ::c_int = 139;
1486 /// IP6 Shim6 Protocol
1487 pub const IPPROTO_SHIM6: ::c_int = 140;
1488 
1489 /* 101-254: Partly Unassigned */
1490 /// Protocol Independent Mcast
1491 pub const IPPROTO_PIM: ::c_int = 103;
1492 /// CARP
1493 pub const IPPROTO_CARP: ::c_int = 112;
1494 /// PGM
1495 pub const IPPROTO_PGM: ::c_int = 113;
1496 /// MPLS-in-IP
1497 pub const IPPROTO_MPLS: ::c_int = 137;
1498 /// PFSYNC
1499 pub const IPPROTO_PFSYNC: ::c_int = 240;
1500 
1501 /* 255: Reserved */
1502 /* BSD Private, local use, namespace incursion, no longer used */
1503 /// OLD divert pseudo-proto
1504 pub const IPPROTO_OLD_DIVERT: ::c_int = 254;
1505 pub const IPPROTO_MAX: ::c_int = 256;
1506 /// last return value of *_input(), meaning "all job for this pkt is done".
1507 pub const IPPROTO_DONE: ::c_int = 257;
1508 
1509 /* Only used internally, so can be outside the range of valid IP protocols. */
1510 /// divert pseudo-protocol
1511 pub const IPPROTO_DIVERT: ::c_int = 258;
1512 /// SeND pseudo-protocol
1513 pub const IPPROTO_SEND: ::c_int = 259;
1514 
1515 // sys/netinet/TCP.h
1516 pub const TCP_MD5SIG: ::c_int = 16;
1517 pub const TCP_INFO: ::c_int = 32;
1518 pub const TCP_CONGESTION: ::c_int = 64;
1519 pub const TCP_CCALGOOPT: ::c_int = 65;
1520 pub const TCP_KEEPINIT: ::c_int = 128;
1521 pub const TCP_FASTOPEN: ::c_int = 1025;
1522 pub const TCP_PCAP_OUT: ::c_int = 2048;
1523 pub const TCP_PCAP_IN: ::c_int = 4096;
1524 
1525 pub const IP_BINDANY: ::c_int = 24;
1526 pub const IP_BINDMULTI: ::c_int = 25;
1527 pub const IP_RSS_LISTEN_BUCKET: ::c_int = 26;
1528 pub const IP_ORIGDSTADDR: ::c_int = 27;
1529 pub const IP_RECVORIGDSTADDR: ::c_int = IP_ORIGDSTADDR;
1530 
1531 pub const IP_RECVTOS: ::c_int = 68;
1532 
1533 pub const IPV6_BINDANY: ::c_int = 64;
1534 pub const IPV6_ORIGDSTADDR: ::c_int = 72;
1535 pub const IPV6_RECVORIGDSTADDR: ::c_int = IPV6_ORIGDSTADDR;
1536 
1537 pub const PF_SLOW: ::c_int = AF_SLOW;
1538 pub const PF_SCLUSTER: ::c_int = AF_SCLUSTER;
1539 pub const PF_ARP: ::c_int = AF_ARP;
1540 pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH;
1541 pub const PF_IEEE80211: ::c_int = AF_IEEE80211;
1542 pub const PF_INET_SDP: ::c_int = AF_INET_SDP;
1543 pub const PF_INET6_SDP: ::c_int = AF_INET6_SDP;
1544 
1545 pub const NET_RT_DUMP: ::c_int = 1;
1546 pub const NET_RT_FLAGS: ::c_int = 2;
1547 pub const NET_RT_IFLIST: ::c_int = 3;
1548 pub const NET_RT_IFMALIST: ::c_int = 4;
1549 pub const NET_RT_IFLISTL: ::c_int = 5;
1550 
1551 // System V IPC
1552 pub const IPC_INFO: ::c_int = 3;
1553 pub const MSG_NOERROR: ::c_int = 0o10000;
1554 pub const SHM_LOCK: ::c_int = 11;
1555 pub const SHM_UNLOCK: ::c_int = 12;
1556 pub const SHM_STAT: ::c_int = 13;
1557 pub const SHM_INFO: ::c_int = 14;
1558 pub const SHM_ANON: *mut ::c_char = 1 as *mut ::c_char;
1559 
1560 // The *_MAXID constants never should've been used outside of the
1561 // FreeBSD base system.  And with the exception of CTL_P1003_1B_MAXID,
1562 // they were all removed in svn r262489.  They remain here for backwards
1563 // compatibility only, and are scheduled to be removed in libc 1.0.0.
1564 #[doc(hidden)]
1565 #[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")]
1566 pub const CTL_MAXID: ::c_int = 10;
1567 #[doc(hidden)]
1568 #[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")]
1569 pub const KERN_MAXID: ::c_int = 38;
1570 #[doc(hidden)]
1571 #[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")]
1572 pub const HW_MAXID: ::c_int = 13;
1573 #[doc(hidden)]
1574 #[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")]
1575 pub const USER_MAXID: ::c_int = 21;
1576 #[doc(hidden)]
1577 #[deprecated(since = "0.2.74", note = "Removed in FreeBSD 13")]
1578 pub const CTL_P1003_1B_MAXID: ::c_int = 26;
1579 
1580 pub const MSG_NOTIFICATION: ::c_int = 0x00002000;
1581 pub const MSG_NBIO: ::c_int = 0x00004000;
1582 pub const MSG_COMPAT: ::c_int = 0x00008000;
1583 pub const MSG_CMSG_CLOEXEC: ::c_int = 0x00040000;
1584 pub const MSG_NOSIGNAL: ::c_int = 0x20000;
1585 
1586 // utmpx entry types
1587 pub const EMPTY: ::c_short = 0;
1588 pub const BOOT_TIME: ::c_short = 1;
1589 pub const OLD_TIME: ::c_short = 2;
1590 pub const NEW_TIME: ::c_short = 3;
1591 pub const USER_PROCESS: ::c_short = 4;
1592 pub const INIT_PROCESS: ::c_short = 5;
1593 pub const LOGIN_PROCESS: ::c_short = 6;
1594 pub const DEAD_PROCESS: ::c_short = 7;
1595 pub const SHUTDOWN_TIME: ::c_short = 8;
1596 // utmp database types
1597 pub const UTXDB_ACTIVE: ::c_int = 0;
1598 pub const UTXDB_LASTLOGIN: ::c_int = 1;
1599 pub const UTXDB_LOG: ::c_int = 2;
1600 
1601 pub const LC_COLLATE_MASK: ::c_int = 1 << 0;
1602 pub const LC_CTYPE_MASK: ::c_int = 1 << 1;
1603 pub const LC_MONETARY_MASK: ::c_int = 1 << 2;
1604 pub const LC_NUMERIC_MASK: ::c_int = 1 << 3;
1605 pub const LC_TIME_MASK: ::c_int = 1 << 4;
1606 pub const LC_MESSAGES_MASK: ::c_int = 1 << 5;
1607 pub const LC_ALL_MASK: ::c_int = LC_COLLATE_MASK
1608     | LC_CTYPE_MASK
1609     | LC_MESSAGES_MASK
1610     | LC_MONETARY_MASK
1611     | LC_NUMERIC_MASK
1612     | LC_TIME_MASK;
1613 
1614 pub const WSTOPPED: ::c_int = 2; // same as WUNTRACED
1615 pub const WCONTINUED: ::c_int = 4;
1616 pub const WNOWAIT: ::c_int = 8;
1617 pub const WEXITED: ::c_int = 16;
1618 pub const WTRAPPED: ::c_int = 32;
1619 
1620 // FreeBSD defines a great many more of these, we only expose the
1621 // standardized ones.
1622 pub const P_PID: idtype_t = 0;
1623 pub const P_PGID: idtype_t = 2;
1624 pub const P_ALL: idtype_t = 7;
1625 
1626 pub const UTIME_OMIT: c_long = -2;
1627 pub const UTIME_NOW: c_long = -1;
1628 
1629 pub const B460800: ::speed_t = 460800;
1630 pub const B921600: ::speed_t = 921600;
1631 
1632 pub const AT_FDCWD: ::c_int = -100;
1633 pub const AT_EACCESS: ::c_int = 0x100;
1634 pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x200;
1635 pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400;
1636 pub const AT_REMOVEDIR: ::c_int = 0x800;
1637 
1638 pub const AT_NULL: ::c_int = 0;
1639 pub const AT_IGNORE: ::c_int = 1;
1640 pub const AT_EXECFD: ::c_int = 2;
1641 pub const AT_PHDR: ::c_int = 3;
1642 pub const AT_PHENT: ::c_int = 4;
1643 pub const AT_PHNUM: ::c_int = 5;
1644 pub const AT_PAGESZ: ::c_int = 6;
1645 pub const AT_BASE: ::c_int = 7;
1646 pub const AT_FLAGS: ::c_int = 8;
1647 pub const AT_ENTRY: ::c_int = 9;
1648 pub const AT_NOTELF: ::c_int = 10;
1649 pub const AT_UID: ::c_int = 11;
1650 pub const AT_EUID: ::c_int = 12;
1651 pub const AT_GID: ::c_int = 13;
1652 pub const AT_EGID: ::c_int = 14;
1653 pub const AT_EXECPATH: ::c_int = 15;
1654 
1655 pub const TABDLY: ::tcflag_t = 0x00000004;
1656 pub const TAB0: ::tcflag_t = 0x00000000;
1657 pub const TAB3: ::tcflag_t = 0x00000004;
1658 
1659 pub const _PC_ACL_NFS4: ::c_int = 64;
1660 
1661 pub const _SC_CPUSET_SIZE: ::c_int = 122;
1662 
1663 pub const _UUID_NODE_LEN: usize = 6;
1664 
1665 // Flags which can be passed to pdfork(2)
1666 pub const PD_DAEMON: ::c_int = 0x00000001;
1667 pub const PD_CLOEXEC: ::c_int = 0x00000002;
1668 pub const PD_ALLOWED_AT_FORK: ::c_int = PD_DAEMON | PD_CLOEXEC;
1669 
1670 // Values for struct rtprio (type_ field)
1671 pub const RTP_PRIO_REALTIME: ::c_ushort = 2;
1672 pub const RTP_PRIO_NORMAL: ::c_ushort = 3;
1673 pub const RTP_PRIO_IDLE: ::c_ushort = 4;
1674 
1675 pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x01;
1676 pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x02;
1677 pub const POSIX_SPAWN_SETSCHEDPARAM: ::c_int = 0x04;
1678 pub const POSIX_SPAWN_SETSCHEDULER: ::c_int = 0x08;
1679 pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x10;
1680 pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x20;
1681 
1682 // Flags for chflags(2)
1683 pub const UF_SYSTEM: ::c_ulong = 0x00000080;
1684 pub const UF_SPARSE: ::c_ulong = 0x00000100;
1685 pub const UF_OFFLINE: ::c_ulong = 0x00000200;
1686 pub const UF_REPARSE: ::c_ulong = 0x00000400;
1687 pub const UF_ARCHIVE: ::c_ulong = 0x00000800;
1688 pub const UF_READONLY: ::c_ulong = 0x00001000;
1689 pub const UF_HIDDEN: ::c_ulong = 0x00008000;
1690 pub const SF_SNAPSHOT: ::c_ulong = 0x00200000;
1691 
1692 // fcntl commands
1693 pub const F_ADD_SEALS: ::c_int = 19;
1694 pub const F_DUP2FD: ::c_int = 10;
1695 pub const F_DUP2FD_CLOEXEC: ::c_int = 18;
1696 pub const F_GET_SEALS: ::c_int = 20;
1697 pub const F_OGETLK: ::c_int = 7;
1698 pub const F_OSETLK: ::c_int = 8;
1699 pub const F_OSETLKW: ::c_int = 9;
1700 pub const F_RDAHEAD: ::c_int = 16;
1701 pub const F_READAHEAD: ::c_int = 15;
1702 pub const F_SETLK_REMOTE: ::c_int = 14;
1703 
1704 // for use with F_ADD_SEALS
1705 pub const F_SEAL_GROW: ::c_int = 4;
1706 pub const F_SEAL_SEAL: ::c_int = 1;
1707 pub const F_SEAL_SHRINK: ::c_int = 2;
1708 pub const F_SEAL_WRITE: ::c_int = 8;
1709 
1710 // For getrandom()
1711 pub const GRND_NONBLOCK: ::c_uint = 0x1;
1712 pub const GRND_RANDOM: ::c_uint = 0x2;
1713 pub const GRND_INSECURE: ::c_uint = 0x4;
1714 
1715 // For realhostname* api
1716 pub const HOSTNAME_FOUND: ::c_int = 0;
1717 pub const HOSTNAME_INCORRECTNAME: ::c_int = 1;
1718 pub const HOSTNAME_INVALIDADDR: ::c_int = 2;
1719 pub const HOSTNAME_INVALIDNAME: ::c_int = 3;
1720 
1721 // For rfork
1722 pub const RFFDG: ::c_int = 4;
1723 pub const RFPROC: ::c_int = 16;
1724 pub const RFMEM: ::c_int = 32;
1725 pub const RFNOWAIT: ::c_int = 64;
1726 pub const RFCFDG: ::c_int = 4096;
1727 pub const RFTHREAD: ::c_int = 8192;
1728 pub const RFLINUXTHPN: ::c_int = 65536;
1729 pub const RFTSIGZMB: ::c_int = 524288;
1730 pub const RFSPAWN: ::c_int = 2147483648;
1731 
1732 // For eventfd
1733 pub const EFD_SEMAPHORE: ::c_int = 0x1;
1734 pub const EFD_NONBLOCK: ::c_int = 0x4;
1735 pub const EFD_CLOEXEC: ::c_int = 0x100000;
1736 
1737 pub const MALLOCX_ZERO: ::c_int = 0x40;
1738 
1739 /// size of returned wchan message
1740 pub const WMESGLEN: usize = 8;
1741 /// size of returned lock name
1742 pub const LOCKNAMELEN: usize = 8;
1743 /// size of returned thread name
1744 pub const TDNAMLEN: usize = 16;
1745 /// size of returned ki_comm name
1746 pub const COMMLEN: usize = 19;
1747 /// size of returned ki_emul
1748 pub const KI_EMULNAMELEN: usize = 16;
1749 /// number of groups in ki_groups
1750 pub const KI_NGROUPS: usize = 16;
1751 cfg_if! {
1752     if #[cfg(freebsd11)] {
1753         pub const KI_NSPARE_INT: usize = 4;
1754     } else {
1755         pub const KI_NSPARE_INT: usize = 2;
1756     }
1757 }
1758 pub const KI_NSPARE_LONG: usize = 12;
1759 /// Flags for the process credential.
1760 pub const KI_CRF_CAPABILITY_MODE: usize = 0x00000001;
1761 /// Steal a bit from ki_cr_flags to indicate that the cred had more than
1762 /// KI_NGROUPS groups.
1763 pub const KI_CRF_GRP_OVERFLOW: usize = 0x80000000;
1764 /// controlling tty vnode active
1765 pub const KI_CTTY: usize = 0x00000001;
1766 /// session leader
1767 pub const KI_SLEADER: usize = 0x00000002;
1768 /// proc blocked on lock ki_lockname
1769 pub const KI_LOCKBLOCK: usize = 0x00000004;
1770 /// size of returned ki_login
1771 pub const LOGNAMELEN: usize = 17;
1772 /// size of returned ki_loginclass
1773 pub const LOGINCLASSLEN: usize = 17;
1774 
1775 pub const KF_ATTR_VALID: ::c_int = 0x0001;
1776 pub const KF_TYPE_NONE: ::c_int = 0;
1777 pub const KF_TYPE_VNODE: ::c_int = 1;
1778 pub const KF_TYPE_SOCKET: ::c_int = 2;
1779 pub const KF_TYPE_PIPE: ::c_int = 3;
1780 pub const KF_TYPE_FIFO: ::c_int = 4;
1781 pub const KF_TYPE_KQUEUE: ::c_int = 5;
1782 pub const KF_TYPE_MQUEUE: ::c_int = 7;
1783 pub const KF_TYPE_SHM: ::c_int = 8;
1784 pub const KF_TYPE_SEM: ::c_int = 9;
1785 pub const KF_TYPE_PTS: ::c_int = 10;
1786 pub const KF_TYPE_PROCDESC: ::c_int = 11;
1787 pub const KF_TYPE_DEV: ::c_int = 12;
1788 pub const KF_TYPE_UNKNOWN: ::c_int = 255;
1789 
1790 pub const KF_VTYPE_VNON: ::c_int = 0;
1791 pub const KF_VTYPE_VREG: ::c_int = 1;
1792 pub const KF_VTYPE_VDIR: ::c_int = 2;
1793 pub const KF_VTYPE_VBLK: ::c_int = 3;
1794 pub const KF_VTYPE_VCHR: ::c_int = 4;
1795 pub const KF_VTYPE_VLNK: ::c_int = 5;
1796 pub const KF_VTYPE_VSOCK: ::c_int = 6;
1797 pub const KF_VTYPE_VFIFO: ::c_int = 7;
1798 pub const KF_VTYPE_VBAD: ::c_int = 8;
1799 pub const KF_VTYPE_UNKNOWN: ::c_int = 255;
1800 
1801 /// Current working directory
1802 pub const KF_FD_TYPE_CWD: ::c_int = -1;
1803 /// Root directory
1804 pub const KF_FD_TYPE_ROOT: ::c_int = -2;
1805 /// Jail directory
1806 pub const KF_FD_TYPE_JAIL: ::c_int = -3;
1807 /// Ktrace vnode
1808 pub const KF_FD_TYPE_TRACE: ::c_int = -4;
1809 pub const KF_FD_TYPE_TEXT: ::c_int = -5;
1810 /// Controlling terminal
1811 pub const KF_FD_TYPE_CTTY: ::c_int = -6;
1812 pub const KF_FLAG_READ: ::c_int = 0x00000001;
1813 pub const KF_FLAG_WRITE: ::c_int = 0x00000002;
1814 pub const KF_FLAG_APPEND: ::c_int = 0x00000004;
1815 pub const KF_FLAG_ASYNC: ::c_int = 0x00000008;
1816 pub const KF_FLAG_FSYNC: ::c_int = 0x00000010;
1817 pub const KF_FLAG_NONBLOCK: ::c_int = 0x00000020;
1818 pub const KF_FLAG_DIRECT: ::c_int = 0x00000040;
1819 pub const KF_FLAG_HASLOCK: ::c_int = 0x00000080;
1820 pub const KF_FLAG_SHLOCK: ::c_int = 0x00000100;
1821 pub const KF_FLAG_EXLOCK: ::c_int = 0x00000200;
1822 pub const KF_FLAG_NOFOLLOW: ::c_int = 0x00000400;
1823 pub const KF_FLAG_CREAT: ::c_int = 0x00000800;
1824 pub const KF_FLAG_TRUNC: ::c_int = 0x00001000;
1825 pub const KF_FLAG_EXCL: ::c_int = 0x00002000;
1826 pub const KF_FLAG_EXEC: ::c_int = 0x00004000;
1827 
1828 pub const KVME_TYPE_NONE: ::c_int = 0;
1829 pub const KVME_TYPE_DEFAULT: ::c_int = 1;
1830 pub const KVME_TYPE_VNODE: ::c_int = 2;
1831 pub const KVME_TYPE_SWAP: ::c_int = 3;
1832 pub const KVME_TYPE_DEVICE: ::c_int = 4;
1833 pub const KVME_TYPE_PHYS: ::c_int = 5;
1834 pub const KVME_TYPE_DEAD: ::c_int = 6;
1835 pub const KVME_TYPE_SG: ::c_int = 7;
1836 pub const KVME_TYPE_MGTDEVICE: ::c_int = 8;
1837 // Present in `sys/user.h` but is undefined for whatever reason...
1838 // pub const KVME_TYPE_GUARD: ::c_int = 9;
1839 pub const KVME_TYPE_UNKNOWN: ::c_int = 255;
1840 pub const KVME_PROT_READ: ::c_int = 0x00000001;
1841 pub const KVME_PROT_WRITE: ::c_int = 0x00000002;
1842 pub const KVME_PROT_EXEC: ::c_int = 0x00000004;
1843 pub const KVME_FLAG_COW: ::c_int = 0x00000001;
1844 pub const KVME_FLAG_NEEDS_COPY: ::c_int = 0x00000002;
1845 pub const KVME_FLAG_NOCOREDUMP: ::c_int = 0x00000004;
1846 pub const KVME_FLAG_SUPER: ::c_int = 0x00000008;
1847 pub const KVME_FLAG_GROWS_UP: ::c_int = 0x00000010;
1848 pub const KVME_FLAG_GROWS_DOWN: ::c_int = 0x00000020;
1849 pub const KVME_FLAG_USER_WIRED: ::c_int = 0x00000040;
1850 
1851 pub const KKST_MAXLEN: ::c_int = 1024;
1852 /// Stack is valid.
1853 pub const KKST_STATE_STACKOK: ::c_int = 0;
1854 /// Stack swapped out.
1855 pub const KKST_STATE_SWAPPED: ::c_int = 1;
1856 pub const KKST_STATE_RUNNING: ::c_int = 2;
1857 
1858 // Constants about priority.
1859 pub const PRI_MIN: ::c_int = 0;
1860 pub const PRI_MAX: ::c_int = 255;
1861 pub const PRI_MIN_ITHD: ::c_int = PRI_MIN;
1862 pub const PRI_MAX_ITHD: ::c_int = PRI_MIN_REALTIME - 1;
1863 pub const PI_REALTIME: ::c_int = PRI_MIN_ITHD + 0;
1864 pub const PI_AV: ::c_int = PRI_MIN_ITHD + 4;
1865 pub const PI_NET: ::c_int = PRI_MIN_ITHD + 8;
1866 pub const PI_DISK: ::c_int = PRI_MIN_ITHD + 12;
1867 pub const PI_TTY: ::c_int = PRI_MIN_ITHD + 16;
1868 pub const PI_DULL: ::c_int = PRI_MIN_ITHD + 20;
1869 pub const PI_SOFT: ::c_int = PRI_MIN_ITHD + 24;
1870 pub const PRI_MIN_REALTIME: ::c_int = 48;
1871 pub const PRI_MAX_REALTIME: ::c_int = PRI_MIN_KERN - 1;
1872 pub const PRI_MIN_KERN: ::c_int = 80;
1873 pub const PRI_MAX_KERN: ::c_int = PRI_MIN_TIMESHARE - 1;
1874 pub const PSWP: ::c_int = PRI_MIN_KERN + 0;
1875 pub const PVM: ::c_int = PRI_MIN_KERN + 4;
1876 pub const PINOD: ::c_int = PRI_MIN_KERN + 8;
1877 pub const PRIBIO: ::c_int = PRI_MIN_KERN + 12;
1878 pub const PVFS: ::c_int = PRI_MIN_KERN + 16;
1879 pub const PZERO: ::c_int = PRI_MIN_KERN + 20;
1880 pub const PSOCK: ::c_int = PRI_MIN_KERN + 24;
1881 pub const PWAIT: ::c_int = PRI_MIN_KERN + 28;
1882 pub const PLOCK: ::c_int = PRI_MIN_KERN + 32;
1883 pub const PPAUSE: ::c_int = PRI_MIN_KERN + 36;
1884 pub const PRI_MIN_TIMESHARE: ::c_int = 120;
1885 pub const PRI_MAX_TIMESHARE: ::c_int = PRI_MIN_IDLE - 1;
1886 pub const PUSER: ::c_int = PRI_MIN_TIMESHARE;
1887 pub const PRI_MIN_IDLE: ::c_int = 224;
1888 pub const PRI_MAX_IDLE: ::c_int = PRI_MAX;
1889 
1890 pub const NZERO: ::c_int = 0;
1891 
1892 // Resource utilization information.
1893 pub const RUSAGE_THREAD: ::c_int = 1;
1894 
1895 cfg_if! {
1896     if #[cfg(any(freebsd11, target_pointer_width = "32"))] {
1897         pub const ARG_MAX: ::c_int = 256 * 1024;
1898     } else {
1899         pub const ARG_MAX: ::c_int = 2 * 256 * 1024;
1900     }
1901 }
1902 pub const CHILD_MAX: ::c_int = 40;
1903 /// max command name remembered
1904 pub const MAXCOMLEN: usize = 19;
1905 /// max interpreter file name length
1906 pub const MAXINTERP: ::c_int = ::PATH_MAX;
1907 /// max login name length (incl. NUL)
1908 pub const MAXLOGNAME: ::c_int = 33;
1909 /// max simultaneous processes
1910 pub const MAXUPRC: ::c_int = CHILD_MAX;
1911 /// max bytes for an exec function
1912 pub const NCARGS: ::c_int = ARG_MAX;
1913 ///  /* max number groups
1914 pub const NGROUPS: ::c_int = NGROUPS_MAX + 1;
1915 /// max open files per process
1916 pub const NOFILE: ::c_int = OPEN_MAX;
1917 /// marker for empty group set member
1918 pub const NOGROUP: ::c_int = 65535;
1919 /// max hostname size
1920 pub const MAXHOSTNAMELEN: ::c_int = 256;
1921 /// max bytes in term canon input line
1922 pub const MAX_CANON: ::c_int = 255;
1923 /// max bytes in terminal input
1924 pub const MAX_INPUT: ::c_int = 255;
1925 /// max bytes in a file name
1926 pub const NAME_MAX: ::c_int = 255;
1927 pub const MAXSYMLINKS: ::c_int = 32;
1928 /// max supplemental group id's
1929 pub const NGROUPS_MAX: ::c_int = 1023;
1930 /// max open files per process
1931 pub const OPEN_MAX: ::c_int = 64;
1932 
1933 pub const _POSIX_ARG_MAX: ::c_int = 4096;
1934 pub const _POSIX_LINK_MAX: ::c_int = 8;
1935 pub const _POSIX_MAX_CANON: ::c_int = 255;
1936 pub const _POSIX_MAX_INPUT: ::c_int = 255;
1937 pub const _POSIX_NAME_MAX: ::c_int = 14;
1938 pub const _POSIX_PIPE_BUF: ::c_int = 512;
1939 pub const _POSIX_SSIZE_MAX: ::c_int = 32767;
1940 pub const _POSIX_STREAM_MAX: ::c_int = 8;
1941 
1942 /// max ibase/obase values in bc(1)
1943 pub const BC_BASE_MAX: ::c_int = 99;
1944 /// max array elements in bc(1)
1945 pub const BC_DIM_MAX: ::c_int = 2048;
1946 /// max scale value in bc(1)
1947 pub const BC_SCALE_MAX: ::c_int = 99;
1948 /// max const string length in bc(1)
1949 pub const BC_STRING_MAX: ::c_int = 1000;
1950 /// max character class name size
1951 pub const CHARCLASS_NAME_MAX: ::c_int = 14;
1952 /// max weights for order keyword
1953 pub const COLL_WEIGHTS_MAX: ::c_int = 10;
1954 /// max expressions nested in expr(1)
1955 pub const EXPR_NEST_MAX: ::c_int = 32;
1956 /// max bytes in an input line
1957 pub const LINE_MAX: ::c_int = 2048;
1958 /// max RE's in interval notation
1959 pub const RE_DUP_MAX: ::c_int = 255;
1960 
1961 pub const _POSIX2_BC_BASE_MAX: ::c_int = 99;
1962 pub const _POSIX2_BC_DIM_MAX: ::c_int = 2048;
1963 pub const _POSIX2_BC_SCALE_MAX: ::c_int = 99;
1964 pub const _POSIX2_BC_STRING_MAX: ::c_int = 1000;
1965 pub const _POSIX2_CHARCLASS_NAME_MAX: ::c_int = 14;
1966 pub const _POSIX2_COLL_WEIGHTS_MAX: ::c_int = 2;
1967 pub const _POSIX2_EQUIV_CLASS_MAX: ::c_int = 2;
1968 pub const _POSIX2_EXPR_NEST_MAX: ::c_int = 32;
1969 pub const _POSIX2_LINE_MAX: ::c_int = 2048;
1970 pub const _POSIX2_RE_DUP_MAX: ::c_int = 255;
1971 
1972 // sys/proc.h
1973 pub const TDF_BORROWING: ::c_int = 0x00000001;
1974 pub const TDF_INPANIC: ::c_int = 0x00000002;
1975 pub const TDF_INMEM: ::c_int = 0x00000004;
1976 pub const TDF_SINTR: ::c_int = 0x00000008;
1977 pub const TDF_TIMEOUT: ::c_int = 0x00000010;
1978 pub const TDF_IDLETD: ::c_int = 0x00000020;
1979 pub const TDF_CANSWAP: ::c_int = 0x00000040;
1980 pub const TDF_KTH_SUSP: ::c_int = 0x00000100;
1981 pub const TDF_ALLPROCSUSP: ::c_int = 0x00000200;
1982 pub const TDF_BOUNDARY: ::c_int = 0x00000400;
1983 pub const TDF_ASTPENDING: ::c_int = 0x00000800;
1984 pub const TDF_SBDRY: ::c_int = 0x00002000;
1985 pub const TDF_UPIBLOCKED: ::c_int = 0x00004000;
1986 pub const TDF_NEEDSUSPCHK: ::c_int = 0x00008000;
1987 pub const TDF_NEEDRESCHED: ::c_int = 0x00010000;
1988 pub const TDF_NEEDSIGCHK: ::c_int = 0x00020000;
1989 pub const TDF_NOLOAD: ::c_int = 0x00040000;
1990 pub const TDF_SERESTART: ::c_int = 0x00080000;
1991 pub const TDF_THRWAKEUP: ::c_int = 0x00100000;
1992 pub const TDF_SEINTR: ::c_int = 0x00200000;
1993 pub const TDF_SWAPINREQ: ::c_int = 0x00400000;
1994 pub const TDF_UNUSED23: ::c_int = 0x00800000;
1995 pub const TDF_SCHED0: ::c_int = 0x01000000;
1996 pub const TDF_SCHED1: ::c_int = 0x02000000;
1997 pub const TDF_SCHED2: ::c_int = 0x04000000;
1998 pub const TDF_SCHED3: ::c_int = 0x08000000;
1999 pub const TDF_ALRMPEND: ::c_int = 0x10000000;
2000 pub const TDF_PROFPEND: ::c_int = 0x20000000;
2001 pub const TDF_MACPEND: ::c_int = 0x40000000;
2002 
2003 pub const TDB_SUSPEND: ::c_int = 0x00000001;
2004 pub const TDB_XSIG: ::c_int = 0x00000002;
2005 pub const TDB_USERWR: ::c_int = 0x00000004;
2006 pub const TDB_SCE: ::c_int = 0x00000008;
2007 pub const TDB_SCX: ::c_int = 0x00000010;
2008 pub const TDB_EXEC: ::c_int = 0x00000020;
2009 pub const TDB_FORK: ::c_int = 0x00000040;
2010 pub const TDB_STOPATFORK: ::c_int = 0x00000080;
2011 pub const TDB_CHILD: ::c_int = 0x00000100;
2012 pub const TDB_BORN: ::c_int = 0x00000200;
2013 pub const TDB_EXIT: ::c_int = 0x00000400;
2014 pub const TDB_VFORK: ::c_int = 0x00000800;
2015 pub const TDB_FSTP: ::c_int = 0x00001000;
2016 pub const TDB_STEP: ::c_int = 0x00002000;
2017 
2018 pub const TDP_OLDMASK: ::c_int = 0x00000001;
2019 pub const TDP_INKTR: ::c_int = 0x00000002;
2020 pub const TDP_INKTRACE: ::c_int = 0x00000004;
2021 pub const TDP_BUFNEED: ::c_int = 0x00000008;
2022 pub const TDP_COWINPROGRESS: ::c_int = 0x00000010;
2023 pub const TDP_ALTSTACK: ::c_int = 0x00000020;
2024 pub const TDP_DEADLKTREAT: ::c_int = 0x00000040;
2025 pub const TDP_NOFAULTING: ::c_int = 0x00000080;
2026 pub const TDP_OWEUPC: ::c_int = 0x00000200;
2027 pub const TDP_ITHREAD: ::c_int = 0x00000400;
2028 pub const TDP_SYNCIO: ::c_int = 0x00000800;
2029 pub const TDP_SCHED1: ::c_int = 0x00001000;
2030 pub const TDP_SCHED2: ::c_int = 0x00002000;
2031 pub const TDP_SCHED3: ::c_int = 0x00004000;
2032 pub const TDP_SCHED4: ::c_int = 0x00008000;
2033 pub const TDP_GEOM: ::c_int = 0x00010000;
2034 pub const TDP_SOFTDEP: ::c_int = 0x00020000;
2035 pub const TDP_NORUNNINGBUF: ::c_int = 0x00040000;
2036 pub const TDP_WAKEUP: ::c_int = 0x00080000;
2037 pub const TDP_INBDFLUSH: ::c_int = 0x00100000;
2038 pub const TDP_KTHREAD: ::c_int = 0x00200000;
2039 pub const TDP_CALLCHAIN: ::c_int = 0x00400000;
2040 pub const TDP_IGNSUSP: ::c_int = 0x00800000;
2041 pub const TDP_AUDITREC: ::c_int = 0x01000000;
2042 pub const TDP_RFPPWAIT: ::c_int = 0x02000000;
2043 pub const TDP_RESETSPUR: ::c_int = 0x04000000;
2044 pub const TDP_NERRNO: ::c_int = 0x08000000;
2045 pub const TDP_EXECVMSPC: ::c_int = 0x40000000;
2046 
2047 pub const TDI_SUSPENDED: ::c_int = 0x0001;
2048 pub const TDI_SLEEPING: ::c_int = 0x0002;
2049 pub const TDI_SWAPPED: ::c_int = 0x0004;
2050 pub const TDI_LOCK: ::c_int = 0x0008;
2051 pub const TDI_IWAIT: ::c_int = 0x0010;
2052 
2053 pub const P_ADVLOCK: ::c_int = 0x00000001;
2054 pub const P_CONTROLT: ::c_int = 0x00000002;
2055 pub const P_KPROC: ::c_int = 0x00000004;
2056 pub const P_UNUSED3: ::c_int = 0x00000008;
2057 pub const P_PPWAIT: ::c_int = 0x00000010;
2058 pub const P_PROFIL: ::c_int = 0x00000020;
2059 pub const P_STOPPROF: ::c_int = 0x00000040;
2060 pub const P_HADTHREADS: ::c_int = 0x00000080;
2061 pub const P_SUGID: ::c_int = 0x00000100;
2062 pub const P_SYSTEM: ::c_int = 0x00000200;
2063 pub const P_SINGLE_EXIT: ::c_int = 0x00000400;
2064 pub const P_TRACED: ::c_int = 0x00000800;
2065 pub const P_WAITED: ::c_int = 0x00001000;
2066 pub const P_WEXIT: ::c_int = 0x00002000;
2067 pub const P_EXEC: ::c_int = 0x00004000;
2068 pub const P_WKILLED: ::c_int = 0x00008000;
2069 pub const P_CONTINUED: ::c_int = 0x00010000;
2070 pub const P_STOPPED_SIG: ::c_int = 0x00020000;
2071 pub const P_STOPPED_TRACE: ::c_int = 0x00040000;
2072 pub const P_STOPPED_SINGLE: ::c_int = 0x00080000;
2073 pub const P_PROTECTED: ::c_int = 0x00100000;
2074 pub const P_SIGEVENT: ::c_int = 0x00200000;
2075 pub const P_SINGLE_BOUNDARY: ::c_int = 0x00400000;
2076 pub const P_HWPMC: ::c_int = 0x00800000;
2077 pub const P_JAILED: ::c_int = 0x01000000;
2078 pub const P_TOTAL_STOP: ::c_int = 0x02000000;
2079 pub const P_INEXEC: ::c_int = 0x04000000;
2080 pub const P_STATCHILD: ::c_int = 0x08000000;
2081 pub const P_INMEM: ::c_int = 0x10000000;
2082 pub const P_SWAPPINGOUT: ::c_int = 0x20000000;
2083 pub const P_SWAPPINGIN: ::c_int = 0x40000000;
2084 pub const P_PPTRACE: ::c_int = 0x80000000;
2085 pub const P_STOPPED: ::c_int = P_STOPPED_SIG | P_STOPPED_SINGLE | P_STOPPED_TRACE;
2086 
2087 pub const P2_INHERIT_PROTECTED: ::c_int = 0x00000001;
2088 pub const P2_NOTRACE: ::c_int = 0x00000002;
2089 pub const P2_NOTRACE_EXEC: ::c_int = 0x00000004;
2090 pub const P2_AST_SU: ::c_int = 0x00000008;
2091 pub const P2_PTRACE_FSTP: ::c_int = 0x00000010;
2092 pub const P2_TRAPCAP: ::c_int = 0x00000020;
2093 pub const P2_STKGAP_DISABLE: ::c_int = 0x00000800;
2094 pub const P2_STKGAP_DISABLE_EXEC: ::c_int = 0x00001000;
2095 
2096 pub const P_TREE_ORPHANED: ::c_int = 0x00000001;
2097 pub const P_TREE_FIRST_ORPHAN: ::c_int = 0x00000002;
2098 pub const P_TREE_REAPER: ::c_int = 0x00000004;
2099 
2100 pub const SIDL: ::c_char = 1;
2101 pub const SRUN: ::c_char = 2;
2102 pub const SSLEEP: ::c_char = 3;
2103 pub const SSTOP: ::c_char = 4;
2104 pub const SZOMB: ::c_char = 5;
2105 pub const SWAIT: ::c_char = 6;
2106 pub const SLOCK: ::c_char = 7;
2107 
2108 pub const P_MAGIC: ::c_int = 0xbeefface;
2109 
2110 pub const TDP_SIGFASTBLOCK: ::c_int = 0x00000100;
2111 pub const TDP_UIOHELD: ::c_int = 0x10000000;
2112 pub const TDP_SIGFASTPENDING: ::c_int = 0x80000000;
2113 pub const TDP2_COMPAT32RB: ::c_int = 0x00000002;
2114 pub const P2_PROTMAX_ENABLE: ::c_int = 0x00000200;
2115 pub const P2_PROTMAX_DISABLE: ::c_int = 0x00000400;
2116 pub const TDP2_SBPAGES: ::c_int = 0x00000001;
2117 pub const P2_ASLR_ENABLE: ::c_int = 0x00000040;
2118 pub const P2_ASLR_DISABLE: ::c_int = 0x00000080;
2119 pub const P2_ASLR_IGNSTART: ::c_int = 0x00000100;
2120 pub const P_TREE_GRPEXITED: ::c_int = 0x00000008;
2121 
2122 const_fn! {
2123     {const} fn _ALIGN(p: usize) -> usize {
2124         (p + _ALIGNBYTES) & !_ALIGNBYTES
2125     }
2126 }
2127 
2128 f! {
2129     pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar {
2130         (cmsg as *mut ::c_uchar)
2131             .offset(_ALIGN(::mem::size_of::<::cmsghdr>()) as isize)
2132     }
2133 
2134     pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
2135         _ALIGN(::mem::size_of::<::cmsghdr>()) as ::c_uint + length
2136     }
2137 
2138     pub fn CMSG_NXTHDR(mhdr: *const ::msghdr, cmsg: *const ::cmsghdr)
2139         -> *mut ::cmsghdr
2140     {
2141         if cmsg.is_null() {
2142             return ::CMSG_FIRSTHDR(mhdr);
2143         };
2144         let next = cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize)
2145             + _ALIGN(::mem::size_of::<::cmsghdr>());
2146         let max = (*mhdr).msg_control as usize
2147             + (*mhdr).msg_controllen as usize;
2148         if next > max {
2149             0 as *mut ::cmsghdr
2150         } else {
2151             (cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize))
2152                 as *mut ::cmsghdr
2153         }
2154     }
2155 
2156     pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {
2157         (_ALIGN(::mem::size_of::<::cmsghdr>()) + _ALIGN(length as usize))
2158             as ::c_uint
2159     }
2160 
2161     pub fn MALLOCX_ALIGN(lg: ::c_uint) -> ::c_int {
2162         ffsl(lg as ::c_long - 1)
2163     }
2164 
2165     pub {const} fn MALLOCX_TCACHE(tc: ::c_int) -> ::c_int {
2166         (tc + 2) << 8 as ::c_int
2167     }
2168 
2169     pub {const} fn MALLOCX_ARENA(a: ::c_int) -> ::c_int {
2170         (a + 1) << 20 as ::c_int
2171     }
2172 
2173     pub fn SOCKCREDSIZE(ngrps: usize) -> usize {
2174         let ngrps = if ngrps > 0 {
2175             ngrps - 1
2176         } else {
2177             0
2178         };
2179         ::mem::size_of::<sockcred>() + ::mem::size_of::<::gid_t>() * ngrps
2180     }
2181 
2182     pub fn uname(buf: *mut ::utsname) -> ::c_int {
2183         __xuname(256, buf as *mut ::c_void)
2184     }
2185 
2186     pub fn CPU_ZERO(cpuset: &mut cpuset_t) -> () {
2187         for slot in cpuset.__bits.iter_mut() {
2188             *slot = 0;
2189         }
2190     }
2191 
2192     pub fn CPU_FILL(cpuset: &mut cpuset_t) -> () {
2193         for slot in cpuset.__bits.iter_mut() {
2194             *slot = !0;
2195         }
2196     }
2197 
2198     pub fn CPU_SET(cpu: usize, cpuset: &mut cpuset_t) -> () {
2199         let bitset_bits = ::mem::size_of::<::c_long>();
2200         let (idx, offset) = (cpu / bitset_bits, cpu % bitset_bits);
2201         cpuset.__bits[idx] |= 1 << offset;
2202         ()
2203     }
2204 
2205     pub fn CPU_CLR(cpu: usize, cpuset: &mut cpuset_t) -> () {
2206         let bitset_bits = ::mem::size_of::<::c_long>();
2207         let (idx, offset) = (cpu / bitset_bits, cpu % bitset_bits);
2208         cpuset.__bits[idx] &= !(1 << offset);
2209         ()
2210     }
2211 
2212     pub fn CPU_ISSET(cpu: usize, cpuset: &cpuset_t) -> bool {
2213         let bitset_bits = ::mem::size_of::<::c_long>();
2214         let (idx, offset) = (cpu / bitset_bits, cpu % bitset_bits);
2215         0 != cpuset.__bits[idx] & (1 << offset)
2216     }
2217 }
2218 
2219 safe_f! {
2220     pub {const} fn WIFSIGNALED(status: ::c_int) -> bool {
2221         (status & 0o177) != 0o177 && (status & 0o177) != 0 && status != 0x13
2222     }
2223 }
2224 
2225 extern "C" {
__error() -> *mut ::c_int2226     pub fn __error() -> *mut ::c_int;
2227 
aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int2228     pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
aio_error(aiocbp: *const aiocb) -> ::c_int2229     pub fn aio_error(aiocbp: *const aiocb) -> ::c_int;
aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int2230     pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
aio_read(aiocbp: *mut aiocb) -> ::c_int2231     pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int;
aio_return(aiocbp: *mut aiocb) -> ::ssize_t2232     pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t;
aio_suspend( aiocb_list: *const *const aiocb, nitems: ::c_int, timeout: *const ::timespec, ) -> ::c_int2233     pub fn aio_suspend(
2234         aiocb_list: *const *const aiocb,
2235         nitems: ::c_int,
2236         timeout: *const ::timespec,
2237     ) -> ::c_int;
aio_write(aiocbp: *mut aiocb) -> ::c_int2238     pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
2239 
devname_r( dev: ::dev_t, mode: ::mode_t, buf: *mut ::c_char, len: ::c_int, ) -> *mut ::c_char2240     pub fn devname_r(
2241         dev: ::dev_t,
2242         mode: ::mode_t,
2243         buf: *mut ::c_char,
2244         len: ::c_int,
2245     ) -> *mut ::c_char;
2246 
extattr_delete_fd( fd: ::c_int, attrnamespace: ::c_int, attrname: *const ::c_char, ) -> ::c_int2247     pub fn extattr_delete_fd(
2248         fd: ::c_int,
2249         attrnamespace: ::c_int,
2250         attrname: *const ::c_char,
2251     ) -> ::c_int;
extattr_delete_file( path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char, ) -> ::c_int2252     pub fn extattr_delete_file(
2253         path: *const ::c_char,
2254         attrnamespace: ::c_int,
2255         attrname: *const ::c_char,
2256     ) -> ::c_int;
extattr_delete_link( path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char, ) -> ::c_int2257     pub fn extattr_delete_link(
2258         path: *const ::c_char,
2259         attrnamespace: ::c_int,
2260         attrname: *const ::c_char,
2261     ) -> ::c_int;
extattr_get_fd( fd: ::c_int, attrnamespace: ::c_int, attrname: *const ::c_char, data: *mut ::c_void, nbytes: ::size_t, ) -> ::ssize_t2262     pub fn extattr_get_fd(
2263         fd: ::c_int,
2264         attrnamespace: ::c_int,
2265         attrname: *const ::c_char,
2266         data: *mut ::c_void,
2267         nbytes: ::size_t,
2268     ) -> ::ssize_t;
extattr_get_file( path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char, data: *mut ::c_void, nbytes: ::size_t, ) -> ::ssize_t2269     pub fn extattr_get_file(
2270         path: *const ::c_char,
2271         attrnamespace: ::c_int,
2272         attrname: *const ::c_char,
2273         data: *mut ::c_void,
2274         nbytes: ::size_t,
2275     ) -> ::ssize_t;
extattr_get_link( path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char, data: *mut ::c_void, nbytes: ::size_t, ) -> ::ssize_t2276     pub fn extattr_get_link(
2277         path: *const ::c_char,
2278         attrnamespace: ::c_int,
2279         attrname: *const ::c_char,
2280         data: *mut ::c_void,
2281         nbytes: ::size_t,
2282     ) -> ::ssize_t;
extattr_list_fd( fd: ::c_int, attrnamespace: ::c_int, data: *mut ::c_void, nbytes: ::size_t, ) -> ::ssize_t2283     pub fn extattr_list_fd(
2284         fd: ::c_int,
2285         attrnamespace: ::c_int,
2286         data: *mut ::c_void,
2287         nbytes: ::size_t,
2288     ) -> ::ssize_t;
extattr_list_file( path: *const ::c_char, attrnamespace: ::c_int, data: *mut ::c_void, nbytes: ::size_t, ) -> ::ssize_t2289     pub fn extattr_list_file(
2290         path: *const ::c_char,
2291         attrnamespace: ::c_int,
2292         data: *mut ::c_void,
2293         nbytes: ::size_t,
2294     ) -> ::ssize_t;
extattr_list_link( path: *const ::c_char, attrnamespace: ::c_int, data: *mut ::c_void, nbytes: ::size_t, ) -> ::ssize_t2295     pub fn extattr_list_link(
2296         path: *const ::c_char,
2297         attrnamespace: ::c_int,
2298         data: *mut ::c_void,
2299         nbytes: ::size_t,
2300     ) -> ::ssize_t;
extattr_set_fd( fd: ::c_int, attrnamespace: ::c_int, attrname: *const ::c_char, data: *const ::c_void, nbytes: ::size_t, ) -> ::ssize_t2301     pub fn extattr_set_fd(
2302         fd: ::c_int,
2303         attrnamespace: ::c_int,
2304         attrname: *const ::c_char,
2305         data: *const ::c_void,
2306         nbytes: ::size_t,
2307     ) -> ::ssize_t;
extattr_set_file( path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char, data: *const ::c_void, nbytes: ::size_t, ) -> ::ssize_t2308     pub fn extattr_set_file(
2309         path: *const ::c_char,
2310         attrnamespace: ::c_int,
2311         attrname: *const ::c_char,
2312         data: *const ::c_void,
2313         nbytes: ::size_t,
2314     ) -> ::ssize_t;
extattr_set_link( path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char, data: *const ::c_void, nbytes: ::size_t, ) -> ::ssize_t2315     pub fn extattr_set_link(
2316         path: *const ::c_char,
2317         attrnamespace: ::c_int,
2318         attrname: *const ::c_char,
2319         data: *const ::c_void,
2320         nbytes: ::size_t,
2321     ) -> ::ssize_t;
2322 
jail(jail: *mut ::jail) -> ::c_int2323     pub fn jail(jail: *mut ::jail) -> ::c_int;
jail_attach(jid: ::c_int) -> ::c_int2324     pub fn jail_attach(jid: ::c_int) -> ::c_int;
jail_remove(jid: ::c_int) -> ::c_int2325     pub fn jail_remove(jid: ::c_int) -> ::c_int;
jail_get(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int2326     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_int2327     pub fn jail_set(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int;
2328 
lio_listio( mode: ::c_int, aiocb_list: *const *mut aiocb, nitems: ::c_int, sevp: *mut sigevent, ) -> ::c_int2329     pub fn lio_listio(
2330         mode: ::c_int,
2331         aiocb_list: *const *mut aiocb,
2332         nitems: ::c_int,
2333         sevp: *mut sigevent,
2334     ) -> ::c_int;
2335 
posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int2336     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_int2337     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_int2338     pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int;
mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int2339     pub fn mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int;
2340 
getutxuser(user: *const ::c_char) -> *mut utmpx2341     pub fn getutxuser(user: *const ::c_char) -> *mut utmpx;
setutxdb(_type: ::c_int, file: *const ::c_char) -> ::c_int2342     pub fn setutxdb(_type: ::c_int, file: *const ::c_char) -> ::c_int;
2343 
aio_waitcomplete(iocbp: *mut *mut aiocb, timeout: *mut ::timespec) -> ::ssize_t2344     pub fn aio_waitcomplete(iocbp: *mut *mut aiocb, timeout: *mut ::timespec) -> ::ssize_t;
mq_getfd_np(mqd: ::mqd_t) -> ::c_int2345     pub fn mq_getfd_np(mqd: ::mqd_t) -> ::c_int;
2346 
waitid( idtype: idtype_t, id: ::id_t, infop: *mut ::siginfo_t, options: ::c_int, ) -> ::c_int2347     pub fn waitid(
2348         idtype: idtype_t,
2349         id: ::id_t,
2350         infop: *mut ::siginfo_t,
2351         options: ::c_int,
2352     ) -> ::c_int;
2353 
ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t2354     pub fn ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t;
shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int2355     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_void2356     pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void;
shmdt(shmaddr: *const ::c_void) -> ::c_int2357     pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int;
shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int2358     pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int;
semget(key: ::key_t, nsems: ::c_int, semflg: ::c_int) -> ::c_int2359     pub fn semget(key: ::key_t, nsems: ::c_int, semflg: ::c_int) -> ::c_int;
semctl(semid: ::c_int, semnum: ::c_int, cmd: ::c_int, ...) -> ::c_int2360     pub fn semctl(semid: ::c_int, semnum: ::c_int, cmd: ::c_int, ...) -> ::c_int;
semop(semid: ::c_int, sops: *mut sembuf, nsops: ::size_t) -> ::c_int2361     pub fn semop(semid: ::c_int, sops: *mut sembuf, nsops: ::size_t) -> ::c_int;
msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut ::msqid_ds) -> ::c_int2362     pub fn msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut ::msqid_ds) -> ::c_int;
msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int2363     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_int2364     pub fn msgsnd(
2365         msqid: ::c_int,
2366         msgp: *const ::c_void,
2367         msgsz: ::size_t,
2368         msgflg: ::c_int,
2369     ) -> ::c_int;
cfmakesane(termios: *mut ::termios)2370     pub fn cfmakesane(termios: *mut ::termios);
2371 
pdfork(fdp: *mut ::c_int, flags: ::c_int) -> ::pid_t2372     pub fn pdfork(fdp: *mut ::c_int, flags: ::c_int) -> ::pid_t;
pdgetpid(fd: ::c_int, pidp: *mut ::pid_t) -> ::c_int2373     pub fn pdgetpid(fd: ::c_int, pidp: *mut ::pid_t) -> ::c_int;
pdkill(fd: ::c_int, signum: ::c_int) -> ::c_int2374     pub fn pdkill(fd: ::c_int, signum: ::c_int) -> ::c_int;
2375 
rtprio_thread(function: ::c_int, lwpid: ::lwpid_t, rtp: *mut super::rtprio) -> ::c_int2376     pub fn rtprio_thread(function: ::c_int, lwpid: ::lwpid_t, rtp: *mut super::rtprio) -> ::c_int;
2377 
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_int2378     pub fn posix_spawn(
2379         pid: *mut ::pid_t,
2380         path: *const ::c_char,
2381         file_actions: *const ::posix_spawn_file_actions_t,
2382         attrp: *const ::posix_spawnattr_t,
2383         argv: *const *mut ::c_char,
2384         envp: *const *mut ::c_char,
2385     ) -> ::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_int2386     pub fn posix_spawnp(
2387         pid: *mut ::pid_t,
2388         file: *const ::c_char,
2389         file_actions: *const ::posix_spawn_file_actions_t,
2390         attrp: *const ::posix_spawnattr_t,
2391         argv: *const *mut ::c_char,
2392         envp: *const *mut ::c_char,
2393     ) -> ::c_int;
posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int2394     pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int;
posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int2395     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_int2396     pub fn posix_spawnattr_getsigdefault(
2397         attr: *const posix_spawnattr_t,
2398         default: *mut ::sigset_t,
2399     ) -> ::c_int;
posix_spawnattr_setsigdefault( attr: *mut posix_spawnattr_t, default: *const ::sigset_t, ) -> ::c_int2400     pub fn posix_spawnattr_setsigdefault(
2401         attr: *mut posix_spawnattr_t,
2402         default: *const ::sigset_t,
2403     ) -> ::c_int;
posix_spawnattr_getsigmask( attr: *const posix_spawnattr_t, default: *mut ::sigset_t, ) -> ::c_int2404     pub fn posix_spawnattr_getsigmask(
2405         attr: *const posix_spawnattr_t,
2406         default: *mut ::sigset_t,
2407     ) -> ::c_int;
posix_spawnattr_setsigmask( attr: *mut posix_spawnattr_t, default: *const ::sigset_t, ) -> ::c_int2408     pub fn posix_spawnattr_setsigmask(
2409         attr: *mut posix_spawnattr_t,
2410         default: *const ::sigset_t,
2411     ) -> ::c_int;
posix_spawnattr_getflags( attr: *const posix_spawnattr_t, flags: *mut ::c_short, ) -> ::c_int2412     pub fn posix_spawnattr_getflags(
2413         attr: *const posix_spawnattr_t,
2414         flags: *mut ::c_short,
2415     ) -> ::c_int;
posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int2416     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_int2417     pub fn posix_spawnattr_getpgroup(
2418         attr: *const posix_spawnattr_t,
2419         flags: *mut ::pid_t,
2420     ) -> ::c_int;
posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int2421     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_int2422     pub fn posix_spawnattr_getschedpolicy(
2423         attr: *const posix_spawnattr_t,
2424         flags: *mut ::c_int,
2425     ) -> ::c_int;
posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: ::c_int) -> ::c_int2426     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_int2427     pub fn posix_spawnattr_getschedparam(
2428         attr: *const posix_spawnattr_t,
2429         param: *mut ::sched_param,
2430     ) -> ::c_int;
posix_spawnattr_setschedparam( attr: *mut posix_spawnattr_t, param: *const ::sched_param, ) -> ::c_int2431     pub fn posix_spawnattr_setschedparam(
2432         attr: *mut posix_spawnattr_t,
2433         param: *const ::sched_param,
2434     ) -> ::c_int;
2435 
posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> ::c_int2436     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_int2437     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_int2438     pub fn posix_spawn_file_actions_addopen(
2439         actions: *mut posix_spawn_file_actions_t,
2440         fd: ::c_int,
2441         path: *const ::c_char,
2442         oflag: ::c_int,
2443         mode: ::mode_t,
2444     ) -> ::c_int;
posix_spawn_file_actions_addclose( actions: *mut posix_spawn_file_actions_t, fd: ::c_int, ) -> ::c_int2445     pub fn posix_spawn_file_actions_addclose(
2446         actions: *mut posix_spawn_file_actions_t,
2447         fd: ::c_int,
2448     ) -> ::c_int;
posix_spawn_file_actions_adddup2( actions: *mut posix_spawn_file_actions_t, fd: ::c_int, newfd: ::c_int, ) -> ::c_int2449     pub fn posix_spawn_file_actions_adddup2(
2450         actions: *mut posix_spawn_file_actions_t,
2451         fd: ::c_int,
2452         newfd: ::c_int,
2453     ) -> ::c_int;
2454 
uuidgen(store: *mut uuid, count: ::c_int) -> ::c_int2455     pub fn uuidgen(store: *mut uuid, count: ::c_int) -> ::c_int;
2456 
thr_kill(id: ::c_long, sig: ::c_int) -> ::c_int2457     pub fn thr_kill(id: ::c_long, sig: ::c_int) -> ::c_int;
thr_kill2(pid: ::pid_t, id: ::c_long, sig: ::c_int) -> ::c_int2458     pub fn thr_kill2(pid: ::pid_t, id: ::c_long, sig: ::c_int) -> ::c_int;
thr_self(tid: *mut ::c_long) -> ::c_int2459     pub fn thr_self(tid: *mut ::c_long) -> ::c_int;
pthread_getthreadid_np() -> ::c_int2460     pub fn pthread_getthreadid_np() -> ::c_int;
pthread_getaffinity_np( td: ::pthread_t, cpusetsize: ::size_t, cpusetp: *mut cpuset_t, ) -> ::c_int2461     pub fn pthread_getaffinity_np(
2462         td: ::pthread_t,
2463         cpusetsize: ::size_t,
2464         cpusetp: *mut cpuset_t,
2465     ) -> ::c_int;
pthread_setaffinity_np( td: ::pthread_t, cpusetsize: ::size_t, cpusetp: *const cpuset_t, ) -> ::c_int2466     pub fn pthread_setaffinity_np(
2467         td: ::pthread_t,
2468         cpusetsize: ::size_t,
2469         cpusetp: *const cpuset_t,
2470     ) -> ::c_int;
2471 
pthread_mutex_consistent(mutex: *mut ::pthread_mutex_t) -> ::c_int2472     pub fn pthread_mutex_consistent(mutex: *mut ::pthread_mutex_t) -> ::c_int;
2473 
pthread_mutexattr_getrobust( attr: *mut ::pthread_mutexattr_t, robust: *mut ::c_int, ) -> ::c_int2474     pub fn pthread_mutexattr_getrobust(
2475         attr: *mut ::pthread_mutexattr_t,
2476         robust: *mut ::c_int,
2477     ) -> ::c_int;
pthread_mutexattr_setrobust( attr: *mut ::pthread_mutexattr_t, robust: ::c_int, ) -> ::c_int2478     pub fn pthread_mutexattr_setrobust(
2479         attr: *mut ::pthread_mutexattr_t,
2480         robust: ::c_int,
2481     ) -> ::c_int;
2482 
pthread_spin_init(lock: *mut pthread_spinlock_t, pshared: ::c_int) -> ::c_int2483     pub fn pthread_spin_init(lock: *mut pthread_spinlock_t, pshared: ::c_int) -> ::c_int;
pthread_spin_destroy(lock: *mut pthread_spinlock_t) -> ::c_int2484     pub fn pthread_spin_destroy(lock: *mut pthread_spinlock_t) -> ::c_int;
pthread_spin_lock(lock: *mut pthread_spinlock_t) -> ::c_int2485     pub fn pthread_spin_lock(lock: *mut pthread_spinlock_t) -> ::c_int;
pthread_spin_trylock(lock: *mut pthread_spinlock_t) -> ::c_int2486     pub fn pthread_spin_trylock(lock: *mut pthread_spinlock_t) -> ::c_int;
pthread_spin_unlock(lock: *mut pthread_spinlock_t) -> ::c_int2487     pub fn pthread_spin_unlock(lock: *mut pthread_spinlock_t) -> ::c_int;
2488 
2489     #[cfg_attr(all(target_os = "freebsd", freebsd11), link_name = "statfs@FBSD_1.0")]
statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int2490     pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
2491     #[cfg_attr(all(target_os = "freebsd", freebsd11), link_name = "fstatfs@FBSD_1.0")]
fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int2492     pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
2493 
dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int2494     pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int;
__xuname(nmln: ::c_int, buf: *mut ::c_void) -> ::c_int2495     pub fn __xuname(nmln: ::c_int, buf: *mut ::c_void) -> ::c_int;
2496 
sendmmsg( sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::size_t, flags: ::c_int, ) -> ::ssize_t2497     pub fn sendmmsg(
2498         sockfd: ::c_int,
2499         msgvec: *mut ::mmsghdr,
2500         vlen: ::size_t,
2501         flags: ::c_int,
2502     ) -> ::ssize_t;
recvmmsg( sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::size_t, flags: ::c_int, timeout: *const ::timespec, ) -> ::ssize_t2503     pub fn recvmmsg(
2504         sockfd: ::c_int,
2505         msgvec: *mut ::mmsghdr,
2506         vlen: ::size_t,
2507         flags: ::c_int,
2508         timeout: *const ::timespec,
2509     ) -> ::ssize_t;
memmem( haystack: *const ::c_void, haystacklen: ::size_t, needle: *const ::c_void, needlelen: ::size_t, ) -> *mut ::c_void2510     pub fn memmem(
2511         haystack: *const ::c_void,
2512         haystacklen: ::size_t,
2513         needle: *const ::c_void,
2514         needlelen: ::size_t,
2515     ) -> *mut ::c_void;
2516 
nmount(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int2517     pub fn nmount(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int;
setproctitle(fmt: *const ::c_char, ...)2518     pub fn setproctitle(fmt: *const ::c_char, ...);
rfork(flags: ::c_int) -> ::c_int2519     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_int2520     pub fn cpuset_getaffinity(
2521         level: cpulevel_t,
2522         which: cpuwhich_t,
2523         id: ::id_t,
2524         setsize: ::size_t,
2525         mask: *mut cpuset_t,
2526     ) -> ::c_int;
cpuset_setaffinity( level: cpulevel_t, which: cpuwhich_t, id: ::id_t, setsize: ::size_t, mask: *const cpuset_t, ) -> ::c_int2527     pub fn cpuset_setaffinity(
2528         level: cpulevel_t,
2529         which: cpuwhich_t,
2530         id: ::id_t,
2531         setsize: ::size_t,
2532         mask: *const cpuset_t,
2533     ) -> ::c_int;
cap_enter() -> ::c_int2534     pub fn cap_enter() -> ::c_int;
cap_getmode(modep: *mut ::c_uint) -> ::c_int2535     pub fn cap_getmode(modep: *mut ::c_uint) -> ::c_int;
__cap_rights_init(version: ::c_int, rights: *mut cap_rights_t, ...) -> *mut cap_rights_t2536     pub fn __cap_rights_init(version: ::c_int, rights: *mut cap_rights_t, ...)
2537         -> *mut cap_rights_t;
__cap_rights_set(rights: *mut cap_rights_t, ...) -> *mut cap_rights_t2538     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_t2539     pub fn __cap_rights_clear(rights: *mut cap_rights_t, ...) -> *mut cap_rights_t;
__cap_rights_is_set(rights: *const cap_rights_t, ...) -> bool2540     pub fn __cap_rights_is_set(rights: *const cap_rights_t, ...) -> bool;
cap_rights_is_valid(rights: *const cap_rights_t) -> bool2541     pub fn cap_rights_is_valid(rights: *const cap_rights_t) -> bool;
cap_rights_limit(fd: ::c_int, rights: *const cap_rights_t) -> ::c_int2542     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_t2543     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_t2544     pub fn cap_rights_remove(dst: *mut cap_rights_t, src: *const cap_rights_t)
2545         -> *mut cap_rights_t;
cap_rights_contains(big: *const cap_rights_t, little: *const cap_rights_t) -> bool2546     pub fn cap_rights_contains(big: *const cap_rights_t, little: *const cap_rights_t) -> bool;
2547 
reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void2548     pub fn reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void;
2549 
ffs(value: ::c_int) -> ::c_int2550     pub fn ffs(value: ::c_int) -> ::c_int;
ffsl(value: ::c_long) -> ::c_int2551     pub fn ffsl(value: ::c_long) -> ::c_int;
ffsll(value: ::c_longlong) -> ::c_int2552     pub fn ffsll(value: ::c_longlong) -> ::c_int;
fls(value: ::c_int) -> ::c_int2553     pub fn fls(value: ::c_int) -> ::c_int;
flsl(value: ::c_long) -> ::c_int2554     pub fn flsl(value: ::c_long) -> ::c_int;
flsll(value: ::c_longlong) -> ::c_int2555     pub fn flsll(value: ::c_longlong) -> ::c_int;
malloc_usable_size(ptr: *const ::c_void) -> ::size_t2556     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, )2557     pub fn malloc_stats_print(
2558         write_cb: unsafe extern "C" fn(*mut ::c_void, *const ::c_char),
2559         cbopaque: *mut ::c_void,
2560         opt: *const ::c_char,
2561     );
mallctl( name: *const ::c_char, oldp: *mut ::c_void, oldlenp: *mut ::size_t, newp: *mut ::c_void, newlen: ::size_t, ) -> ::c_int2562     pub fn mallctl(
2563         name: *const ::c_char,
2564         oldp: *mut ::c_void,
2565         oldlenp: *mut ::size_t,
2566         newp: *mut ::c_void,
2567         newlen: ::size_t,
2568     ) -> ::c_int;
mallctlnametomib( name: *const ::c_char, mibp: *mut ::size_t, miplen: *mut ::size_t, ) -> ::c_int2569     pub fn mallctlnametomib(
2570         name: *const ::c_char,
2571         mibp: *mut ::size_t,
2572         miplen: *mut ::size_t,
2573     ) -> ::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_int2574     pub fn mallctlbymib(
2575         mib: *const ::size_t,
2576         mible: ::size_t,
2577         oldp: *mut ::c_void,
2578         oldlenp: *mut ::size_t,
2579         newp: *mut ::c_void,
2580         newlen: ::size_t,
2581     ) -> ::c_int;
mallocx(size: ::size_t, flags: ::c_int) -> *mut ::c_void2582     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_void2583     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_t2584     pub fn xallocx(ptr: *mut ::c_void, size: ::size_t, extra: ::size_t, flags: ::c_int)
2585         -> ::size_t;
sallocx(ptr: *const ::c_void, flags: ::c_int) -> ::size_t2586     pub fn sallocx(ptr: *const ::c_void, flags: ::c_int) -> ::size_t;
dallocx(ptr: *mut ::c_void, flags: ::c_int)2587     pub fn dallocx(ptr: *mut ::c_void, flags: ::c_int);
sdallocx(ptr: *mut ::c_void, size: ::size_t, flags: ::c_int)2588     pub fn sdallocx(ptr: *mut ::c_void, size: ::size_t, flags: ::c_int);
nallocx(size: ::size_t, flags: ::c_int) -> ::size_t2589     pub fn nallocx(size: ::size_t, flags: ::c_int) -> ::size_t;
2590 
procctl(idtype: ::idtype_t, id: ::id_t, cmd: ::c_int, data: *mut ::c_void) -> ::c_int2591     pub fn procctl(idtype: ::idtype_t, id: ::id_t, cmd: ::c_int, data: *mut ::c_void) -> ::c_int;
2592 
getpagesize() -> ::c_int2593     pub fn getpagesize() -> ::c_int;
2594 }
2595 
2596 #[link(name = "kvm")]
2597 extern "C" {
kvm_open( execfile: *const ::c_char, corefile: *const ::c_char, swapfile: *const ::c_char, flags: ::c_int, errstr: *const ::c_char, ) -> *mut kvm_t2598     pub fn kvm_open(
2599         execfile: *const ::c_char,
2600         corefile: *const ::c_char,
2601         swapfile: *const ::c_char,
2602         flags: ::c_int,
2603         errstr: *const ::c_char,
2604     ) -> *mut kvm_t;
kvm_close(kd: *mut kvm_t) -> ::c_int2605     pub fn kvm_close(kd: *mut kvm_t) -> ::c_int;
kvm_dpcpu_setcpu(kd: *mut kvm_t, cpu: ::c_uint) -> ::c_int2606     pub fn kvm_dpcpu_setcpu(kd: *mut kvm_t, cpu: ::c_uint) -> ::c_int;
kvm_getargv(kd: *mut kvm_t, p: *const kinfo_proc, nchr: ::c_int) -> *mut *mut ::c_char2607     pub fn kvm_getargv(kd: *mut kvm_t, p: *const kinfo_proc, nchr: ::c_int) -> *mut *mut ::c_char;
kvm_getcptime(kd: *mut kvm_t, cp_time: *mut ::c_long) -> ::c_int2608     pub fn kvm_getcptime(kd: *mut kvm_t, cp_time: *mut ::c_long) -> ::c_int;
kvm_getenvv(kd: *mut kvm_t, p: *const kinfo_proc, nchr: ::c_int) -> *mut *mut ::c_char2609     pub fn kvm_getenvv(kd: *mut kvm_t, p: *const kinfo_proc, nchr: ::c_int) -> *mut *mut ::c_char;
kvm_geterr(kd: *mut kvm_t) -> *mut ::c_char2610     pub fn kvm_geterr(kd: *mut kvm_t) -> *mut ::c_char;
kvm_getloadavg(kd: *mut kvm_t, loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int2611     pub fn kvm_getloadavg(kd: *mut kvm_t, loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int;
kvm_getmaxcpu(kd: *mut kvm_t) -> ::c_int2612     pub fn kvm_getmaxcpu(kd: *mut kvm_t) -> ::c_int;
kvm_getncpus(kd: *mut kvm_t) -> ::c_int2613     pub fn kvm_getncpus(kd: *mut kvm_t) -> ::c_int;
kvm_getpcpu(kd: *mut kvm_t, cpu: ::c_int) -> *mut ::c_void2614     pub fn kvm_getpcpu(kd: *mut kvm_t, cpu: ::c_int) -> *mut ::c_void;
kvm_counter_u64_fetch(kd: *mut kvm_t, base: ::c_ulong) -> u642615     pub fn kvm_counter_u64_fetch(kd: *mut kvm_t, base: ::c_ulong) -> u64;
kvm_getprocs( kd: *mut kvm_t, op: ::c_int, arg: ::c_int, cnt: *mut ::c_int, ) -> *mut kinfo_proc2616     pub fn kvm_getprocs(
2617         kd: *mut kvm_t,
2618         op: ::c_int,
2619         arg: ::c_int,
2620         cnt: *mut ::c_int,
2621     ) -> *mut kinfo_proc;
kvm_getswapinfo( kd: *mut kvm_t, info: *mut kvm_swap, maxswap: ::c_int, flags: ::c_int, ) -> ::c_int2622     pub fn kvm_getswapinfo(
2623         kd: *mut kvm_t,
2624         info: *mut kvm_swap,
2625         maxswap: ::c_int,
2626         flags: ::c_int,
2627     ) -> ::c_int;
kvm_native(kd: *mut kvm_t) -> ::c_int2628     pub fn kvm_native(kd: *mut kvm_t) -> ::c_int;
kvm_nlist(kd: *mut kvm_t, nl: *mut nlist) -> ::c_int2629     pub fn kvm_nlist(kd: *mut kvm_t, nl: *mut nlist) -> ::c_int;
kvm_nlist2(kd: *mut kvm_t, nl: *mut kvm_nlist) -> ::c_int2630     pub fn kvm_nlist2(kd: *mut kvm_t, nl: *mut kvm_nlist) -> ::c_int;
kvm_openfiles( execfile: *const ::c_char, corefile: *const ::c_char, swapfile: *const ::c_char, flags: ::c_int, errbuf: *mut ::c_char, ) -> *mut kvm_t2631     pub fn kvm_openfiles(
2632         execfile: *const ::c_char,
2633         corefile: *const ::c_char,
2634         swapfile: *const ::c_char,
2635         flags: ::c_int,
2636         errbuf: *mut ::c_char,
2637     ) -> *mut kvm_t;
kvm_read( kd: *mut kvm_t, addr: ::c_ulong, buf: *mut ::c_void, nbytes: ::size_t, ) -> ::ssize_t2638     pub fn kvm_read(
2639         kd: *mut kvm_t,
2640         addr: ::c_ulong,
2641         buf: *mut ::c_void,
2642         nbytes: ::size_t,
2643     ) -> ::ssize_t;
kvm_read_zpcpu( kd: *mut kvm_t, base: ::c_ulong, buf: *mut ::c_void, size: ::size_t, cpu: ::c_int, ) -> ::ssize_t2644     pub fn kvm_read_zpcpu(
2645         kd: *mut kvm_t,
2646         base: ::c_ulong,
2647         buf: *mut ::c_void,
2648         size: ::size_t,
2649         cpu: ::c_int,
2650     ) -> ::ssize_t;
kvm_read2( kd: *mut kvm_t, addr: kvaddr_t, buf: *mut ::c_void, nbytes: ::size_t, ) -> ::ssize_t2651     pub fn kvm_read2(
2652         kd: *mut kvm_t,
2653         addr: kvaddr_t,
2654         buf: *mut ::c_void,
2655         nbytes: ::size_t,
2656     ) -> ::ssize_t;
kvm_write( kd: *mut kvm_t, addr: ::c_ulong, buf: *const ::c_void, nbytes: ::size_t, ) -> ::ssize_t2657     pub fn kvm_write(
2658         kd: *mut kvm_t,
2659         addr: ::c_ulong,
2660         buf: *const ::c_void,
2661         nbytes: ::size_t,
2662     ) -> ::ssize_t;
2663 }
2664 
2665 #[link(name = "util")]
2666 extern "C" {
extattr_namespace_to_string( attrnamespace: ::c_int, string: *mut *mut ::c_char, ) -> ::c_int2667     pub fn extattr_namespace_to_string(
2668         attrnamespace: ::c_int,
2669         string: *mut *mut ::c_char,
2670     ) -> ::c_int;
extattr_string_to_namespace( string: *const ::c_char, attrnamespace: *mut ::c_int, ) -> ::c_int2671     pub fn extattr_string_to_namespace(
2672         string: *const ::c_char,
2673         attrnamespace: *mut ::c_int,
2674     ) -> ::c_int;
realhostname(host: *mut ::c_char, hsize: ::size_t, ip: *const ::in_addr) -> ::c_int2675     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_int2676     pub fn realhostname_sa(
2677         host: *mut ::c_char,
2678         hsize: ::size_t,
2679         addr: *mut ::sockaddr,
2680         addrlen: ::c_int,
2681     ) -> ::c_int;
2682 
kld_isloaded(name: *const ::c_char) -> ::c_int2683     pub fn kld_isloaded(name: *const ::c_char) -> ::c_int;
kld_load(name: *const ::c_char) -> ::c_int2684     pub fn kld_load(name: *const ::c_char) -> ::c_int;
2685 
kinfo_getvmmap(pid: ::pid_t, cntp: *mut ::c_int) -> *mut kinfo_vmentry2686     pub fn kinfo_getvmmap(pid: ::pid_t, cntp: *mut ::c_int) -> *mut kinfo_vmentry;
2687 
hexdump(ptr: *const ::c_void, length: ::c_int, hdr: *const ::c_char, flags: ::c_int)2688     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_int2689     pub fn humanize_number(
2690         buf: *mut ::c_char,
2691         len: ::size_t,
2692         number: i64,
2693         suffix: *const ::c_char,
2694         scale: ::c_int,
2695         flags: ::c_int,
2696     ) -> ::c_int;
2697 }
2698 
2699 #[link(name = "procstat")]
2700 extern "C" {
procstat_open_sysctl() -> *mut procstat2701     pub fn procstat_open_sysctl() -> *mut procstat;
procstat_getfiles( procstat: *mut procstat, kp: *mut kinfo_proc, mmapped: ::c_int, ) -> *mut filestat_list2702     pub fn procstat_getfiles(
2703         procstat: *mut procstat,
2704         kp: *mut kinfo_proc,
2705         mmapped: ::c_int,
2706     ) -> *mut filestat_list;
procstat_freefiles(procstat: *mut procstat, head: *mut filestat_list)2707     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_proc2708     pub fn procstat_getprocs(
2709         procstat: *mut procstat,
2710         what: ::c_int,
2711         arg: ::c_int,
2712         count: *mut ::c_uint,
2713     ) -> *mut kinfo_proc;
procstat_freeprocs(procstat: *mut procstat, p: *mut kinfo_proc)2714     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_vmentry2715     pub fn procstat_getvmmap(
2716         procstat: *mut procstat,
2717         kp: *mut kinfo_proc,
2718         count: *mut ::c_uint,
2719     ) -> *mut kinfo_vmentry;
procstat_freevmmap(procstat: *mut procstat, vmmap: *mut kinfo_vmentry)2720     pub fn procstat_freevmmap(procstat: *mut procstat, vmmap: *mut kinfo_vmentry);
procstat_close(procstat: *mut procstat)2721     pub fn procstat_close(procstat: *mut procstat);
2722 }
2723 
2724 #[link(name = "rt")]
2725 extern "C" {
timer_create(clock_id: clockid_t, evp: *mut sigevent, timerid: *mut timer_t) -> ::c_int2726     pub fn timer_create(clock_id: clockid_t, evp: *mut sigevent, timerid: *mut timer_t) -> ::c_int;
timer_delete(timerid: timer_t) -> ::c_int2727     pub fn timer_delete(timerid: timer_t) -> ::c_int;
timer_getoverrun(timerid: timer_t) -> ::c_int2728     pub fn timer_getoverrun(timerid: timer_t) -> ::c_int;
timer_gettime(timerid: timer_t, value: *mut itimerspec) -> ::c_int2729     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_int2730     pub fn timer_settime(
2731         timerid: timer_t,
2732         flags: ::c_int,
2733         value: *const itimerspec,
2734         ovalue: *mut itimerspec,
2735     ) -> ::c_int;
2736 }
2737 
2738 cfg_if! {
2739     if #[cfg(freebsd14)] {
2740         mod freebsd14;
2741         pub use self::freebsd14::*;
2742     } else if #[cfg(freebsd13)] {
2743         mod freebsd13;
2744         pub use self::freebsd13::*;
2745     } else if #[cfg(freebsd12)] {
2746         mod freebsd12;
2747         pub use self::freebsd12::*;
2748     } else if #[cfg(any(freebsd10, freebsd11))] {
2749         mod freebsd11;
2750         pub use self::freebsd11::*;
2751     } else {
2752         // Unknown freebsd version
2753     }
2754 }
2755 
2756 cfg_if! {
2757     if #[cfg(target_arch = "x86")] {
2758         mod x86;
2759         pub use self::x86::*;
2760     } else if #[cfg(target_arch = "x86_64")] {
2761         mod x86_64;
2762         pub use self::x86_64::*;
2763     } else if #[cfg(target_arch = "aarch64")] {
2764         mod aarch64;
2765         pub use self::aarch64::*;
2766     } else if #[cfg(target_arch = "arm")] {
2767         mod arm;
2768         pub use self::arm::*;
2769     } else if #[cfg(target_arch = "powerpc64")] {
2770         mod powerpc64;
2771         pub use self::powerpc64::*;
2772     } else if #[cfg(target_arch = "powerpc")] {
2773         mod powerpc;
2774         pub use self::powerpc::*;
2775     } else {
2776         // Unknown target_arch
2777     }
2778 }
2779