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 pub type caddr_t = *mut ::c_char;
41 
42 pub type fhandle_t = fhandle;
43 
44 pub type au_id_t = ::uid_t;
45 pub type au_asid_t = ::pid_t;
46 
47 // It's an alias over "struct __kvm_t". However, its fields aren't supposed to be used directly,
48 // making the type definition system dependent. Better not bind it exactly.
49 pub type kvm_t = ::c_void;
50 
51 #[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
52 #[repr(u32)]
53 pub enum devstat_support_flags {
54     DEVSTAT_ALL_SUPPORTED = 0x00,
55     DEVSTAT_NO_BLOCKSIZE = 0x01,
56     DEVSTAT_NO_ORDERED_TAGS = 0x02,
57     DEVSTAT_BS_UNAVAILABLE = 0x04,
58 }
59 impl ::Copy for devstat_support_flags {}
60 impl ::Clone for devstat_support_flags {
clone(&self) -> devstat_support_flags61     fn clone(&self) -> devstat_support_flags {
62         *self
63     }
64 }
65 
66 #[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
67 #[repr(u32)]
68 pub enum devstat_trans_flags {
69     DEVSTAT_NO_DATA = 0x00,
70     DEVSTAT_READ = 0x01,
71     DEVSTAT_WRITE = 0x02,
72     DEVSTAT_FREE = 0x03,
73 }
74 
75 impl ::Copy for devstat_trans_flags {}
76 impl ::Clone for devstat_trans_flags {
clone(&self) -> devstat_trans_flags77     fn clone(&self) -> devstat_trans_flags {
78         *self
79     }
80 }
81 
82 #[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
83 #[repr(u32)]
84 pub enum devstat_tag_type {
85     DEVSTAT_TAG_SIMPLE = 0x00,
86     DEVSTAT_TAG_HEAD = 0x01,
87     DEVSTAT_TAG_ORDERED = 0x02,
88     DEVSTAT_TAG_NONE = 0x03,
89 }
90 impl ::Copy for devstat_tag_type {}
91 impl ::Clone for devstat_tag_type {
clone(&self) -> devstat_tag_type92     fn clone(&self) -> devstat_tag_type {
93         *self
94     }
95 }
96 
97 #[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
98 #[repr(u32)]
99 pub enum devstat_match_flags {
100     DEVSTAT_MATCH_NONE = 0x00,
101     DEVSTAT_MATCH_TYPE = 0x01,
102     DEVSTAT_MATCH_IF = 0x02,
103     DEVSTAT_MATCH_PASS = 0x04,
104 }
105 impl ::Copy for devstat_match_flags {}
106 impl ::Clone for devstat_match_flags {
clone(&self) -> devstat_match_flags107     fn clone(&self) -> devstat_match_flags {
108         *self
109     }
110 }
111 
112 #[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
113 #[repr(u32)]
114 pub enum devstat_priority {
115     DEVSTAT_PRIORITY_MIN = 0x000,
116     DEVSTAT_PRIORITY_OTHER = 0x020,
117     DEVSTAT_PRIORITY_PASS = 0x030,
118     DEVSTAT_PRIORITY_FD = 0x040,
119     DEVSTAT_PRIORITY_WFD = 0x050,
120     DEVSTAT_PRIORITY_TAPE = 0x060,
121     DEVSTAT_PRIORITY_CD = 0x090,
122     DEVSTAT_PRIORITY_DISK = 0x110,
123     DEVSTAT_PRIORITY_ARRAY = 0x120,
124     DEVSTAT_PRIORITY_MAX = 0xfff,
125 }
126 impl ::Copy for devstat_priority {}
127 impl ::Clone for devstat_priority {
clone(&self) -> devstat_priority128     fn clone(&self) -> devstat_priority {
129         *self
130     }
131 }
132 
133 #[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
134 #[repr(u32)]
135 pub enum devstat_type_flags {
136     DEVSTAT_TYPE_DIRECT = 0x000,
137     DEVSTAT_TYPE_SEQUENTIAL = 0x001,
138     DEVSTAT_TYPE_PRINTER = 0x002,
139     DEVSTAT_TYPE_PROCESSOR = 0x003,
140     DEVSTAT_TYPE_WORM = 0x004,
141     DEVSTAT_TYPE_CDROM = 0x005,
142     DEVSTAT_TYPE_SCANNER = 0x006,
143     DEVSTAT_TYPE_OPTICAL = 0x007,
144     DEVSTAT_TYPE_CHANGER = 0x008,
145     DEVSTAT_TYPE_COMM = 0x009,
146     DEVSTAT_TYPE_ASC0 = 0x00a,
147     DEVSTAT_TYPE_ASC1 = 0x00b,
148     DEVSTAT_TYPE_STORARRAY = 0x00c,
149     DEVSTAT_TYPE_ENCLOSURE = 0x00d,
150     DEVSTAT_TYPE_FLOPPY = 0x00e,
151     DEVSTAT_TYPE_MASK = 0x00f,
152     DEVSTAT_TYPE_IF_SCSI = 0x010,
153     DEVSTAT_TYPE_IF_IDE = 0x020,
154     DEVSTAT_TYPE_IF_OTHER = 0x030,
155     DEVSTAT_TYPE_IF_MASK = 0x0f0,
156     DEVSTAT_TYPE_PASS = 0x100,
157 }
158 impl ::Copy for devstat_type_flags {}
159 impl ::Clone for devstat_type_flags {
clone(&self) -> devstat_type_flags160     fn clone(&self) -> devstat_type_flags {
161         *self
162     }
163 }
164 
165 #[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
166 #[repr(u32)]
167 pub enum devstat_metric {
168     DSM_NONE,
169     DSM_TOTAL_BYTES,
170     DSM_TOTAL_BYTES_READ,
171     DSM_TOTAL_BYTES_WRITE,
172     DSM_TOTAL_TRANSFERS,
173     DSM_TOTAL_TRANSFERS_READ,
174     DSM_TOTAL_TRANSFERS_WRITE,
175     DSM_TOTAL_TRANSFERS_OTHER,
176     DSM_TOTAL_BLOCKS,
177     DSM_TOTAL_BLOCKS_READ,
178     DSM_TOTAL_BLOCKS_WRITE,
179     DSM_KB_PER_TRANSFER,
180     DSM_KB_PER_TRANSFER_READ,
181     DSM_KB_PER_TRANSFER_WRITE,
182     DSM_TRANSFERS_PER_SECOND,
183     DSM_TRANSFERS_PER_SECOND_READ,
184     DSM_TRANSFERS_PER_SECOND_WRITE,
185     DSM_TRANSFERS_PER_SECOND_OTHER,
186     DSM_MB_PER_SECOND,
187     DSM_MB_PER_SECOND_READ,
188     DSM_MB_PER_SECOND_WRITE,
189     DSM_BLOCKS_PER_SECOND,
190     DSM_BLOCKS_PER_SECOND_READ,
191     DSM_BLOCKS_PER_SECOND_WRITE,
192     DSM_MS_PER_TRANSACTION,
193     DSM_MS_PER_TRANSACTION_READ,
194     DSM_MS_PER_TRANSACTION_WRITE,
195     DSM_SKIP,
196     DSM_TOTAL_BYTES_FREE,
197     DSM_TOTAL_TRANSFERS_FREE,
198     DSM_TOTAL_BLOCKS_FREE,
199     DSM_KB_PER_TRANSFER_FREE,
200     DSM_MB_PER_SECOND_FREE,
201     DSM_TRANSFERS_PER_SECOND_FREE,
202     DSM_BLOCKS_PER_SECOND_FREE,
203     DSM_MS_PER_TRANSACTION_OTHER,
204     DSM_MS_PER_TRANSACTION_FREE,
205     DSM_BUSY_PCT,
206     DSM_QUEUE_LENGTH,
207     DSM_TOTAL_DURATION,
208     DSM_TOTAL_DURATION_READ,
209     DSM_TOTAL_DURATION_WRITE,
210     DSM_TOTAL_DURATION_FREE,
211     DSM_TOTAL_DURATION_OTHER,
212     DSM_TOTAL_BUSY_TIME,
213     DSM_MAX,
214 }
215 impl ::Copy for devstat_metric {}
216 impl ::Clone for devstat_metric {
clone(&self) -> devstat_metric217     fn clone(&self) -> devstat_metric {
218         *self
219     }
220 }
221 
222 #[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
223 #[repr(u32)]
224 pub enum devstat_select_mode {
225     DS_SELECT_ADD,
226     DS_SELECT_ONLY,
227     DS_SELECT_REMOVE,
228     DS_SELECT_ADDONLY,
229 }
230 impl ::Copy for devstat_select_mode {}
231 impl ::Clone for devstat_select_mode {
clone(&self) -> devstat_select_mode232     fn clone(&self) -> devstat_select_mode {
233         *self
234     }
235 }
236 
237 s! {
238     pub struct aiocb {
239         pub aio_fildes: ::c_int,
240         pub aio_offset: ::off_t,
241         pub aio_buf: *mut ::c_void,
242         pub aio_nbytes: ::size_t,
243         __unused1: [::c_int; 2],
244         __unused2: *mut ::c_void,
245         pub aio_lio_opcode: ::c_int,
246         pub aio_reqprio: ::c_int,
247         // unused 3 through 5 are the __aiocb_private structure
248         __unused3: ::c_long,
249         __unused4: ::c_long,
250         __unused5: *mut ::c_void,
251         pub aio_sigevent: sigevent
252     }
253 
254     pub struct jail {
255         pub version: u32,
256         pub path: *mut ::c_char,
257         pub hostname: *mut ::c_char,
258         pub jailname: *mut ::c_char,
259         pub ip4s: ::c_uint,
260         pub ip6s: ::c_uint,
261         pub ip4: *mut ::in_addr,
262         pub ip6: *mut ::in6_addr,
263     }
264 
265     pub struct statvfs {
266         pub f_bavail: ::fsblkcnt_t,
267         pub f_bfree: ::fsblkcnt_t,
268         pub f_blocks: ::fsblkcnt_t,
269         pub f_favail: ::fsfilcnt_t,
270         pub f_ffree: ::fsfilcnt_t,
271         pub f_files: ::fsfilcnt_t,
272         pub f_bsize: ::c_ulong,
273         pub f_flag: ::c_ulong,
274         pub f_frsize: ::c_ulong,
275         pub f_fsid: ::c_ulong,
276         pub f_namemax: ::c_ulong,
277     }
278 
279     // internal structure has changed over time
280     pub struct _sem {
281         data: [u32; 4],
282     }
283     pub struct sembuf {
284         pub sem_num: ::c_ushort,
285         pub sem_op: ::c_short,
286         pub sem_flg: ::c_short,
287     }
288 
289     pub struct msqid_ds {
290         pub msg_perm: ::ipc_perm,
291         __unused1: *mut ::c_void,
292         __unused2: *mut ::c_void,
293         pub msg_cbytes: ::msglen_t,
294         pub msg_qnum: ::msgqnum_t,
295         pub msg_qbytes: ::msglen_t,
296         pub msg_lspid: ::pid_t,
297         pub msg_lrpid: ::pid_t,
298         pub msg_stime: ::time_t,
299         pub msg_rtime: ::time_t,
300         pub msg_ctime: ::time_t,
301     }
302 
303     pub struct stack_t {
304         pub ss_sp: *mut ::c_void,
305         pub ss_size: ::size_t,
306         pub ss_flags: ::c_int,
307     }
308 
309     pub struct mmsghdr {
310         pub msg_hdr: ::msghdr,
311         pub msg_len: ::ssize_t,
312     }
313 
314     pub struct sockcred {
315         pub sc_uid: ::uid_t,
316         pub sc_euid: ::uid_t,
317         pub sc_gid: ::gid_t,
318         pub sc_egid: ::gid_t,
319         pub sc_ngroups: ::c_int,
320         pub sc_groups: [::gid_t; 1],
321     }
322 
323     pub struct ptrace_vm_entry {
324         pub pve_entry: ::c_int,
325         pub pve_timestamp: ::c_int,
326         pub pve_start: ::c_ulong,
327         pub pve_end: ::c_ulong,
328         pub pve_offset: ::c_ulong,
329         pub pve_prot: ::c_uint,
330         pub pve_pathlen: ::c_uint,
331         pub pve_fileid: ::c_long,
332         pub pve_fsid: u32,
333         pub pve_path: *mut ::c_char,
334     }
335 
336     pub struct ptrace_lwpinfo {
337         pub pl_lwpid: lwpid_t,
338         pub pl_event: ::c_int,
339         pub pl_flags: ::c_int,
340         pub pl_sigmask: ::sigset_t,
341         pub pl_siglist: ::sigset_t,
342         pub pl_siginfo: ::siginfo_t,
343         pub pl_tdname: [::c_char; ::MAXCOMLEN as usize + 1],
344         pub pl_child_pid: ::pid_t,
345         pub pl_syscall_code: ::c_uint,
346         pub pl_syscall_narg: ::c_uint,
347     }
348 
349     pub struct ptrace_sc_ret {
350         pub sr_retval: [::register_t; 2],
351         pub sr_error: ::c_int,
352     }
353 
354     pub struct ptrace_coredump {
355         pub pc_fd: ::c_int,
356         pub pc_flags: u32,
357         pub pc_limit: ::off_t,
358     }
359 
360     pub struct cpuset_t {
361         #[cfg(target_pointer_width = "64")]
362         __bits: [::c_long; 4],
363         #[cfg(target_pointer_width = "32")]
364         __bits: [::c_long; 8],
365     }
366 
367     pub struct cap_rights_t {
368         cr_rights: [u64; 2],
369     }
370 
371     pub struct umutex {
372         m_owner: ::lwpid_t,
373         m_flags: u32,
374         m_ceilings: [u32; 2],
375         m_rb_link: ::uintptr_t,
376         #[cfg(target_pointer_width = "32")]
377         m_pad: u32,
378         m_spare: [u32; 2],
379 
380     }
381 
382     pub struct ucond {
383         c_has_waiters: u32,
384         c_flags: u32,
385         c_clockid: u32,
386         c_spare: [u32; 1],
387     }
388 
389     pub struct uuid {
390         pub time_low: u32,
391         pub time_mid: u16,
392         pub time_hi_and_version: u16,
393         pub clock_seq_hi_and_reserved: u8,
394         pub clock_seq_low: u8,
395         pub node: [u8; _UUID_NODE_LEN],
396     }
397 
398     pub struct __c_anonymous_pthread_spinlock {
399         s_clock: umutex,
400     }
401 
402     pub struct __c_anonymous_pthread_barrierattr {
403         pshared: ::c_int,
404     }
405 
406     pub struct __c_anonymous_pthread_barrier {
407         b_lock: umutex,
408         b_cv: ucond,
409         b_cycle: i64,
410         b_count: ::c_int,
411         b_waiters: ::c_int,
412         b_refcount: ::c_int,
413         b_destroying: ::c_int,
414     }
415 
416     pub struct kinfo_vmentry {
417         pub kve_structsize: ::c_int,
418         pub kve_type: ::c_int,
419         pub kve_start: u64,
420         pub kve_end: u64,
421         pub kve_offset: u64,
422         pub kve_vn_fileid: u64,
423         #[cfg(not(freebsd11))]
424         pub kve_vn_fsid_freebsd11: u32,
425         #[cfg(freebsd11)]
426         pub kve_vn_fsid: u32,
427         pub kve_flags: ::c_int,
428         pub kve_resident: ::c_int,
429         pub kve_private_resident: ::c_int,
430         pub kve_protection: ::c_int,
431         pub kve_ref_count: ::c_int,
432         pub kve_shadow_count: ::c_int,
433         pub kve_vn_type: ::c_int,
434         pub kve_vn_size: u64,
435         #[cfg(not(freebsd11))]
436         pub kve_vn_rdev_freebsd11: u32,
437         #[cfg(freebsd11)]
438         pub kve_vn_rdev: u32,
439         pub kve_vn_mode: u16,
440         pub kve_status: u16,
441         #[cfg(not(freebsd11))]
442         pub kve_vn_fsid: u64,
443         #[cfg(not(freebsd11))]
444         pub kve_vn_rdev: u64,
445         #[cfg(not(freebsd11))]
446         _kve_is_spare: [::c_int; 8],
447         #[cfg(freebsd11)]
448         _kve_is_spare: [::c_int; 12],
449         pub kve_path: [[::c_char; 32]; 32],
450     }
451 
452     pub struct __c_anonymous_filestat {
453         pub stqe_next: *mut filestat,
454     }
455 
456     pub struct filestat {
457         pub fs_type: ::c_int,
458         pub fs_flags: ::c_int,
459         pub fs_fflags: ::c_int,
460         pub fs_uflags: ::c_int,
461         pub fs_fd: ::c_int,
462         pub fs_ref_count: ::c_int,
463         pub fs_offset: ::off_t,
464         pub fs_typedep: *mut ::c_void,
465         pub fs_path: *mut ::c_char,
466         pub next: __c_anonymous_filestat,
467         pub fs_cap_rights: cap_rights_t,
468     }
469 
470     pub struct filestat_list {
471         pub stqh_first: *mut filestat,
472         pub stqh_last: *mut *mut filestat,
473     }
474 
475     pub struct procstat {
476         pub tpe: ::c_int,
477         pub kd: ::uintptr_t,
478         pub vmentries: *mut ::c_void,
479         pub files: *mut ::c_void,
480         pub argv: *mut ::c_void,
481         pub envv: *mut ::c_void,
482         pub core: ::uintptr_t,
483     }
484 
485     pub struct itimerspec {
486         pub it_interval: ::timespec,
487         pub it_value: ::timespec,
488     }
489 
490     pub struct __c_anonymous__timer {
491         _priv: [::c_int; 3],
492     }
493 
494     /// Used to hold a copy of the command line, if it had a sane length.
495     pub struct pargs {
496         /// Reference count.
497         pub ar_ref: u_int,
498         /// Length.
499         pub ar_length: u_int,
500         /// Arguments.
501         pub ar_args: [::c_uchar; 1],
502     }
503 
504     pub struct priority {
505         /// Scheduling class.
506         pub pri_class: u_char,
507         /// Normal priority level.
508         pub pri_level: u_char,
509         /// Priority before propagation.
510         pub pri_native: u_char,
511         /// User priority based on p_cpu and p_nice.
512         pub pri_user: u_char,
513     }
514 
515     pub struct kvm_swap {
516         pub ksw_devname: [::c_char; 32],
517         pub ksw_used: u_int,
518         pub ksw_total: u_int,
519         pub ksw_flags: ::c_int,
520         pub ksw_reserved1: u_int,
521         pub ksw_reserved2: u_int,
522     }
523 
524     pub struct nlist {
525         /// symbol name (in memory)
526         pub n_name: *const ::c_char,
527         /// type defines
528         pub n_type: ::c_uchar,
529         /// "type" and binding information
530         pub n_other: ::c_char,
531         /// used by stab entries
532         pub n_desc: ::c_short,
533         pub n_value: ::c_ulong,
534     }
535 
536     pub struct kvm_nlist {
537         pub n_name: *const ::c_char,
538         pub n_type: ::c_uchar,
539         pub n_value: ::kvaddr_t,
540     }
541 
542     pub struct __c_anonymous_sem {
543         _priv: ::uintptr_t,
544     }
545 
546     pub struct semid_ds {
547         pub sem_perm: ::ipc_perm,
548         pub __sem_base: *mut __c_anonymous_sem,
549         pub sem_nsems: ::c_ushort,
550         pub sem_otime: ::time_t,
551         pub sem_ctime: ::time_t,
552     }
553 
554     pub struct vmtotal {
555         pub t_vm: u64,
556         pub t_avm: u64,
557         pub t_rm: u64,
558         pub t_arm: u64,
559         pub t_vmshr: u64,
560         pub t_avmshr: u64,
561         pub t_rmshr: u64,
562         pub t_armshr: u64,
563         pub t_free: u64,
564         pub t_rq: i16,
565         pub t_dw: i16,
566         pub t_pw: i16,
567         pub t_sl: i16,
568         pub t_sw: i16,
569         pub t_pad: [u16; 3],
570     }
571 
572     pub struct sockstat {
573         pub inp_ppcb: u64,
574         pub so_addr: u64,
575         pub so_pcb: u64,
576         pub unp_conn: u64,
577         pub dom_family: ::c_int,
578         pub proto: ::c_int,
579         pub so_rcv_sb_state: ::c_int,
580         pub so_snd_sb_state: ::c_int,
581         /// Socket address.
582         pub sa_local: ::sockaddr_storage,
583         /// Peer address.
584         pub sa_peer: ::sockaddr_storage,
585         pub type_: ::c_int,
586         pub dname: [::c_char; 32],
587         #[cfg(any(freebsd12, freebsd13, freebsd14))]
588         pub sendq: ::c_uint,
589         #[cfg(any(freebsd12, freebsd13, freebsd14))]
590         pub recvq: ::c_uint,
591     }
592 
593     pub struct shmstat {
594         pub size: u64,
595         pub mode: u16,
596     }
597 
598     pub struct spacectl_range {
599         pub r_offset: ::off_t,
600         pub r_len: ::off_t
601     }
602 
603     pub struct rusage_ext {
604         pub rux_runtime: u64,
605         pub rux_uticks: u64,
606         pub rux_sticks: u64,
607         pub rux_iticks: u64,
608         pub rux_uu: u64,
609         pub rux_su: u64,
610         pub rux_tu: u64,
611     }
612 
613     pub struct if_clonereq {
614         pub ifcr_total: ::c_int,
615         pub ifcr_count: ::c_int,
616         pub ifcr_buffer: *mut ::c_char,
617     }
618 
619     pub struct if_msghdr {
620         /// to skip over non-understood messages
621         pub ifm_msglen: ::c_ushort,
622         /// future binary compatibility
623         pub ifm_version: ::c_uchar,
624         /// message type
625         pub ifm_type: ::c_uchar,
626         /// like rtm_addrs
627         pub ifm_addrs: ::c_int,
628         /// value of if_flags
629         pub ifm_flags: ::c_int,
630         /// index for associated ifp
631         pub ifm_index: ::c_ushort,
632         pub _ifm_spare1: ::c_ushort,
633         /// statistics and other data about if
634         pub ifm_data: if_data,
635     }
636 
637     pub struct if_msghdrl {
638         /// to skip over non-understood messages
639         pub ifm_msglen: ::c_ushort,
640         /// future binary compatibility
641         pub ifm_version: ::c_uchar,
642         /// message type
643         pub ifm_type: ::c_uchar,
644         /// like rtm_addrs
645         pub ifm_addrs: ::c_int,
646         /// value of if_flags
647         pub ifm_flags: ::c_int,
648         /// index for associated ifp
649         pub ifm_index: ::c_ushort,
650         /// spare space to grow if_index, see if_var.h
651         pub _ifm_spare1: ::c_ushort,
652         /// length of if_msghdrl incl. if_data
653         pub ifm_len: ::c_ushort,
654         /// offset of if_data from beginning
655         pub ifm_data_off: ::c_ushort,
656         pub _ifm_spare2: ::c_int,
657         /// statistics and other data about if
658         pub ifm_data: if_data,
659     }
660 
661     pub struct ifa_msghdr {
662         /// to skip over non-understood messages
663         pub ifam_msglen: ::c_ushort,
664         /// future binary compatibility
665         pub ifam_version: ::c_uchar,
666         /// message type
667         pub ifam_type: ::c_uchar,
668         /// like rtm_addrs
669         pub ifam_addrs: ::c_int,
670         /// value of ifa_flags
671         pub ifam_flags: ::c_int,
672         /// index for associated ifp
673         pub ifam_index: ::c_ushort,
674         pub _ifam_spare1: ::c_ushort,
675         /// value of ifa_ifp->if_metric
676         pub ifam_metric: ::c_int,
677     }
678 
679     pub struct ifa_msghdrl {
680         /// to skip over non-understood messages
681         pub ifam_msglen: ::c_ushort,
682         /// future binary compatibility
683         pub ifam_version: ::c_uchar,
684         /// message type
685         pub ifam_type: ::c_uchar,
686         /// like rtm_addrs
687         pub ifam_addrs: ::c_int,
688         /// value of ifa_flags
689         pub ifam_flags: ::c_int,
690         /// index for associated ifp
691         pub ifam_index: ::c_ushort,
692         /// spare space to grow if_index, see if_var.h
693         pub _ifam_spare1: ::c_ushort,
694         /// length of ifa_msghdrl incl. if_data
695         pub ifam_len: ::c_ushort,
696         /// offset of if_data from beginning
697         pub ifam_data_off: ::c_ushort,
698         /// value of ifa_ifp->if_metric
699         pub ifam_metric: ::c_int,
700         /// statistics and other data about if or address
701         pub ifam_data: if_data,
702     }
703 
704     pub struct ifma_msghdr {
705         /// to skip over non-understood messages
706         pub ifmam_msglen: ::c_ushort,
707         /// future binary compatibility
708         pub ifmam_version: ::c_uchar,
709         /// message type
710         pub ifmam_type: ::c_uchar,
711         /// like rtm_addrs
712         pub ifmam_addrs: ::c_int,
713         /// value of ifa_flags
714         pub ifmam_flags: ::c_int,
715         /// index for associated ifp
716         pub ifmam_index: ::c_ushort,
717         pub _ifmam_spare1: ::c_ushort,
718     }
719 
720     pub struct if_announcemsghdr {
721         /// to skip over non-understood messages
722         pub ifan_msglen: ::c_ushort,
723         /// future binary compatibility
724         pub ifan_version: ::c_uchar,
725         /// message type
726         pub ifan_type: ::c_uchar,
727         /// index for associated ifp
728         pub ifan_index: ::c_ushort,
729         /// if name, e.g. "en0"
730         pub ifan_name: [::c_char; ::IFNAMSIZ as usize],
731         /// what type of announcement
732         pub ifan_what: ::c_ushort,
733     }
734 
735     pub struct ifreq_buffer {
736         pub length: ::size_t,
737         pub buffer: *mut ::c_void,
738     }
739 
740     pub struct ifaliasreq {
741         /// if name, e.g. "en0"
742         pub ifra_name: [::c_char; ::IFNAMSIZ as usize],
743         pub ifra_addr: ::sockaddr,
744         pub ifra_broadaddr: ::sockaddr,
745         pub ifra_mask: ::sockaddr,
746         pub ifra_vhid: ::c_int,
747     }
748 
749     /// 9.x compat
750     pub struct oifaliasreq {
751         /// if name, e.g. "en0"
752         pub ifra_name: [::c_char; ::IFNAMSIZ as usize],
753         pub ifra_addr: ::sockaddr,
754         pub ifra_broadaddr: ::sockaddr,
755         pub ifra_mask: ::sockaddr,
756     }
757 
758     pub struct ifmediareq {
759         /// if name, e.g. "en0"
760         pub ifm_name: [::c_char; ::IFNAMSIZ as usize],
761         /// current media options
762         pub ifm_current: ::c_int,
763         /// don't care mask
764         pub ifm_mask: ::c_int,
765         /// media status
766         pub ifm_status: ::c_int,
767         /// active options
768         pub ifm_active: ::c_int,
769         /// # entries in ifm_ulist array
770         pub ifm_count: ::c_int,
771         /// media words
772         pub ifm_ulist: *mut ::c_int,
773     }
774 
775     pub struct ifdrv {
776         /// if name, e.g. "en0"
777         pub ifd_name: [::c_char; ::IFNAMSIZ as usize],
778         pub ifd_cmd: ::c_ulong,
779         pub ifd_len: ::size_t,
780         pub ifd_data: *mut ::c_void,
781     }
782 
783     pub struct ifi2creq {
784         /// i2c address (0xA0, 0xA2)
785         pub dev_addr: u8,
786         /// read offset
787         pub offset: u8,
788         /// read length
789         pub len: u8,
790         pub spare0: u8,
791         pub spare1: u32,
792         /// read buffer
793         pub data: [u8; 8],
794     }
795 
796     pub struct ifrsshash {
797         /// if name, e.g. "en0"
798         pub ifrh_name: [::c_char; ::IFNAMSIZ as usize],
799         /// RSS_FUNC_
800         pub ifrh_func: u8,
801         pub ifrh_spare0: u8,
802         pub ifrh_spare1: u16,
803         /// RSS_TYPE_
804         pub ifrh_types: u32,
805     }
806 
807     pub struct ifmibdata {
808         /// name of interface
809         pub ifmd_name: [::c_char; ::IFNAMSIZ as usize],
810         /// number of promiscuous listeners
811         pub ifmd_pcount: ::c_int,
812         /// interface flags
813         pub ifmd_flags: ::c_int,
814         /// instantaneous length of send queue
815         pub ifmd_snd_len: ::c_int,
816         /// maximum length of send queue
817         pub ifmd_snd_maxlen: ::c_int,
818         /// number of drops in send queue
819         pub ifmd_snd_drops: ::c_int,
820         /// for future expansion
821         pub ifmd_filler: [::c_int; 4],
822         /// generic information and statistics
823         pub ifmd_data: if_data,
824     }
825 
826     pub struct ifmib_iso_8802_3 {
827         pub dot3StatsAlignmentErrors: u32,
828         pub dot3StatsFCSErrors: u32,
829         pub dot3StatsSingleCollisionFrames: u32,
830         pub dot3StatsMultipleCollisionFrames: u32,
831         pub dot3StatsSQETestErrors: u32,
832         pub dot3StatsDeferredTransmissions: u32,
833         pub dot3StatsLateCollisions: u32,
834         pub dot3StatsExcessiveCollisions: u32,
835         pub dot3StatsInternalMacTransmitErrors: u32,
836         pub dot3StatsCarrierSenseErrors: u32,
837         pub dot3StatsFrameTooLongs: u32,
838         pub dot3StatsInternalMacReceiveErrors: u32,
839         pub dot3StatsEtherChipSet: u32,
840         pub dot3StatsMissedFrames: u32,
841         pub dot3StatsCollFrequencies: [u32; 16],
842         pub dot3Compliance: u32,
843     }
844 
845     pub struct __c_anonymous_ph {
846         pub ph1: u64,
847         pub ph2: u64,
848     }
849 
850     pub struct fid {
851         pub fid_len: ::c_ushort,
852         pub fid_data0: ::c_ushort,
853         pub fid_data: [::c_char; ::MAXFIDSZ as usize],
854     }
855 
856     pub struct fhandle {
857         pub fh_fsid: ::fsid_t,
858         pub fh_fid: fid,
859     }
860 
861     pub struct bintime {
862         pub sec: ::time_t,
863         pub frac: u64,
864     }
865 
866     pub struct clockinfo {
867         /// clock frequency
868         pub hz: ::c_int,
869         /// micro-seconds per hz tick
870         pub tick: ::c_int,
871         pub spare: ::c_int,
872         /// statistics clock frequency
873         pub stathz: ::c_int,
874         /// profiling clock frequency
875         pub profhz: ::c_int,
876     }
877 
878     pub struct __c_anonymous_stailq_entry_devstat {
879         pub stqe_next: *mut devstat,
880     }
881 
882     pub struct devstat {
883         /// Update sequence
884         pub sequence0: ::u_int,
885         /// Allocated entry
886         pub allocated: ::c_int,
887         /// started ops
888         pub start_count: ::u_int,
889         /// completed ops
890         pub end_count: ::u_int,
891         /// busy time unaccounted for since this time
892         pub busy_from: bintime,
893         pub dev_links: __c_anonymous_stailq_entry_devstat,
894         /// Devstat device number.
895         pub device_number: u32,
896         pub device_name: [::c_char; DEVSTAT_NAME_LEN as usize],
897         pub unit_number: ::c_int,
898         pub bytes: [u64; DEVSTAT_N_TRANS_FLAGS as usize],
899         pub operations: [u64; DEVSTAT_N_TRANS_FLAGS as usize],
900         pub duration: [bintime; DEVSTAT_N_TRANS_FLAGS as usize],
901         pub busy_time: bintime,
902         /// Time the device was created.
903         pub creation_time: bintime,
904         /// Block size, bytes
905         pub block_size: u32,
906         /// The number of simple, ordered, and head of queue tags sent.
907         pub tag_types: [u64; 3],
908         /// Which statistics are supported by a given device.
909         pub flags: devstat_support_flags,
910         /// Device type
911         pub device_type: devstat_type_flags,
912         /// Controls list pos.
913         pub priority: devstat_priority,
914         /// Identification for GEOM nodes
915         pub id: *const ::c_void,
916         /// Update sequence
917         pub sequence1: ::u_int,
918     }
919 
920     pub struct devstat_match {
921         pub match_fields: devstat_match_flags,
922         pub device_type: devstat_type_flags,
923         pub num_match_categories: ::c_int,
924     }
925 
926     pub struct devstat_match_table {
927         pub match_str: *const ::c_char,
928         pub type_: devstat_type_flags,
929         pub match_field: devstat_match_flags,
930     }
931 
932     pub struct device_selection {
933         pub device_number: u32,
934         pub device_name: [::c_char; DEVSTAT_NAME_LEN as usize],
935         pub unit_number: ::c_int,
936         pub selected: ::c_int,
937         pub bytes: u64,
938         pub position: ::c_int,
939     }
940 
941     pub struct devinfo {
942         pub devices: *mut devstat,
943         pub mem_ptr: *mut u8,
944         pub generation: ::c_long,
945         pub numdevs: ::c_int,
946     }
947 
948     pub struct sockcred2 {
949         pub sc_version: ::c_int,
950         pub sc_pid: ::pid_t,
951         pub sc_uid: ::uid_t,
952         pub sc_euid: ::uid_t,
953         pub sc_gid: ::gid_t,
954         pub sc_egid: ::gid_t,
955         pub sc_ngroups: ::c_int,
956         pub sc_groups: [::gid_t; 1],
957     }
958 
959     pub struct ifconf {
960         pub ifc_len: ::c_int,
961         #[cfg(libc_union)]
962         pub ifc_ifcu: __c_anonymous_ifc_ifcu,
963     }
964 
965     pub struct au_mask_t {
966         pub am_success: ::c_uint,
967         pub am_failure: ::c_uint,
968     }
969 
970     pub struct au_tid_t {
971         pub port: u32,
972         pub machine: u32,
973     }
974 
975     pub struct auditinfo_t {
976         pub ai_auid: ::au_id_t,
977         pub ai_mask: ::au_mask_t,
978         pub ai_termid: au_tid_t,
979         pub ai_asid: ::au_asid_t,
980     }
981 
982     pub struct tcp_fastopen {
983         pub enable: ::c_int,
984         pub psk: [u8; ::TCP_FASTOPEN_PSK_LEN as usize],
985     }
986 
987     pub struct tcp_function_set {
988         pub function_set_name: [::c_char; ::TCP_FUNCTION_NAME_LEN_MAX as usize],
989         pub pcbcnt: u32,
990     }
991 }
992 
993 s_no_extra_traits! {
994     pub struct utmpx {
995         pub ut_type: ::c_short,
996         pub ut_tv: ::timeval,
997         pub ut_id: [::c_char; 8],
998         pub ut_pid: ::pid_t,
999         pub ut_user: [::c_char; 32],
1000         pub ut_line: [::c_char; 16],
1001         pub ut_host: [::c_char; 128],
1002         pub __ut_spare: [::c_char; 64],
1003     }
1004 
1005     #[cfg(libc_union)]
1006     pub union __c_anonymous_cr_pid {
1007         __cr_unused: *mut ::c_void,
1008         pub cr_pid: ::pid_t,
1009     }
1010 
1011     pub struct xucred {
1012         pub cr_version: ::c_uint,
1013         pub cr_uid: ::uid_t,
1014         pub cr_ngroups: ::c_short,
1015         pub cr_groups: [::gid_t; 16],
1016         #[cfg(libc_union)]
1017         pub cr_pid__c_anonymous_union: __c_anonymous_cr_pid,
1018         #[cfg(not(libc_union))]
1019         __cr_unused1: *mut ::c_void,
1020     }
1021 
1022     pub struct sockaddr_dl {
1023         pub sdl_len: ::c_uchar,
1024         pub sdl_family: ::c_uchar,
1025         pub sdl_index: ::c_ushort,
1026         pub sdl_type: ::c_uchar,
1027         pub sdl_nlen: ::c_uchar,
1028         pub sdl_alen: ::c_uchar,
1029         pub sdl_slen: ::c_uchar,
1030         pub sdl_data: [::c_char; 46],
1031     }
1032 
1033     pub struct mq_attr {
1034         pub mq_flags: ::c_long,
1035         pub mq_maxmsg: ::c_long,
1036         pub mq_msgsize: ::c_long,
1037         pub mq_curmsgs: ::c_long,
1038         __reserved: [::c_long; 4]
1039     }
1040 
1041     pub struct sigevent {
1042         pub sigev_notify: ::c_int,
1043         pub sigev_signo: ::c_int,
1044         pub sigev_value: ::sigval,
1045         //The rest of the structure is actually a union.  We expose only
1046         //sigev_notify_thread_id because it's the most useful union member.
1047         pub sigev_notify_thread_id: ::lwpid_t,
1048         #[cfg(target_pointer_width = "64")]
1049         __unused1: ::c_int,
1050         __unused2: [::c_long; 7]
1051     }
1052 
1053     pub struct ptsstat {
1054         #[cfg(any(freebsd12, freebsd13, freebsd14))]
1055         pub dev: u64,
1056         #[cfg(not(any(freebsd12, freebsd13, freebsd14)))]
1057         pub dev: u32,
1058         pub devname: [::c_char; SPECNAMELEN as usize + 1],
1059     }
1060 
1061     #[cfg(libc_union)]
1062     pub union __c_anonymous_elf32_auxv_union {
1063         pub a_val: ::c_int,
1064     }
1065 
1066     pub struct Elf32_Auxinfo {
1067         pub a_type: ::c_int,
1068         #[cfg(libc_union)]
1069         pub a_un: __c_anonymous_elf32_auxv_union,
1070     }
1071 
1072     #[cfg(libc_union)]
1073     pub union __c_anonymous_ifi_epoch {
1074         pub tt: ::time_t,
1075         pub ph: u64,
1076     }
1077 
1078     #[cfg(libc_union)]
1079     pub union __c_anonymous_ifi_lastchange {
1080         pub tv: ::timeval,
1081         pub ph: __c_anonymous_ph,
1082     }
1083 
1084     pub struct if_data {
1085         /// ethernet, tokenring, etc
1086         pub ifi_type: u8,
1087         /// e.g., AUI, Thinnet, 10base-T, etc
1088         pub ifi_physical: u8,
1089         /// media address length
1090         pub ifi_addrlen: u8,
1091         /// media header length
1092         pub ifi_hdrlen: u8,
1093         /// current link state
1094         pub ifi_link_state: u8,
1095         /// carp vhid
1096         pub ifi_vhid: u8,
1097         /// length of this data struct
1098         pub ifi_datalen: u16,
1099         /// maximum transmission unit
1100         pub ifi_mtu: u32,
1101         /// routing metric (external only)
1102         pub ifi_metric: u32,
1103         /// linespeed
1104         pub ifi_baudrate: u64,
1105         /// packets received on interface
1106         pub ifi_ipackets: u64,
1107         /// input errors on interface
1108         pub ifi_ierrors: u64,
1109         /// packets sent on interface
1110         pub ifi_opackets: u64,
1111         /// output errors on interface
1112         pub ifi_oerrors: u64,
1113         /// collisions on csma interfaces
1114         pub ifi_collisions: u64,
1115         /// total number of octets received
1116         pub ifi_ibytes: u64,
1117         /// total number of octets sent
1118         pub ifi_obytes: u64,
1119         /// packets received via multicast
1120         pub ifi_imcasts: u64,
1121         /// packets sent via multicast
1122         pub ifi_omcasts: u64,
1123         /// dropped on input
1124         pub ifi_iqdrops: u64,
1125         /// dropped on output
1126         pub ifi_oqdrops: u64,
1127         /// destined for unsupported protocol
1128         pub ifi_noproto: u64,
1129         /// HW offload capabilities, see IFCAP
1130         pub ifi_hwassist: u64,
1131         /// uptime at attach or stat reset
1132         #[cfg(libc_union)]
1133         pub __ifi_epoch: __c_anonymous_ifi_epoch,
1134         /// uptime at attach or stat reset
1135         #[cfg(not(libc_union))]
1136         pub __ifi_epoch: u64,
1137         /// time of last administrative change
1138         #[cfg(libc_union)]
1139         pub __ifi_lastchange: __c_anonymous_ifi_lastchange,
1140         /// time of last administrative change
1141         #[cfg(not(libc_union))]
1142         pub __ifi_lastchange: ::timeval,
1143     }
1144 
1145     #[cfg(libc_union)]
1146     pub union __c_anonymous_ifr_ifru {
1147         pub ifru_addr: ::sockaddr,
1148         pub ifru_dstaddr: ::sockaddr,
1149         pub ifru_broadaddr: ::sockaddr,
1150         pub ifru_buffer: ifreq_buffer,
1151         pub ifru_flags: [::c_short; 2],
1152         pub ifru_index: ::c_short,
1153         pub ifru_jid: ::c_int,
1154         pub ifru_metric: ::c_int,
1155         pub ifru_mtu: ::c_int,
1156         pub ifru_phys: ::c_int,
1157         pub ifru_media: ::c_int,
1158         pub ifru_data: ::caddr_t,
1159         pub ifru_cap: [::c_int; 2],
1160         pub ifru_fib: ::c_uint,
1161         pub ifru_vlan_pcp: ::c_uchar,
1162     }
1163 
1164     pub struct ifreq {
1165         /// if name, e.g. "en0"
1166         pub ifr_name: [::c_char; ::IFNAMSIZ],
1167         #[cfg(libc_union)]
1168         pub ifr_ifru: __c_anonymous_ifr_ifru,
1169         #[cfg(not(libc_union))]
1170         pub ifr_ifru: ::sockaddr,
1171     }
1172 
1173     #[cfg(libc_union)]
1174     pub union __c_anonymous_ifc_ifcu {
1175         pub ifcu_buf: ::caddr_t,
1176         pub ifcu_req: *mut ifreq,
1177     }
1178 
1179     pub struct ifstat {
1180         /// if name, e.g. "en0"
1181         pub ifs_name: [::c_char; ::IFNAMSIZ as usize],
1182         pub ascii: [::c_char; ::IFSTATMAX as usize + 1],
1183     }
1184 
1185     pub struct ifrsskey {
1186         /// if name, e.g. "en0"
1187         pub ifrk_name: [::c_char; ::IFNAMSIZ as usize],
1188         /// RSS_FUNC_
1189         pub ifrk_func: u8,
1190         pub ifrk_spare0: u8,
1191         pub ifrk_keylen: u16,
1192         pub ifrk_key: [u8; ::RSS_KEYLEN as usize],
1193     }
1194 
1195     pub struct ifdownreason {
1196         pub ifdr_name: [::c_char; ::IFNAMSIZ as usize],
1197         pub ifdr_reason: u32,
1198         pub ifdr_vendor: u32,
1199         pub ifdr_msg: [::c_char; ::IFDR_MSG_SIZE as usize],
1200     }
1201 }
1202 
1203 cfg_if! {
1204     if #[cfg(feature = "extra_traits")] {
1205         impl PartialEq for utmpx {
1206             fn eq(&self, other: &utmpx) -> bool {
1207                 self.ut_type == other.ut_type
1208                     && self.ut_tv == other.ut_tv
1209                     && self.ut_id == other.ut_id
1210                     && self.ut_pid == other.ut_pid
1211                     && self.ut_user == other.ut_user
1212                     && self.ut_line == other.ut_line
1213                     && self
1214                     .ut_host
1215                     .iter()
1216                     .zip(other.ut_host.iter())
1217                     .all(|(a,b)| a == b)
1218                     && self
1219                     .__ut_spare
1220                     .iter()
1221                     .zip(other.__ut_spare.iter())
1222                     .all(|(a,b)| a == b)
1223             }
1224         }
1225         impl Eq for utmpx {}
1226         impl ::fmt::Debug for utmpx {
1227             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1228                 f.debug_struct("utmpx")
1229                     .field("ut_type", &self.ut_type)
1230                     .field("ut_tv", &self.ut_tv)
1231                     .field("ut_id", &self.ut_id)
1232                     .field("ut_pid", &self.ut_pid)
1233                     .field("ut_user", &self.ut_user)
1234                     .field("ut_line", &self.ut_line)
1235                     // FIXME: .field("ut_host", &self.ut_host)
1236                     // FIXME: .field("__ut_spare", &self.__ut_spare)
1237                     .finish()
1238             }
1239         }
1240         impl ::hash::Hash for utmpx {
1241             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1242                 self.ut_type.hash(state);
1243                 self.ut_tv.hash(state);
1244                 self.ut_id.hash(state);
1245                 self.ut_pid.hash(state);
1246                 self.ut_user.hash(state);
1247                 self.ut_line.hash(state);
1248                 self.ut_host.hash(state);
1249                 self.__ut_spare.hash(state);
1250             }
1251         }
1252 
1253         #[cfg(libc_union)]
1254         impl PartialEq for __c_anonymous_cr_pid {
1255             fn eq(&self, other: &__c_anonymous_cr_pid) -> bool {
1256                 unsafe { self.cr_pid == other.cr_pid}
1257             }
1258         }
1259         #[cfg(libc_union)]
1260         impl Eq for __c_anonymous_cr_pid {}
1261         #[cfg(libc_union)]
1262         impl ::fmt::Debug for __c_anonymous_cr_pid {
1263             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1264                 f.debug_struct("cr_pid")
1265                     .field("cr_pid", unsafe { &self.cr_pid })
1266                     .finish()
1267             }
1268         }
1269         #[cfg(libc_union)]
1270         impl ::hash::Hash for __c_anonymous_cr_pid {
1271             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1272                 unsafe { self.cr_pid.hash(state) };
1273             }
1274         }
1275 
1276         impl PartialEq for xucred {
1277             fn eq(&self, other: &xucred) -> bool {
1278                 #[cfg(libc_union)]
1279                 let equal_cr_pid = self.cr_pid__c_anonymous_union
1280                     == other.cr_pid__c_anonymous_union;
1281                 #[cfg(not(libc_union))]
1282                 let equal_cr_pid = self.__cr_unused1 == other.__cr_unused1;
1283 
1284                 self.cr_version == other.cr_version
1285                     && self.cr_uid == other.cr_uid
1286                     && self.cr_ngroups == other.cr_ngroups
1287                     && self.cr_groups == other.cr_groups
1288                     && equal_cr_pid
1289             }
1290         }
1291         impl Eq for xucred {}
1292         impl ::fmt::Debug for xucred {
1293             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1294                 let mut struct_formatter = f.debug_struct("xucred");
1295                 struct_formatter.field("cr_version", &self.cr_version);
1296                 struct_formatter.field("cr_uid", &self.cr_uid);
1297                 struct_formatter.field("cr_ngroups", &self.cr_ngroups);
1298                 struct_formatter.field("cr_groups", &self.cr_groups);
1299                 #[cfg(libc_union)]
1300                 struct_formatter.field(
1301                     "cr_pid__c_anonymous_union",
1302                     &self.cr_pid__c_anonymous_union
1303                 );
1304                 struct_formatter.finish()
1305             }
1306         }
1307         impl ::hash::Hash for xucred {
1308             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1309                 self.cr_version.hash(state);
1310                 self.cr_uid.hash(state);
1311                 self.cr_ngroups.hash(state);
1312                 self.cr_groups.hash(state);
1313                 #[cfg(libc_union)]
1314                 self.cr_pid__c_anonymous_union.hash(state);
1315                 #[cfg(not(libc_union))]
1316                 self.__cr_unused1.hash(state);
1317             }
1318         }
1319 
1320         impl PartialEq for sockaddr_dl {
1321             fn eq(&self, other: &sockaddr_dl) -> bool {
1322                 self.sdl_len == other.sdl_len
1323                     && self.sdl_family == other.sdl_family
1324                     && self.sdl_index == other.sdl_index
1325                     && self.sdl_type == other.sdl_type
1326                     && self.sdl_nlen == other.sdl_nlen
1327                     && self.sdl_alen == other.sdl_alen
1328                     && self.sdl_slen == other.sdl_slen
1329                     && self
1330                     .sdl_data
1331                     .iter()
1332                     .zip(other.sdl_data.iter())
1333                     .all(|(a,b)| a == b)
1334             }
1335         }
1336         impl Eq for sockaddr_dl {}
1337         impl ::fmt::Debug for sockaddr_dl {
1338             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1339                 f.debug_struct("sockaddr_dl")
1340                     .field("sdl_len", &self.sdl_len)
1341                     .field("sdl_family", &self.sdl_family)
1342                     .field("sdl_index", &self.sdl_index)
1343                     .field("sdl_type", &self.sdl_type)
1344                     .field("sdl_nlen", &self.sdl_nlen)
1345                     .field("sdl_alen", &self.sdl_alen)
1346                     .field("sdl_slen", &self.sdl_slen)
1347                     // FIXME: .field("sdl_data", &self.sdl_data)
1348                     .finish()
1349             }
1350         }
1351         impl ::hash::Hash for sockaddr_dl {
1352             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1353                 self.sdl_len.hash(state);
1354                 self.sdl_family.hash(state);
1355                 self.sdl_index.hash(state);
1356                 self.sdl_type.hash(state);
1357                 self.sdl_nlen.hash(state);
1358                 self.sdl_alen.hash(state);
1359                 self.sdl_slen.hash(state);
1360                 self.sdl_data.hash(state);
1361             }
1362         }
1363 
1364         impl PartialEq for mq_attr {
1365             fn eq(&self, other: &mq_attr) -> bool {
1366                 self.mq_flags == other.mq_flags &&
1367                 self.mq_maxmsg == other.mq_maxmsg &&
1368                 self.mq_msgsize == other.mq_msgsize &&
1369                 self.mq_curmsgs == other.mq_curmsgs
1370             }
1371         }
1372         impl Eq for mq_attr {}
1373         impl ::fmt::Debug for mq_attr {
1374             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1375                 f.debug_struct("mq_attr")
1376                     .field("mq_flags", &self.mq_flags)
1377                     .field("mq_maxmsg", &self.mq_maxmsg)
1378                     .field("mq_msgsize", &self.mq_msgsize)
1379                     .field("mq_curmsgs", &self.mq_curmsgs)
1380                     .finish()
1381             }
1382         }
1383         impl ::hash::Hash for mq_attr {
1384             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1385                 self.mq_flags.hash(state);
1386                 self.mq_maxmsg.hash(state);
1387                 self.mq_msgsize.hash(state);
1388                 self.mq_curmsgs.hash(state);
1389             }
1390         }
1391 
1392         impl PartialEq for sigevent {
1393             fn eq(&self, other: &sigevent) -> bool {
1394                 self.sigev_notify == other.sigev_notify
1395                     && self.sigev_signo == other.sigev_signo
1396                     && self.sigev_value == other.sigev_value
1397                     && self.sigev_notify_thread_id
1398                         == other.sigev_notify_thread_id
1399             }
1400         }
1401         impl Eq for sigevent {}
1402         impl ::fmt::Debug for sigevent {
1403             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1404                 f.debug_struct("sigevent")
1405                     .field("sigev_notify", &self.sigev_notify)
1406                     .field("sigev_signo", &self.sigev_signo)
1407                     .field("sigev_value", &self.sigev_value)
1408                     .field("sigev_notify_thread_id",
1409                            &self.sigev_notify_thread_id)
1410                     .finish()
1411             }
1412         }
1413         impl ::hash::Hash for sigevent {
1414             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1415                 self.sigev_notify.hash(state);
1416                 self.sigev_signo.hash(state);
1417                 self.sigev_value.hash(state);
1418                 self.sigev_notify_thread_id.hash(state);
1419             }
1420         }
1421 
1422         impl PartialEq for ptsstat {
1423             fn eq(&self, other: &ptsstat) -> bool {
1424                 let self_devname: &[::c_char] = &self.devname;
1425                 let other_devname: &[::c_char] = &other.devname;
1426 
1427                 self.dev == other.dev && self_devname == other_devname
1428             }
1429         }
1430         impl Eq for ptsstat {}
1431         impl ::fmt::Debug for ptsstat {
1432             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1433                 let self_devname: &[::c_char] = &self.devname;
1434 
1435                 f.debug_struct("ptsstat")
1436                     .field("dev", &self.dev)
1437                     .field("devname", &self_devname)
1438                     .finish()
1439             }
1440         }
1441         impl ::hash::Hash for ptsstat {
1442             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1443                 let self_devname: &[::c_char] = &self.devname;
1444 
1445                 self.dev.hash(state);
1446                 self_devname.hash(state);
1447             }
1448         }
1449 
1450         #[cfg(libc_union)]
1451         impl PartialEq for __c_anonymous_elf32_auxv_union {
1452             fn eq(&self, other: &__c_anonymous_elf32_auxv_union) -> bool {
1453                 unsafe { self.a_val == other.a_val}
1454             }
1455         }
1456         #[cfg(libc_union)]
1457         impl Eq for __c_anonymous_elf32_auxv_union {}
1458         #[cfg(libc_union)]
1459         impl ::fmt::Debug for __c_anonymous_elf32_auxv_union {
1460             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1461                 f.debug_struct("a_val")
1462                     .field("a_val", unsafe { &self.a_val })
1463                     .finish()
1464             }
1465         }
1466         #[cfg(not(libc_union))]
1467         impl PartialEq for Elf32_Auxinfo {
1468             fn eq(&self, other: &Elf32_Auxinfo) -> bool {
1469                 self.a_type == other.a_type
1470             }
1471         }
1472         #[cfg(libc_union)]
1473         impl PartialEq for Elf32_Auxinfo {
1474             fn eq(&self, other: &Elf32_Auxinfo) -> bool {
1475                 self.a_type == other.a_type
1476                     && self.a_un == other.a_un
1477             }
1478         }
1479         impl Eq for Elf32_Auxinfo {}
1480         #[cfg(not(libc_union))]
1481         impl ::fmt::Debug for Elf32_Auxinfo {
1482             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1483                 f.debug_struct("Elf32_Auxinfo")
1484                     .field("a_type", &self.a_type)
1485                     .finish()
1486             }
1487         }
1488         #[cfg(libc_union)]
1489         impl ::fmt::Debug for Elf32_Auxinfo {
1490             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1491                 f.debug_struct("Elf32_Auxinfo")
1492                     .field("a_type", &self.a_type)
1493                     .field("a_un", &self.a_un)
1494                     .finish()
1495             }
1496         }
1497 
1498         #[cfg(libc_union)]
1499         impl PartialEq for __c_anonymous_ifr_ifru {
1500             fn eq(&self, other: &__c_anonymous_ifr_ifru) -> bool {
1501                 unsafe {
1502                     self.ifru_addr == other.ifru_addr &&
1503                     self.ifru_dstaddr == other.ifru_dstaddr &&
1504                     self.ifru_broadaddr == other.ifru_broadaddr &&
1505                     self.ifru_buffer == other.ifru_buffer &&
1506                     self.ifru_flags == other.ifru_flags &&
1507                     self.ifru_index == other.ifru_index &&
1508                     self.ifru_jid == other.ifru_jid &&
1509                     self.ifru_metric == other.ifru_metric &&
1510                     self.ifru_mtu == other.ifru_mtu &&
1511                     self.ifru_phys == other.ifru_phys &&
1512                     self.ifru_media == other.ifru_media &&
1513                     self.ifru_data == other.ifru_data &&
1514                     self.ifru_cap == other.ifru_cap &&
1515                     self.ifru_fib == other.ifru_fib &&
1516                     self.ifru_vlan_pcp == other.ifru_vlan_pcp
1517                 }
1518             }
1519         }
1520         #[cfg(libc_union)]
1521         impl Eq for __c_anonymous_ifr_ifru {}
1522         #[cfg(libc_union)]
1523         impl ::fmt::Debug for __c_anonymous_ifr_ifru {
1524             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1525                 f.debug_struct("ifr_ifru")
1526                     .field("ifru_addr", unsafe { &self.ifru_addr })
1527                     .field("ifru_dstaddr", unsafe { &self.ifru_dstaddr })
1528                     .field("ifru_broadaddr", unsafe { &self.ifru_broadaddr })
1529                     .field("ifru_buffer", unsafe { &self.ifru_buffer })
1530                     .field("ifru_flags", unsafe { &self.ifru_flags })
1531                     .field("ifru_index", unsafe { &self.ifru_index })
1532                     .field("ifru_jid", unsafe { &self.ifru_jid })
1533                     .field("ifru_metric", unsafe { &self.ifru_metric })
1534                     .field("ifru_mtu", unsafe { &self.ifru_mtu })
1535                     .field("ifru_phys", unsafe { &self.ifru_phys })
1536                     .field("ifru_media", unsafe { &self.ifru_media })
1537                     .field("ifru_data", unsafe { &self.ifru_data })
1538                     .field("ifru_cap", unsafe { &self.ifru_cap })
1539                     .field("ifru_fib", unsafe { &self.ifru_fib })
1540                     .field("ifru_vlan_pcp", unsafe { &self.ifru_vlan_pcp })
1541                     .finish()
1542             }
1543         }
1544         #[cfg(libc_union)]
1545         impl ::hash::Hash for __c_anonymous_ifr_ifru {
1546             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1547                 unsafe { self.ifru_addr.hash(state) };
1548                 unsafe { self.ifru_dstaddr.hash(state) };
1549                 unsafe { self.ifru_broadaddr.hash(state) };
1550                 unsafe { self.ifru_buffer.hash(state) };
1551                 unsafe { self.ifru_flags.hash(state) };
1552                 unsafe { self.ifru_index.hash(state) };
1553                 unsafe { self.ifru_jid.hash(state) };
1554                 unsafe { self.ifru_metric.hash(state) };
1555                 unsafe { self.ifru_mtu.hash(state) };
1556                 unsafe { self.ifru_phys.hash(state) };
1557                 unsafe { self.ifru_media.hash(state) };
1558                 unsafe { self.ifru_data.hash(state) };
1559                 unsafe { self.ifru_cap.hash(state) };
1560                 unsafe { self.ifru_fib.hash(state) };
1561                 unsafe { self.ifru_vlan_pcp.hash(state) };
1562             }
1563         }
1564 
1565         impl PartialEq for ifreq {
1566             fn eq(&self, other: &ifreq) -> bool {
1567                 self.ifr_name == other.ifr_name && self.ifr_ifru == other.ifr_ifru
1568             }
1569         }
1570         impl Eq for ifreq {}
1571         impl ::fmt::Debug for ifreq {
1572             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1573                 f.debug_struct("ifreq")
1574                     .field("ifr_name", &self.ifr_name)
1575                     .field("ifr_ifru", &self.ifr_ifru)
1576                     .finish()
1577             }
1578         }
1579         impl ::hash::Hash for ifreq {
1580             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1581                 self.ifr_name.hash(state);
1582                 self.ifr_ifru.hash(state);
1583             }
1584         }
1585 
1586         #[cfg(libc_union)]
1587         impl Eq for __c_anonymous_ifc_ifcu {}
1588 
1589         #[cfg(libc_union)]
1590         impl PartialEq for __c_anonymous_ifc_ifcu {
1591             fn eq(&self, other: &__c_anonymous_ifc_ifcu) -> bool {
1592                 unsafe {
1593                     self.ifcu_buf == other.ifcu_buf &&
1594                     self.ifcu_req == other.ifcu_req
1595                 }
1596             }
1597         }
1598 
1599         #[cfg(libc_union)]
1600         impl ::fmt::Debug for __c_anonymous_ifc_ifcu {
1601             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1602                 f.debug_struct("ifc_ifcu")
1603                     .field("ifcu_buf", unsafe { &self.ifcu_buf })
1604                     .field("ifcu_req", unsafe { &self.ifcu_req })
1605                     .finish()
1606             }
1607         }
1608 
1609         #[cfg(libc_union)]
1610         impl ::hash::Hash for __c_anonymous_ifc_ifcu {
1611             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1612                 unsafe { self.ifcu_buf.hash(state) };
1613                 unsafe { self.ifcu_req.hash(state) };
1614             }
1615         }
1616 
1617         impl PartialEq for ifstat {
1618             fn eq(&self, other: &ifstat) -> bool {
1619                 let self_ascii: &[::c_char] = &self.ascii;
1620                 let other_ascii: &[::c_char] = &other.ascii;
1621 
1622                 self.ifs_name == other.ifs_name && self_ascii == other_ascii
1623             }
1624         }
1625         impl Eq for ifstat {}
1626         impl ::fmt::Debug for ifstat {
1627             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1628                 let ascii: &[::c_char] = &self.ascii;
1629 
1630                 f.debug_struct("ifstat")
1631                     .field("ifs_name", &self.ifs_name)
1632                     .field("ascii", &ascii)
1633                     .finish()
1634             }
1635         }
1636         impl ::hash::Hash for ifstat {
1637             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1638                 self.ifs_name.hash(state);
1639                 self.ascii.hash(state);
1640             }
1641         }
1642 
1643         impl PartialEq for ifrsskey {
1644             fn eq(&self, other: &ifrsskey) -> bool {
1645                 let self_ifrk_key: &[u8] = &self.ifrk_key;
1646                 let other_ifrk_key: &[u8] = &other.ifrk_key;
1647 
1648                 self.ifrk_name == other.ifrk_name &&
1649                 self.ifrk_func == other.ifrk_func &&
1650                 self.ifrk_spare0 == other.ifrk_spare0 &&
1651                 self.ifrk_keylen == other.ifrk_keylen &&
1652                 self_ifrk_key == other_ifrk_key
1653             }
1654         }
1655         impl Eq for ifrsskey {}
1656         impl ::fmt::Debug for ifrsskey {
1657             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1658                 let ifrk_key: &[u8] = &self.ifrk_key;
1659 
1660                 f.debug_struct("ifrsskey")
1661                     .field("ifrk_name", &self.ifrk_name)
1662                     .field("ifrk_func", &self.ifrk_func)
1663                     .field("ifrk_spare0", &self.ifrk_spare0)
1664                     .field("ifrk_keylen", &self.ifrk_keylen)
1665                     .field("ifrk_key", &ifrk_key)
1666                     .finish()
1667             }
1668         }
1669         impl ::hash::Hash for ifrsskey {
1670             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1671                 self.ifrk_name.hash(state);
1672                 self.ifrk_func.hash(state);
1673                 self.ifrk_spare0.hash(state);
1674                 self.ifrk_keylen.hash(state);
1675                 self.ifrk_key.hash(state);
1676             }
1677         }
1678 
1679         impl PartialEq for ifdownreason {
1680             fn eq(&self, other: &ifdownreason) -> bool {
1681                 let self_ifdr_msg: &[::c_char] = &self.ifdr_msg;
1682                 let other_ifdr_msg: &[::c_char] = &other.ifdr_msg;
1683 
1684                 self.ifdr_name == other.ifdr_name &&
1685                 self.ifdr_reason == other.ifdr_reason &&
1686                 self.ifdr_vendor == other.ifdr_vendor &&
1687                 self_ifdr_msg == other_ifdr_msg
1688             }
1689         }
1690         impl Eq for ifdownreason {}
1691         impl ::fmt::Debug for ifdownreason {
1692             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1693                 let ifdr_msg: &[::c_char] = &self.ifdr_msg;
1694 
1695                 f.debug_struct("ifdownreason")
1696                     .field("ifdr_name", &self.ifdr_name)
1697                     .field("ifdr_reason", &self.ifdr_reason)
1698                     .field("ifdr_vendor", &self.ifdr_vendor)
1699                     .field("ifdr_msg", &ifdr_msg)
1700                     .finish()
1701             }
1702         }
1703         impl ::hash::Hash for ifdownreason {
1704             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1705                 self.ifdr_name.hash(state);
1706                 self.ifdr_reason.hash(state);
1707                 self.ifdr_vendor.hash(state);
1708                 self.ifdr_msg.hash(state);
1709             }
1710         }
1711 
1712         #[cfg(libc_union)]
1713         impl PartialEq for __c_anonymous_ifi_epoch {
1714             fn eq(&self, other: &__c_anonymous_ifi_epoch) -> bool {
1715                 unsafe {
1716                     self.tt == other.tt &&
1717                     self.ph == other.ph
1718                 }
1719             }
1720         }
1721         #[cfg(libc_union)]
1722         impl Eq for __c_anonymous_ifi_epoch {}
1723         #[cfg(libc_union)]
1724         impl ::fmt::Debug for __c_anonymous_ifi_epoch {
1725             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1726                 f.debug_struct("__c_anonymous_ifi_epoch")
1727                     .field("tt", unsafe { &self.tt })
1728                     .field("ph", unsafe { &self.ph })
1729                     .finish()
1730             }
1731         }
1732         #[cfg(libc_union)]
1733         impl ::hash::Hash for __c_anonymous_ifi_epoch {
1734             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1735                 unsafe {
1736                     self.tt.hash(state);
1737                     self.ph.hash(state);
1738                 }
1739             }
1740         }
1741 
1742         #[cfg(libc_union)]
1743         impl PartialEq for __c_anonymous_ifi_lastchange {
1744             fn eq(&self, other: &__c_anonymous_ifi_lastchange) -> bool {
1745                 unsafe {
1746                     self.tv == other.tv &&
1747                     self.ph == other.ph
1748                 }
1749             }
1750         }
1751         #[cfg(libc_union)]
1752         impl Eq for __c_anonymous_ifi_lastchange {}
1753         #[cfg(libc_union)]
1754         impl ::fmt::Debug for __c_anonymous_ifi_lastchange {
1755             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1756                 f.debug_struct("__c_anonymous_ifi_lastchange")
1757                     .field("tv", unsafe { &self.tv })
1758                     .field("ph", unsafe { &self.ph })
1759                     .finish()
1760             }
1761         }
1762         #[cfg(libc_union)]
1763         impl ::hash::Hash for __c_anonymous_ifi_lastchange {
1764             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1765                 unsafe {
1766                     self.tv.hash(state);
1767                     self.ph.hash(state);
1768                 }
1769             }
1770         }
1771 
1772         impl PartialEq for if_data {
1773             fn eq(&self, other: &if_data) -> bool {
1774                 self.ifi_type == other.ifi_type &&
1775                 self.ifi_physical == other.ifi_physical &&
1776                 self.ifi_addrlen == other.ifi_addrlen &&
1777                 self.ifi_hdrlen == other.ifi_hdrlen &&
1778                 self.ifi_link_state == other.ifi_link_state &&
1779                 self.ifi_vhid == other.ifi_vhid &&
1780                 self.ifi_datalen == other.ifi_datalen &&
1781                 self.ifi_mtu == other.ifi_mtu &&
1782                 self.ifi_metric == other.ifi_metric &&
1783                 self.ifi_baudrate == other.ifi_baudrate &&
1784                 self.ifi_ipackets == other.ifi_ipackets &&
1785                 self.ifi_ierrors == other.ifi_ierrors &&
1786                 self.ifi_opackets == other.ifi_opackets &&
1787                 self.ifi_oerrors == other.ifi_oerrors &&
1788                 self.ifi_collisions == other.ifi_collisions &&
1789                 self.ifi_ibytes == other.ifi_ibytes &&
1790                 self.ifi_obytes == other.ifi_obytes &&
1791                 self.ifi_imcasts == other.ifi_imcasts &&
1792                 self.ifi_omcasts == other.ifi_omcasts &&
1793                 self.ifi_iqdrops == other.ifi_iqdrops &&
1794                 self.ifi_oqdrops == other.ifi_oqdrops &&
1795                 self.ifi_noproto == other.ifi_noproto &&
1796                 self.ifi_hwassist == other.ifi_hwassist &&
1797                 self.__ifi_epoch == other.__ifi_epoch &&
1798                 self.__ifi_lastchange == other.__ifi_lastchange
1799             }
1800         }
1801         impl Eq for if_data {}
1802         impl ::fmt::Debug for if_data {
1803             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1804                 f.debug_struct("if_data")
1805                     .field("ifi_type", &self.ifi_type)
1806                     .field("ifi_physical", &self.ifi_physical)
1807                     .field("ifi_addrlen", &self.ifi_addrlen)
1808                     .field("ifi_hdrlen", &self.ifi_hdrlen)
1809                     .field("ifi_link_state", &self.ifi_link_state)
1810                     .field("ifi_vhid", &self.ifi_vhid)
1811                     .field("ifi_datalen", &self.ifi_datalen)
1812                     .field("ifi_mtu", &self.ifi_mtu)
1813                     .field("ifi_metric", &self.ifi_metric)
1814                     .field("ifi_baudrate", &self.ifi_baudrate)
1815                     .field("ifi_ipackets", &self.ifi_ipackets)
1816                     .field("ifi_ierrors", &self.ifi_ierrors)
1817                     .field("ifi_opackets", &self.ifi_opackets)
1818                     .field("ifi_oerrors", &self.ifi_oerrors)
1819                     .field("ifi_collisions", &self.ifi_collisions)
1820                     .field("ifi_ibytes", &self.ifi_ibytes)
1821                     .field("ifi_obytes", &self.ifi_obytes)
1822                     .field("ifi_imcasts", &self.ifi_imcasts)
1823                     .field("ifi_omcasts", &self.ifi_omcasts)
1824                     .field("ifi_iqdrops", &self.ifi_iqdrops)
1825                     .field("ifi_oqdrops", &self.ifi_oqdrops)
1826                     .field("ifi_noproto", &self.ifi_noproto)
1827                     .field("ifi_hwassist", &self.ifi_hwassist)
1828                     .field("__ifi_epoch", &self.__ifi_epoch)
1829                     .field("__ifi_lastchange", &self.__ifi_lastchange)
1830                     .finish()
1831             }
1832         }
1833         impl ::hash::Hash for if_data {
1834             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1835                 self.ifi_type.hash(state);
1836                 self.ifi_physical.hash(state);
1837                 self.ifi_addrlen.hash(state);
1838                 self.ifi_hdrlen.hash(state);
1839                 self.ifi_link_state.hash(state);
1840                 self.ifi_vhid.hash(state);
1841                 self.ifi_datalen.hash(state);
1842                 self.ifi_mtu.hash(state);
1843                 self.ifi_metric.hash(state);
1844                 self.ifi_baudrate.hash(state);
1845                 self.ifi_ipackets.hash(state);
1846                 self.ifi_ierrors.hash(state);
1847                 self.ifi_opackets.hash(state);
1848                 self.ifi_oerrors.hash(state);
1849                 self.ifi_collisions.hash(state);
1850                 self.ifi_ibytes.hash(state);
1851                 self.ifi_obytes.hash(state);
1852                 self.ifi_imcasts.hash(state);
1853                 self.ifi_omcasts.hash(state);
1854                 self.ifi_iqdrops.hash(state);
1855                 self.ifi_oqdrops.hash(state);
1856                 self.ifi_noproto.hash(state);
1857                 self.ifi_hwassist.hash(state);
1858                 self.__ifi_epoch.hash(state);
1859                 self.__ifi_lastchange.hash(state);
1860             }
1861         }
1862     }
1863 }
1864 
1865 #[cfg_attr(feature = "extra_traits", derive(Debug))]
1866 #[repr(u32)]
1867 pub enum dot3Vendors {
1868     dot3VendorAMD = 1,
1869     dot3VendorIntel = 2,
1870     dot3VendorNational = 4,
1871     dot3VendorFujitsu = 5,
1872     dot3VendorDigital = 6,
1873     dot3VendorWesternDigital = 7,
1874 }
1875 impl ::Copy for dot3Vendors {}
1876 impl ::Clone for dot3Vendors {
clone(&self) -> dot3Vendors1877     fn clone(&self) -> dot3Vendors {
1878         *self
1879     }
1880 }
1881 
1882 // sys/devicestat.h
1883 pub const DEVSTAT_N_TRANS_FLAGS: ::c_int = 4;
1884 pub const DEVSTAT_NAME_LEN: ::c_int = 16;
1885 
1886 pub const SIGEV_THREAD_ID: ::c_int = 4;
1887 
1888 pub const EXTATTR_NAMESPACE_EMPTY: ::c_int = 0;
1889 pub const EXTATTR_NAMESPACE_USER: ::c_int = 1;
1890 pub const EXTATTR_NAMESPACE_SYSTEM: ::c_int = 2;
1891 
1892 pub const PTHREAD_STACK_MIN: ::size_t = MINSIGSTKSZ;
1893 pub const PTHREAD_MUTEX_ADAPTIVE_NP: ::c_int = 4;
1894 pub const PTHREAD_MUTEX_STALLED: ::c_int = 0;
1895 pub const PTHREAD_MUTEX_ROBUST: ::c_int = 1;
1896 pub const SIGSTKSZ: ::size_t = MINSIGSTKSZ + 32768;
1897 pub const SF_NODISKIO: ::c_int = 0x00000001;
1898 pub const SF_MNOWAIT: ::c_int = 0x00000002;
1899 pub const SF_SYNC: ::c_int = 0x00000004;
1900 pub const SF_USER_READAHEAD: ::c_int = 0x00000008;
1901 pub const SF_NOCACHE: ::c_int = 0x00000010;
1902 pub const O_CLOEXEC: ::c_int = 0x00100000;
1903 pub const O_DIRECTORY: ::c_int = 0x00020000;
1904 pub const O_EXEC: ::c_int = 0x00040000;
1905 pub const O_TTY_INIT: ::c_int = 0x00080000;
1906 pub const F_GETLK: ::c_int = 11;
1907 pub const F_SETLK: ::c_int = 12;
1908 pub const F_SETLKW: ::c_int = 13;
1909 pub const ENOTCAPABLE: ::c_int = 93;
1910 pub const ECAPMODE: ::c_int = 94;
1911 pub const ENOTRECOVERABLE: ::c_int = 95;
1912 pub const EOWNERDEAD: ::c_int = 96;
1913 pub const EINTEGRITY: ::c_int = 97;
1914 pub const RLIMIT_NPTS: ::c_int = 11;
1915 pub const RLIMIT_SWAP: ::c_int = 12;
1916 pub const RLIMIT_KQUEUES: ::c_int = 13;
1917 pub const RLIMIT_UMTXP: ::c_int = 14;
1918 #[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
1919 pub const RLIM_NLIMITS: ::rlim_t = 15;
1920 pub const RLIM_SAVED_MAX: ::rlim_t = ::RLIM_INFINITY;
1921 pub const RLIM_SAVED_CUR: ::rlim_t = ::RLIM_INFINITY;
1922 
1923 pub const CP_USER: ::c_int = 0;
1924 pub const CP_NICE: ::c_int = 1;
1925 pub const CP_SYS: ::c_int = 2;
1926 pub const CP_INTR: ::c_int = 3;
1927 pub const CP_IDLE: ::c_int = 4;
1928 pub const CPUSTATES: ::c_int = 5;
1929 
1930 pub const NI_NOFQDN: ::c_int = 0x00000001;
1931 pub const NI_NUMERICHOST: ::c_int = 0x00000002;
1932 pub const NI_NAMEREQD: ::c_int = 0x00000004;
1933 pub const NI_NUMERICSERV: ::c_int = 0x00000008;
1934 pub const NI_DGRAM: ::c_int = 0x00000010;
1935 pub const NI_NUMERICSCOPE: ::c_int = 0x00000020;
1936 
1937 pub const XU_NGROUPS: ::c_int = 16;
1938 
1939 pub const Q_GETQUOTA: ::c_int = 0x700;
1940 pub const Q_SETQUOTA: ::c_int = 0x800;
1941 
1942 pub const MAP_GUARD: ::c_int = 0x00002000;
1943 pub const MAP_EXCL: ::c_int = 0x00004000;
1944 pub const MAP_PREFAULT_READ: ::c_int = 0x00040000;
1945 pub const MAP_ALIGNED_SUPER: ::c_int = 1 << 24;
1946 
1947 pub const POSIX_FADV_NORMAL: ::c_int = 0;
1948 pub const POSIX_FADV_RANDOM: ::c_int = 1;
1949 pub const POSIX_FADV_SEQUENTIAL: ::c_int = 2;
1950 pub const POSIX_FADV_WILLNEED: ::c_int = 3;
1951 pub const POSIX_FADV_DONTNEED: ::c_int = 4;
1952 pub const POSIX_FADV_NOREUSE: ::c_int = 5;
1953 
1954 pub const POLLINIGNEOF: ::c_short = 0x2000;
1955 
1956 pub const EVFILT_READ: i16 = -1;
1957 pub const EVFILT_WRITE: i16 = -2;
1958 pub const EVFILT_AIO: i16 = -3;
1959 pub const EVFILT_VNODE: i16 = -4;
1960 pub const EVFILT_PROC: i16 = -5;
1961 pub const EVFILT_SIGNAL: i16 = -6;
1962 pub const EVFILT_TIMER: i16 = -7;
1963 pub const EVFILT_PROCDESC: i16 = -8;
1964 pub const EVFILT_FS: i16 = -9;
1965 pub const EVFILT_LIO: i16 = -10;
1966 pub const EVFILT_USER: i16 = -11;
1967 pub const EVFILT_SENDFILE: i16 = -12;
1968 pub const EVFILT_EMPTY: i16 = -13;
1969 
1970 pub const EV_ADD: u16 = 0x1;
1971 pub const EV_DELETE: u16 = 0x2;
1972 pub const EV_ENABLE: u16 = 0x4;
1973 pub const EV_DISABLE: u16 = 0x8;
1974 pub const EV_ONESHOT: u16 = 0x10;
1975 pub const EV_CLEAR: u16 = 0x20;
1976 pub const EV_RECEIPT: u16 = 0x40;
1977 pub const EV_DISPATCH: u16 = 0x80;
1978 pub const EV_DROP: u16 = 0x1000;
1979 pub const EV_FLAG1: u16 = 0x2000;
1980 pub const EV_ERROR: u16 = 0x4000;
1981 pub const EV_EOF: u16 = 0x8000;
1982 pub const EV_SYSFLAGS: u16 = 0xf000;
1983 
1984 pub const NOTE_TRIGGER: u32 = 0x01000000;
1985 pub const NOTE_FFNOP: u32 = 0x00000000;
1986 pub const NOTE_FFAND: u32 = 0x40000000;
1987 pub const NOTE_FFOR: u32 = 0x80000000;
1988 pub const NOTE_FFCOPY: u32 = 0xc0000000;
1989 pub const NOTE_FFCTRLMASK: u32 = 0xc0000000;
1990 pub const NOTE_FFLAGSMASK: u32 = 0x00ffffff;
1991 pub const NOTE_LOWAT: u32 = 0x00000001;
1992 pub const NOTE_DELETE: u32 = 0x00000001;
1993 pub const NOTE_WRITE: u32 = 0x00000002;
1994 pub const NOTE_EXTEND: u32 = 0x00000004;
1995 pub const NOTE_ATTRIB: u32 = 0x00000008;
1996 pub const NOTE_LINK: u32 = 0x00000010;
1997 pub const NOTE_RENAME: u32 = 0x00000020;
1998 pub const NOTE_REVOKE: u32 = 0x00000040;
1999 pub const NOTE_EXIT: u32 = 0x80000000;
2000 pub const NOTE_FORK: u32 = 0x40000000;
2001 pub const NOTE_EXEC: u32 = 0x20000000;
2002 pub const NOTE_PDATAMASK: u32 = 0x000fffff;
2003 pub const NOTE_PCTRLMASK: u32 = 0xf0000000;
2004 pub const NOTE_TRACK: u32 = 0x00000001;
2005 pub const NOTE_TRACKERR: u32 = 0x00000002;
2006 pub const NOTE_CHILD: u32 = 0x00000004;
2007 pub const NOTE_SECONDS: u32 = 0x00000001;
2008 pub const NOTE_MSECONDS: u32 = 0x00000002;
2009 pub const NOTE_USECONDS: u32 = 0x00000004;
2010 pub const NOTE_NSECONDS: u32 = 0x00000008;
2011 
2012 pub const MADV_PROTECT: ::c_int = 10;
2013 
2014 #[doc(hidden)]
2015 #[deprecated(
2016     since = "0.2.72",
2017     note = "CTL_UNSPEC is deprecated. Use CTL_SYSCTL instead"
2018 )]
2019 pub const CTL_UNSPEC: ::c_int = 0;
2020 pub const CTL_SYSCTL: ::c_int = 0;
2021 pub const CTL_KERN: ::c_int = 1;
2022 pub const CTL_VM: ::c_int = 2;
2023 pub const CTL_VFS: ::c_int = 3;
2024 pub const CTL_NET: ::c_int = 4;
2025 pub const CTL_DEBUG: ::c_int = 5;
2026 pub const CTL_HW: ::c_int = 6;
2027 pub const CTL_MACHDEP: ::c_int = 7;
2028 pub const CTL_USER: ::c_int = 8;
2029 pub const CTL_P1003_1B: ::c_int = 9;
2030 
2031 // sys/sysctl.h
2032 pub const CTL_MAXNAME: ::c_int = 24;
2033 
2034 pub const CTLTYPE: ::c_int = 0xf;
2035 pub const CTLTYPE_NODE: ::c_int = 1;
2036 pub const CTLTYPE_INT: ::c_int = 2;
2037 pub const CTLTYPE_STRING: ::c_int = 3;
2038 pub const CTLTYPE_S64: ::c_int = 4;
2039 pub const CTLTYPE_OPAQUE: ::c_int = 5;
2040 pub const CTLTYPE_STRUCT: ::c_int = CTLTYPE_OPAQUE;
2041 pub const CTLTYPE_UINT: ::c_int = 6;
2042 pub const CTLTYPE_LONG: ::c_int = 7;
2043 pub const CTLTYPE_ULONG: ::c_int = 8;
2044 pub const CTLTYPE_U64: ::c_int = 9;
2045 pub const CTLTYPE_U8: ::c_int = 0xa;
2046 pub const CTLTYPE_U16: ::c_int = 0xb;
2047 pub const CTLTYPE_S8: ::c_int = 0xc;
2048 pub const CTLTYPE_S16: ::c_int = 0xd;
2049 pub const CTLTYPE_S32: ::c_int = 0xe;
2050 pub const CTLTYPE_U32: ::c_int = 0xf;
2051 
2052 pub const CTLFLAG_RD: ::c_int = 0x80000000;
2053 pub const CTLFLAG_WR: ::c_int = 0x40000000;
2054 pub const CTLFLAG_RW: ::c_int = CTLFLAG_RD | CTLFLAG_WR;
2055 pub const CTLFLAG_DORMANT: ::c_int = 0x20000000;
2056 pub const CTLFLAG_ANYBODY: ::c_int = 0x10000000;
2057 pub const CTLFLAG_SECURE: ::c_int = 0x08000000;
2058 pub const CTLFLAG_PRISON: ::c_int = 0x04000000;
2059 pub const CTLFLAG_DYN: ::c_int = 0x02000000;
2060 pub const CTLFLAG_SKIP: ::c_int = 0x01000000;
2061 pub const CTLMASK_SECURE: ::c_int = 0x00F00000;
2062 pub const CTLFLAG_TUN: ::c_int = 0x00080000;
2063 pub const CTLFLAG_RDTUN: ::c_int = CTLFLAG_RD | CTLFLAG_TUN;
2064 pub const CTLFLAG_RWTUN: ::c_int = CTLFLAG_RW | CTLFLAG_TUN;
2065 pub const CTLFLAG_MPSAFE: ::c_int = 0x00040000;
2066 pub const CTLFLAG_VNET: ::c_int = 0x00020000;
2067 pub const CTLFLAG_DYING: ::c_int = 0x00010000;
2068 pub const CTLFLAG_CAPRD: ::c_int = 0x00008000;
2069 pub const CTLFLAG_CAPWR: ::c_int = 0x00004000;
2070 pub const CTLFLAG_STATS: ::c_int = 0x00002000;
2071 pub const CTLFLAG_NOFETCH: ::c_int = 0x00001000;
2072 pub const CTLFLAG_CAPRW: ::c_int = CTLFLAG_CAPRD | CTLFLAG_CAPWR;
2073 pub const CTLFLAG_NEEDGIANT: ::c_int = 0x00000800;
2074 
2075 pub const CTLSHIFT_SECURE: ::c_int = 20;
2076 pub const CTLFLAG_SECURE1: ::c_int = CTLFLAG_SECURE | (0 << CTLSHIFT_SECURE);
2077 pub const CTLFLAG_SECURE2: ::c_int = CTLFLAG_SECURE | (1 << CTLSHIFT_SECURE);
2078 pub const CTLFLAG_SECURE3: ::c_int = CTLFLAG_SECURE | (2 << CTLSHIFT_SECURE);
2079 
2080 pub const OID_AUTO: ::c_int = -1;
2081 
2082 pub const CTL_SYSCTL_DEBUG: ::c_int = 0;
2083 pub const CTL_SYSCTL_NAME: ::c_int = 1;
2084 pub const CTL_SYSCTL_NEXT: ::c_int = 2;
2085 pub const CTL_SYSCTL_NAME2OID: ::c_int = 3;
2086 pub const CTL_SYSCTL_OIDFMT: ::c_int = 4;
2087 pub const CTL_SYSCTL_OIDDESCR: ::c_int = 5;
2088 pub const CTL_SYSCTL_OIDLABEL: ::c_int = 6;
2089 pub const CTL_SYSCTL_NEXTNOSKIP: ::c_int = 7;
2090 
2091 pub const KERN_OSTYPE: ::c_int = 1;
2092 pub const KERN_OSRELEASE: ::c_int = 2;
2093 pub const KERN_OSREV: ::c_int = 3;
2094 pub const KERN_VERSION: ::c_int = 4;
2095 pub const KERN_MAXVNODES: ::c_int = 5;
2096 pub const KERN_MAXPROC: ::c_int = 6;
2097 pub const KERN_MAXFILES: ::c_int = 7;
2098 pub const KERN_ARGMAX: ::c_int = 8;
2099 pub const KERN_SECURELVL: ::c_int = 9;
2100 pub const KERN_HOSTNAME: ::c_int = 10;
2101 pub const KERN_HOSTID: ::c_int = 11;
2102 pub const KERN_CLOCKRATE: ::c_int = 12;
2103 pub const KERN_VNODE: ::c_int = 13;
2104 pub const KERN_PROC: ::c_int = 14;
2105 pub const KERN_FILE: ::c_int = 15;
2106 pub const KERN_PROF: ::c_int = 16;
2107 pub const KERN_POSIX1: ::c_int = 17;
2108 pub const KERN_NGROUPS: ::c_int = 18;
2109 pub const KERN_JOB_CONTROL: ::c_int = 19;
2110 pub const KERN_SAVED_IDS: ::c_int = 20;
2111 pub const KERN_BOOTTIME: ::c_int = 21;
2112 pub const KERN_NISDOMAINNAME: ::c_int = 22;
2113 pub const KERN_UPDATEINTERVAL: ::c_int = 23;
2114 pub const KERN_OSRELDATE: ::c_int = 24;
2115 pub const KERN_NTP_PLL: ::c_int = 25;
2116 pub const KERN_BOOTFILE: ::c_int = 26;
2117 pub const KERN_MAXFILESPERPROC: ::c_int = 27;
2118 pub const KERN_MAXPROCPERUID: ::c_int = 28;
2119 pub const KERN_DUMPDEV: ::c_int = 29;
2120 pub const KERN_IPC: ::c_int = 30;
2121 pub const KERN_DUMMY: ::c_int = 31;
2122 pub const KERN_PS_STRINGS: ::c_int = 32;
2123 pub const KERN_USRSTACK: ::c_int = 33;
2124 pub const KERN_LOGSIGEXIT: ::c_int = 34;
2125 pub const KERN_IOV_MAX: ::c_int = 35;
2126 pub const KERN_HOSTUUID: ::c_int = 36;
2127 pub const KERN_ARND: ::c_int = 37;
2128 pub const KERN_MAXPHYS: ::c_int = 38;
2129 
2130 pub const KERN_PROC_ALL: ::c_int = 0;
2131 pub const KERN_PROC_PID: ::c_int = 1;
2132 pub const KERN_PROC_PGRP: ::c_int = 2;
2133 pub const KERN_PROC_SESSION: ::c_int = 3;
2134 pub const KERN_PROC_TTY: ::c_int = 4;
2135 pub const KERN_PROC_UID: ::c_int = 5;
2136 pub const KERN_PROC_RUID: ::c_int = 6;
2137 pub const KERN_PROC_ARGS: ::c_int = 7;
2138 pub const KERN_PROC_PROC: ::c_int = 8;
2139 pub const KERN_PROC_SV_NAME: ::c_int = 9;
2140 pub const KERN_PROC_RGID: ::c_int = 10;
2141 pub const KERN_PROC_GID: ::c_int = 11;
2142 pub const KERN_PROC_PATHNAME: ::c_int = 12;
2143 pub const KERN_PROC_OVMMAP: ::c_int = 13;
2144 pub const KERN_PROC_OFILEDESC: ::c_int = 14;
2145 pub const KERN_PROC_KSTACK: ::c_int = 15;
2146 pub const KERN_PROC_INC_THREAD: ::c_int = 0x10;
2147 pub const KERN_PROC_VMMAP: ::c_int = 32;
2148 pub const KERN_PROC_FILEDESC: ::c_int = 33;
2149 pub const KERN_PROC_GROUPS: ::c_int = 34;
2150 pub const KERN_PROC_ENV: ::c_int = 35;
2151 pub const KERN_PROC_AUXV: ::c_int = 36;
2152 pub const KERN_PROC_RLIMIT: ::c_int = 37;
2153 pub const KERN_PROC_PS_STRINGS: ::c_int = 38;
2154 pub const KERN_PROC_UMASK: ::c_int = 39;
2155 pub const KERN_PROC_OSREL: ::c_int = 40;
2156 pub const KERN_PROC_SIGTRAMP: ::c_int = 41;
2157 pub const KERN_PROC_CWD: ::c_int = 42;
2158 pub const KERN_PROC_NFDS: ::c_int = 43;
2159 pub const KERN_PROC_SIGFASTBLK: ::c_int = 44;
2160 
2161 pub const KIPC_MAXSOCKBUF: ::c_int = 1;
2162 pub const KIPC_SOCKBUF_WASTE: ::c_int = 2;
2163 pub const KIPC_SOMAXCONN: ::c_int = 3;
2164 pub const KIPC_MAX_LINKHDR: ::c_int = 4;
2165 pub const KIPC_MAX_PROTOHDR: ::c_int = 5;
2166 pub const KIPC_MAX_HDR: ::c_int = 6;
2167 pub const KIPC_MAX_DATALEN: ::c_int = 7;
2168 
2169 pub const HW_MACHINE: ::c_int = 1;
2170 pub const HW_MODEL: ::c_int = 2;
2171 pub const HW_NCPU: ::c_int = 3;
2172 pub const HW_BYTEORDER: ::c_int = 4;
2173 pub const HW_PHYSMEM: ::c_int = 5;
2174 pub const HW_USERMEM: ::c_int = 6;
2175 pub const HW_PAGESIZE: ::c_int = 7;
2176 pub const HW_DISKNAMES: ::c_int = 8;
2177 pub const HW_DISKSTATS: ::c_int = 9;
2178 pub const HW_FLOATINGPT: ::c_int = 10;
2179 pub const HW_MACHINE_ARCH: ::c_int = 11;
2180 pub const HW_REALMEM: ::c_int = 12;
2181 
2182 pub const USER_CS_PATH: ::c_int = 1;
2183 pub const USER_BC_BASE_MAX: ::c_int = 2;
2184 pub const USER_BC_DIM_MAX: ::c_int = 3;
2185 pub const USER_BC_SCALE_MAX: ::c_int = 4;
2186 pub const USER_BC_STRING_MAX: ::c_int = 5;
2187 pub const USER_COLL_WEIGHTS_MAX: ::c_int = 6;
2188 pub const USER_EXPR_NEST_MAX: ::c_int = 7;
2189 pub const USER_LINE_MAX: ::c_int = 8;
2190 pub const USER_RE_DUP_MAX: ::c_int = 9;
2191 pub const USER_POSIX2_VERSION: ::c_int = 10;
2192 pub const USER_POSIX2_C_BIND: ::c_int = 11;
2193 pub const USER_POSIX2_C_DEV: ::c_int = 12;
2194 pub const USER_POSIX2_CHAR_TERM: ::c_int = 13;
2195 pub const USER_POSIX2_FORT_DEV: ::c_int = 14;
2196 pub const USER_POSIX2_FORT_RUN: ::c_int = 15;
2197 pub const USER_POSIX2_LOCALEDEF: ::c_int = 16;
2198 pub const USER_POSIX2_SW_DEV: ::c_int = 17;
2199 pub const USER_POSIX2_UPE: ::c_int = 18;
2200 pub const USER_STREAM_MAX: ::c_int = 19;
2201 pub const USER_TZNAME_MAX: ::c_int = 20;
2202 pub const USER_LOCALBASE: ::c_int = 21;
2203 
2204 pub const CTL_P1003_1B_ASYNCHRONOUS_IO: ::c_int = 1;
2205 pub const CTL_P1003_1B_MAPPED_FILES: ::c_int = 2;
2206 pub const CTL_P1003_1B_MEMLOCK: ::c_int = 3;
2207 pub const CTL_P1003_1B_MEMLOCK_RANGE: ::c_int = 4;
2208 pub const CTL_P1003_1B_MEMORY_PROTECTION: ::c_int = 5;
2209 pub const CTL_P1003_1B_MESSAGE_PASSING: ::c_int = 6;
2210 pub const CTL_P1003_1B_PRIORITIZED_IO: ::c_int = 7;
2211 pub const CTL_P1003_1B_PRIORITY_SCHEDULING: ::c_int = 8;
2212 pub const CTL_P1003_1B_REALTIME_SIGNALS: ::c_int = 9;
2213 pub const CTL_P1003_1B_SEMAPHORES: ::c_int = 10;
2214 pub const CTL_P1003_1B_FSYNC: ::c_int = 11;
2215 pub const CTL_P1003_1B_SHARED_MEMORY_OBJECTS: ::c_int = 12;
2216 pub const CTL_P1003_1B_SYNCHRONIZED_IO: ::c_int = 13;
2217 pub const CTL_P1003_1B_TIMERS: ::c_int = 14;
2218 pub const CTL_P1003_1B_AIO_LISTIO_MAX: ::c_int = 15;
2219 pub const CTL_P1003_1B_AIO_MAX: ::c_int = 16;
2220 pub const CTL_P1003_1B_AIO_PRIO_DELTA_MAX: ::c_int = 17;
2221 pub const CTL_P1003_1B_DELAYTIMER_MAX: ::c_int = 18;
2222 pub const CTL_P1003_1B_MQ_OPEN_MAX: ::c_int = 19;
2223 pub const CTL_P1003_1B_PAGESIZE: ::c_int = 20;
2224 pub const CTL_P1003_1B_RTSIG_MAX: ::c_int = 21;
2225 pub const CTL_P1003_1B_SEM_NSEMS_MAX: ::c_int = 22;
2226 pub const CTL_P1003_1B_SEM_VALUE_MAX: ::c_int = 23;
2227 pub const CTL_P1003_1B_SIGQUEUE_MAX: ::c_int = 24;
2228 pub const CTL_P1003_1B_TIMER_MAX: ::c_int = 25;
2229 
2230 pub const TIOCGPTN: ::c_ulong = 0x4004740f;
2231 pub const TIOCPTMASTER: ::c_ulong = 0x2000741c;
2232 pub const TIOCSIG: ::c_ulong = 0x2004745f;
2233 pub const TIOCM_DCD: ::c_int = 0x40;
2234 pub const H4DISC: ::c_int = 0x7;
2235 
2236 pub const VM_TOTAL: ::c_int = 1;
2237 
2238 pub const BIOCSETFNR: ::c_ulong = 0x80104282;
2239 
2240 pub const FIODGNAME: ::c_ulong = 0x80106678;
2241 pub const FIONWRITE: ::c_ulong = 0x40046677;
2242 pub const FIONSPACE: ::c_ulong = 0x40046676;
2243 pub const FIOSEEKDATA: ::c_ulong = 0xc0086661;
2244 pub const FIOSEEKHOLE: ::c_ulong = 0xc0086662;
2245 
2246 pub const JAIL_API_VERSION: u32 = 2;
2247 pub const JAIL_CREATE: ::c_int = 0x01;
2248 pub const JAIL_UPDATE: ::c_int = 0x02;
2249 pub const JAIL_ATTACH: ::c_int = 0x04;
2250 pub const JAIL_DYING: ::c_int = 0x08;
2251 pub const JAIL_SET_MASK: ::c_int = 0x0f;
2252 pub const JAIL_GET_MASK: ::c_int = 0x08;
2253 pub const JAIL_SYS_DISABLE: ::c_int = 0;
2254 pub const JAIL_SYS_NEW: ::c_int = 1;
2255 pub const JAIL_SYS_INHERIT: ::c_int = 2;
2256 
2257 pub const MNT_ACLS: ::c_int = 0x08000000;
2258 pub const MNT_BYFSID: ::c_int = 0x08000000;
2259 pub const MNT_GJOURNAL: ::c_int = 0x02000000;
2260 pub const MNT_MULTILABEL: ::c_int = 0x04000000;
2261 pub const MNT_NFS4ACLS: ::c_int = 0x00000010;
2262 pub const MNT_SNAPSHOT: ::c_int = 0x01000000;
2263 pub const MNT_UNION: ::c_int = 0x00000020;
2264 pub const MNT_EXPUBLIC: ::c_int = 0x20000000;
2265 pub const MNT_NONBUSY: ::c_int = 0x04000000;
2266 
2267 pub const SCM_CREDS2: ::c_int = 0x08;
2268 
2269 pub const SO_BINTIME: ::c_int = 0x2000;
2270 pub const SO_NO_OFFLOAD: ::c_int = 0x4000;
2271 pub const SO_NO_DDP: ::c_int = 0x8000;
2272 pub const SO_REUSEPORT_LB: ::c_int = 0x10000;
2273 pub const SO_LABEL: ::c_int = 0x1009;
2274 pub const SO_PEERLABEL: ::c_int = 0x1010;
2275 pub const SO_LISTENQLIMIT: ::c_int = 0x1011;
2276 pub const SO_LISTENQLEN: ::c_int = 0x1012;
2277 pub const SO_LISTENINCQLEN: ::c_int = 0x1013;
2278 pub const SO_SETFIB: ::c_int = 0x1014;
2279 pub const SO_USER_COOKIE: ::c_int = 0x1015;
2280 pub const SO_PROTOCOL: ::c_int = 0x1016;
2281 pub const SO_PROTOTYPE: ::c_int = SO_PROTOCOL;
2282 pub const SO_DOMAIN: ::c_int = 0x1019;
2283 pub const SO_VENDOR: ::c_int = 0x80000000;
2284 
2285 pub const LOCAL_CREDS: ::c_int = 2;
2286 pub const LOCAL_CREDS_PERSISTENT: ::c_int = 3;
2287 pub const LOCAL_CONNWAIT: ::c_int = 4;
2288 pub const LOCAL_VENDOR: ::c_int = SO_VENDOR;
2289 
2290 pub const PL_EVENT_NONE: ::c_int = 0;
2291 pub const PL_EVENT_SIGNAL: ::c_int = 1;
2292 pub const PL_FLAG_SA: ::c_int = 0x01;
2293 pub const PL_FLAG_BOUND: ::c_int = 0x02;
2294 pub const PL_FLAG_SCE: ::c_int = 0x04;
2295 pub const PL_FLAG_SCX: ::c_int = 0x08;
2296 pub const PL_FLAG_EXEC: ::c_int = 0x10;
2297 pub const PL_FLAG_SI: ::c_int = 0x20;
2298 pub const PL_FLAG_FORKED: ::c_int = 0x40;
2299 pub const PL_FLAG_CHILD: ::c_int = 0x80;
2300 pub const PL_FLAG_BORN: ::c_int = 0x100;
2301 pub const PL_FLAG_EXITED: ::c_int = 0x200;
2302 pub const PL_FLAG_VFORKED: ::c_int = 0x400;
2303 pub const PL_FLAG_VFORK_DONE: ::c_int = 0x800;
2304 
2305 pub const PT_LWPINFO: ::c_int = 13;
2306 pub const PT_GETNUMLWPS: ::c_int = 14;
2307 pub const PT_GETLWPLIST: ::c_int = 15;
2308 pub const PT_CLEARSTEP: ::c_int = 16;
2309 pub const PT_SETSTEP: ::c_int = 17;
2310 pub const PT_SUSPEND: ::c_int = 18;
2311 pub const PT_RESUME: ::c_int = 19;
2312 pub const PT_TO_SCE: ::c_int = 20;
2313 pub const PT_TO_SCX: ::c_int = 21;
2314 pub const PT_SYSCALL: ::c_int = 22;
2315 pub const PT_FOLLOW_FORK: ::c_int = 23;
2316 pub const PT_LWP_EVENTS: ::c_int = 24;
2317 pub const PT_GET_EVENT_MASK: ::c_int = 25;
2318 pub const PT_SET_EVENT_MASK: ::c_int = 26;
2319 pub const PT_GET_SC_ARGS: ::c_int = 27;
2320 pub const PT_GET_SC_RET: ::c_int = 28;
2321 pub const PT_COREDUMP: ::c_int = 29;
2322 pub const PT_GETREGS: ::c_int = 33;
2323 pub const PT_SETREGS: ::c_int = 34;
2324 pub const PT_GETFPREGS: ::c_int = 35;
2325 pub const PT_SETFPREGS: ::c_int = 36;
2326 pub const PT_GETDBREGS: ::c_int = 37;
2327 pub const PT_SETDBREGS: ::c_int = 38;
2328 pub const PT_VM_TIMESTAMP: ::c_int = 40;
2329 pub const PT_VM_ENTRY: ::c_int = 41;
2330 pub const PT_GETREGSET: ::c_int = 42;
2331 pub const PT_SETREGSET: ::c_int = 43;
2332 pub const PT_FIRSTMACH: ::c_int = 64;
2333 
2334 pub const PTRACE_EXEC: ::c_int = 0x0001;
2335 pub const PTRACE_SCE: ::c_int = 0x0002;
2336 pub const PTRACE_SCX: ::c_int = 0x0004;
2337 pub const PTRACE_SYSCALL: ::c_int = PTRACE_SCE | PTRACE_SCX;
2338 pub const PTRACE_FORK: ::c_int = 0x0008;
2339 pub const PTRACE_LWP: ::c_int = 0x0010;
2340 pub const PTRACE_VFORK: ::c_int = 0x0020;
2341 pub const PTRACE_DEFAULT: ::c_int = PTRACE_EXEC;
2342 
2343 pub const PC_COMPRESS: u32 = 0x00000001;
2344 pub const PC_ALL: u32 = 0x00000002;
2345 
2346 pub const PROC_SPROTECT: ::c_int = 1;
2347 pub const PROC_REAP_ACQUIRE: ::c_int = 2;
2348 pub const PROC_REAP_RELEASE: ::c_int = 3;
2349 pub const PROC_REAP_STATUS: ::c_int = 4;
2350 pub const PROC_REAP_GETPIDS: ::c_int = 5;
2351 pub const PROC_REAP_KILL: ::c_int = 6;
2352 pub const PROC_TRACE_CTL: ::c_int = 7;
2353 pub const PROC_TRACE_STATUS: ::c_int = 8;
2354 pub const PROC_TRAPCAP_CTL: ::c_int = 9;
2355 pub const PROC_TRAPCAP_STATUS: ::c_int = 10;
2356 pub const PROC_PDEATHSIG_CTL: ::c_int = 11;
2357 pub const PROC_PDEATHSIG_STATUS: ::c_int = 12;
2358 pub const PROC_ASLR_CTL: ::c_int = 13;
2359 pub const PROC_ASLR_STATUS: ::c_int = 14;
2360 pub const PROC_PROTMAX_CTL: ::c_int = 15;
2361 pub const PROC_PROTMAX_STATUS: ::c_int = 16;
2362 pub const PROC_STACKGAP_CTL: ::c_int = 17;
2363 pub const PROC_STACKGAP_STATUS: ::c_int = 18;
2364 pub const PROC_PROCCTL_MD_MIN: ::c_int = 0x10000000;
2365 
2366 pub const PPROT_SET: ::c_int = 1;
2367 pub const PPROT_CLEAR: ::c_int = 2;
2368 pub const PPROT_DESCEND: ::c_int = 0x10;
2369 pub const PPROT_INHERIT: ::c_int = 0x20;
2370 
2371 pub const PROC_TRACE_CTL_ENABLE: ::c_int = 1;
2372 pub const PROC_TRACE_CTL_DISABLE: ::c_int = 2;
2373 pub const PROC_TRACE_CTL_DISABLE_EXEC: ::c_int = 3;
2374 
2375 pub const PROC_TRAPCAP_CTL_ENABLE: ::c_int = 1;
2376 pub const PROC_TRAPCAP_CTL_DISABLE: ::c_int = 2;
2377 
2378 pub const PROC_ASLR_FORCE_ENABLE: ::c_int = 1;
2379 pub const PROC_ASLR_FORCE_DISABLE: ::c_int = 2;
2380 pub const PROC_ASLR_NOFORCE: ::c_int = 3;
2381 pub const PROC_ASLR_ACTIVE: ::c_int = 0x80000000;
2382 
2383 pub const PROC_PROTMAX_FORCE_ENABLE: ::c_int = 1;
2384 pub const PROC_PROTMAX_FORCE_DISABLE: ::c_int = 2;
2385 pub const PROC_PROTMAX_NOFORCE: ::c_int = 3;
2386 pub const PROC_PROTMAX_ACTIVE: ::c_int = 0x80000000;
2387 
2388 pub const PROC_STACKGAP_ENABLE: ::c_int = 0x0001;
2389 pub const PROC_STACKGAP_DISABLE: ::c_int = 0x0002;
2390 pub const PROC_STACKGAP_ENABLE_EXEC: ::c_int = 0x0004;
2391 pub const PROC_STACKGAP_DISABLE_EXEC: ::c_int = 0x0008;
2392 
2393 pub const AF_SLOW: ::c_int = 33;
2394 pub const AF_SCLUSTER: ::c_int = 34;
2395 pub const AF_ARP: ::c_int = 35;
2396 pub const AF_BLUETOOTH: ::c_int = 36;
2397 pub const AF_IEEE80211: ::c_int = 37;
2398 pub const AF_INET_SDP: ::c_int = 40;
2399 pub const AF_INET6_SDP: ::c_int = 42;
2400 
2401 // sys/net/if.h
2402 pub const IF_MAXUNIT: ::c_int = 0x7fff;
2403 /// (n) interface is up
2404 pub const IFF_UP: ::c_int = 0x1;
2405 /// (i) broadcast address valid
2406 pub const IFF_BROADCAST: ::c_int = 0x2;
2407 /// (n) turn on debugging
2408 pub const IFF_DEBUG: ::c_int = 0x4;
2409 /// (i) is a loopback net
2410 pub const IFF_LOOPBACK: ::c_int = 0x8;
2411 /// (i) is a point-to-point link
2412 pub const IFF_POINTOPOINT: ::c_int = 0x10;
2413 /// (i) calls if_input in net epoch
2414 pub const IFF_KNOWSEPOCH: ::c_int = 0x20;
2415 /// (d) resources allocated
2416 pub const IFF_RUNNING: ::c_int = 0x40;
2417 #[doc(hidden)]
2418 #[deprecated(
2419     since = "0.2.54",
2420     note = "IFF_DRV_RUNNING is deprecated. Use the portable IFF_RUNNING instead"
2421 )]
2422 /// (d) resources allocate
2423 pub const IFF_DRV_RUNNING: ::c_int = 0x40;
2424 /// (n) no address resolution protocol
2425 pub const IFF_NOARP: ::c_int = 0x80;
2426 /// (n) receive all packets
2427 pub const IFF_PROMISC: ::c_int = 0x100;
2428 /// (n) receive all multicast packets
2429 pub const IFF_ALLMULTI: ::c_int = 0x200;
2430 /// (d) tx hardware queue is full
2431 pub const IFF_OACTIVE: ::c_int = 0x400;
2432 #[doc(hidden)]
2433 #[deprecated(since = "0.2.54", note = "Use the portable `IFF_OACTIVE` instead")]
2434 /// (d) tx hardware queue is full
2435 pub const IFF_DRV_OACTIVE: ::c_int = 0x400;
2436 /// (i) can't hear own transmissions
2437 pub const IFF_SIMPLEX: ::c_int = 0x800;
2438 /// per link layer defined bit
2439 pub const IFF_LINK0: ::c_int = 0x1000;
2440 /// per link layer defined bit
2441 pub const IFF_LINK1: ::c_int = 0x2000;
2442 /// per link layer defined bit
2443 pub const IFF_LINK2: ::c_int = 0x4000;
2444 /// use alternate physical connection
2445 pub const IFF_ALTPHYS: ::c_int = IFF_LINK2;
2446 /// (i) supports multicast
2447 pub const IFF_MULTICAST: ::c_int = 0x8000;
2448 /// (i) unconfigurable using ioctl(2)
2449 pub const IFF_CANTCONFIG: ::c_int = 0x10000;
2450 /// (n) user-requested promisc mode
2451 pub const IFF_PPROMISC: ::c_int = 0x20000;
2452 /// (n) user-requested monitor mode
2453 pub const IFF_MONITOR: ::c_int = 0x40000;
2454 /// (n) static ARP
2455 pub const IFF_STATICARP: ::c_int = 0x80000;
2456 /// (n) interface is winding down
2457 pub const IFF_DYING: ::c_int = 0x200000;
2458 /// (n) interface is being renamed
2459 pub const IFF_RENAMING: ::c_int = 0x400000;
2460 /// interface is not part of any groups
2461 pub const IFF_NOGROUP: ::c_int = 0x800000;
2462 
2463 /// link invalid/unknown
2464 pub const LINK_STATE_UNKNOWN: ::c_int = 0;
2465 /// link is down
2466 pub const LINK_STATE_DOWN: ::c_int = 1;
2467 /// link is up
2468 pub const LINK_STATE_UP: ::c_int = 2;
2469 
2470 /// can offload checksum on RX
2471 pub const IFCAP_RXCSUM: ::c_int = 0x00001;
2472 /// can offload checksum on TX
2473 pub const IFCAP_TXCSUM: ::c_int = 0x00002;
2474 /// can be a network console
2475 pub const IFCAP_NETCONS: ::c_int = 0x00004;
2476 /// VLAN-compatible MTU
2477 pub const IFCAP_VLAN_MTU: ::c_int = 0x00008;
2478 /// hardware VLAN tag support
2479 pub const IFCAP_VLAN_HWTAGGING: ::c_int = 0x00010;
2480 /// 9000 byte MTU supported
2481 pub const IFCAP_JUMBO_MTU: ::c_int = 0x00020;
2482 /// driver supports polling
2483 pub const IFCAP_POLLING: ::c_int = 0x00040;
2484 /// can do IFCAP_HWCSUM on VLANs
2485 pub const IFCAP_VLAN_HWCSUM: ::c_int = 0x00080;
2486 /// can do TCP Segmentation Offload
2487 pub const IFCAP_TSO4: ::c_int = 0x00100;
2488 /// can do TCP6 Segmentation Offload
2489 pub const IFCAP_TSO6: ::c_int = 0x00200;
2490 /// can do Large Receive Offload
2491 pub const IFCAP_LRO: ::c_int = 0x00400;
2492 /// wake on any unicast frame
2493 pub const IFCAP_WOL_UCAST: ::c_int = 0x00800;
2494 /// wake on any multicast frame
2495 pub const IFCAP_WOL_MCAST: ::c_int = 0x01000;
2496 /// wake on any Magic Packet
2497 pub const IFCAP_WOL_MAGIC: ::c_int = 0x02000;
2498 /// interface can offload TCP
2499 pub const IFCAP_TOE4: ::c_int = 0x04000;
2500 /// interface can offload TCP6
2501 pub const IFCAP_TOE6: ::c_int = 0x08000;
2502 /// interface hw can filter vlan tag
2503 pub const IFCAP_VLAN_HWFILTER: ::c_int = 0x10000;
2504 /// can do IFCAP_TSO on VLANs
2505 pub const IFCAP_VLAN_HWTSO: ::c_int = 0x40000;
2506 /// the runtime link state is dynamic
2507 pub const IFCAP_LINKSTATE: ::c_int = 0x80000;
2508 /// netmap mode supported/enabled
2509 pub const IFCAP_NETMAP: ::c_int = 0x100000;
2510 /// can offload checksum on IPv6 RX
2511 pub const IFCAP_RXCSUM_IPV6: ::c_int = 0x200000;
2512 /// can offload checksum on IPv6 TX
2513 pub const IFCAP_TXCSUM_IPV6: ::c_int = 0x400000;
2514 /// manages counters internally
2515 pub const IFCAP_HWSTATS: ::c_int = 0x800000;
2516 /// hardware supports TX rate limiting
2517 pub const IFCAP_TXRTLMT: ::c_int = 0x1000000;
2518 /// hardware rx timestamping
2519 pub const IFCAP_HWRXTSTMP: ::c_int = 0x2000000;
2520 /// understands M_EXTPG mbufs
2521 pub const IFCAP_MEXTPG: ::c_int = 0x4000000;
2522 /// can do TLS encryption and segmentation for TCP
2523 pub const IFCAP_TXTLS4: ::c_int = 0x8000000;
2524 /// can do TLS encryption and segmentation for TCP6
2525 pub const IFCAP_TXTLS6: ::c_int = 0x10000000;
2526 /// can do IFCAN_HWCSUM on VXLANs
2527 pub const IFCAP_VXLAN_HWCSUM: ::c_int = 0x20000000;
2528 /// can do IFCAP_TSO on VXLANs
2529 pub const IFCAP_VXLAN_HWTSO: ::c_int = 0x40000000;
2530 /// can do TLS with rate limiting
2531 pub const IFCAP_TXTLS_RTLMT: ::c_int = 0x80000000;
2532 
2533 pub const IFCAP_HWCSUM_IPV6: ::c_int = IFCAP_RXCSUM_IPV6 | IFCAP_TXCSUM_IPV6;
2534 pub const IFCAP_HWCSUM: ::c_int = IFCAP_RXCSUM | IFCAP_TXCSUM;
2535 pub const IFCAP_TSO: ::c_int = IFCAP_TSO4 | IFCAP_TSO6;
2536 pub const IFCAP_WOL: ::c_int = IFCAP_WOL_UCAST | IFCAP_WOL_MCAST | IFCAP_WOL_MAGIC;
2537 pub const IFCAP_TOE: ::c_int = IFCAP_TOE4 | IFCAP_TOE6;
2538 pub const IFCAP_TXTLS: ::c_int = IFCAP_TXTLS4 | IFCAP_TXTLS6;
2539 pub const IFCAP_CANTCHANGE: ::c_int = IFCAP_NETMAP;
2540 
2541 pub const IFQ_MAXLEN: ::c_int = 50;
2542 pub const IFNET_SLOWHZ: ::c_int = 1;
2543 
2544 pub const IFAN_ARRIVAL: ::c_int = 0;
2545 pub const IFAN_DEPARTURE: ::c_int = 1;
2546 
2547 pub const IFSTATMAX: ::c_int = 800;
2548 
2549 pub const RSS_FUNC_NONE: ::c_int = 0;
2550 pub const RSS_FUNC_PRIVATE: ::c_int = 1;
2551 pub const RSS_FUNC_TOEPLITZ: ::c_int = 2;
2552 
2553 pub const RSS_TYPE_IPV4: ::c_int = 0x00000001;
2554 pub const RSS_TYPE_TCP_IPV4: ::c_int = 0x00000002;
2555 pub const RSS_TYPE_IPV6: ::c_int = 0x00000004;
2556 pub const RSS_TYPE_IPV6_EX: ::c_int = 0x00000008;
2557 pub const RSS_TYPE_TCP_IPV6: ::c_int = 0x00000010;
2558 pub const RSS_TYPE_TCP_IPV6_EX: ::c_int = 0x00000020;
2559 pub const RSS_TYPE_UDP_IPV4: ::c_int = 0x00000040;
2560 pub const RSS_TYPE_UDP_IPV6: ::c_int = 0x00000080;
2561 pub const RSS_TYPE_UDP_IPV6_EX: ::c_int = 0x00000100;
2562 pub const RSS_KEYLEN: ::c_int = 128;
2563 
2564 pub const IFNET_PCP_NONE: ::c_int = 0xff;
2565 pub const IFDR_MSG_SIZE: ::c_int = 64;
2566 pub const IFDR_REASON_MSG: ::c_int = 1;
2567 pub const IFDR_REASON_VENDOR: ::c_int = 2;
2568 
2569 // sys/net/if_mib.h
2570 
2571 /// non-interface-specific
2572 pub const IFMIB_SYSTEM: ::c_int = 1;
2573 /// per-interface data table
2574 pub const IFMIB_IFDATA: ::c_int = 2;
2575 
2576 /// generic stats for all kinds of ifaces
2577 pub const IFDATA_GENERAL: ::c_int = 1;
2578 /// specific to the type of interface
2579 pub const IFDATA_LINKSPECIFIC: ::c_int = 2;
2580 /// driver name and unit
2581 pub const IFDATA_DRIVERNAME: ::c_int = 3;
2582 
2583 /// number of interfaces configured
2584 pub const IFMIB_IFCOUNT: ::c_int = 1;
2585 
2586 /// functions not specific to a type of iface
2587 pub const NETLINK_GENERIC: ::c_int = 0;
2588 
2589 pub const DOT3COMPLIANCE_STATS: ::c_int = 1;
2590 pub const DOT3COMPLIANCE_COLLS: ::c_int = 2;
2591 
2592 pub const dot3ChipSetAMD7990: ::c_int = 1;
2593 pub const dot3ChipSetAMD79900: ::c_int = 2;
2594 pub const dot3ChipSetAMD79C940: ::c_int = 3;
2595 
2596 pub const dot3ChipSetIntel82586: ::c_int = 1;
2597 pub const dot3ChipSetIntel82596: ::c_int = 2;
2598 pub const dot3ChipSetIntel82557: ::c_int = 3;
2599 
2600 pub const dot3ChipSetNational8390: ::c_int = 1;
2601 pub const dot3ChipSetNationalSonic: ::c_int = 2;
2602 
2603 pub const dot3ChipSetFujitsu86950: ::c_int = 1;
2604 
2605 pub const dot3ChipSetDigitalDC21040: ::c_int = 1;
2606 pub const dot3ChipSetDigitalDC21140: ::c_int = 2;
2607 pub const dot3ChipSetDigitalDC21041: ::c_int = 3;
2608 pub const dot3ChipSetDigitalDC21140A: ::c_int = 4;
2609 pub const dot3ChipSetDigitalDC21142: ::c_int = 5;
2610 
2611 pub const dot3ChipSetWesternDigital83C690: ::c_int = 1;
2612 pub const dot3ChipSetWesternDigital83C790: ::c_int = 2;
2613 
2614 // sys/netinet/in.h
2615 // Protocols (RFC 1700)
2616 // NOTE: These are in addition to the constants defined in src/unix/mod.rs
2617 
2618 // IPPROTO_IP defined in src/unix/mod.rs
2619 /// IP6 hop-by-hop options
2620 pub const IPPROTO_HOPOPTS: ::c_int = 0;
2621 // IPPROTO_ICMP defined in src/unix/mod.rs
2622 /// group mgmt protocol
2623 pub const IPPROTO_IGMP: ::c_int = 2;
2624 /// gateway^2 (deprecated)
2625 pub const IPPROTO_GGP: ::c_int = 3;
2626 /// for compatibility
2627 pub const IPPROTO_IPIP: ::c_int = 4;
2628 // IPPROTO_TCP defined in src/unix/mod.rs
2629 /// Stream protocol II.
2630 pub const IPPROTO_ST: ::c_int = 7;
2631 /// exterior gateway protocol
2632 pub const IPPROTO_EGP: ::c_int = 8;
2633 /// private interior gateway
2634 pub const IPPROTO_PIGP: ::c_int = 9;
2635 /// BBN RCC Monitoring
2636 pub const IPPROTO_RCCMON: ::c_int = 10;
2637 /// network voice protocol
2638 pub const IPPROTO_NVPII: ::c_int = 11;
2639 /// pup
2640 pub const IPPROTO_PUP: ::c_int = 12;
2641 /// Argus
2642 pub const IPPROTO_ARGUS: ::c_int = 13;
2643 /// EMCON
2644 pub const IPPROTO_EMCON: ::c_int = 14;
2645 /// Cross Net Debugger
2646 pub const IPPROTO_XNET: ::c_int = 15;
2647 /// Chaos
2648 pub const IPPROTO_CHAOS: ::c_int = 16;
2649 // IPPROTO_UDP defined in src/unix/mod.rs
2650 /// Multiplexing
2651 pub const IPPROTO_MUX: ::c_int = 18;
2652 /// DCN Measurement Subsystems
2653 pub const IPPROTO_MEAS: ::c_int = 19;
2654 /// Host Monitoring
2655 pub const IPPROTO_HMP: ::c_int = 20;
2656 /// Packet Radio Measurement
2657 pub const IPPROTO_PRM: ::c_int = 21;
2658 /// xns idp
2659 pub const IPPROTO_IDP: ::c_int = 22;
2660 /// Trunk-1
2661 pub const IPPROTO_TRUNK1: ::c_int = 23;
2662 /// Trunk-2
2663 pub const IPPROTO_TRUNK2: ::c_int = 24;
2664 /// Leaf-1
2665 pub const IPPROTO_LEAF1: ::c_int = 25;
2666 /// Leaf-2
2667 pub const IPPROTO_LEAF2: ::c_int = 26;
2668 /// Reliable Data
2669 pub const IPPROTO_RDP: ::c_int = 27;
2670 /// Reliable Transaction
2671 pub const IPPROTO_IRTP: ::c_int = 28;
2672 /// tp-4 w/ class negotiation
2673 pub const IPPROTO_TP: ::c_int = 29;
2674 /// Bulk Data Transfer
2675 pub const IPPROTO_BLT: ::c_int = 30;
2676 /// Network Services
2677 pub const IPPROTO_NSP: ::c_int = 31;
2678 /// Merit Internodal
2679 pub const IPPROTO_INP: ::c_int = 32;
2680 #[doc(hidden)]
2681 #[deprecated(
2682     since = "0.2.72",
2683     note = "IPPROTO_SEP is deprecated. Use IPPROTO_DCCP instead"
2684 )]
2685 pub const IPPROTO_SEP: ::c_int = 33;
2686 /// Datagram Congestion Control Protocol
2687 pub const IPPROTO_DCCP: ::c_int = 33;
2688 /// Third Party Connect
2689 pub const IPPROTO_3PC: ::c_int = 34;
2690 /// InterDomain Policy Routing
2691 pub const IPPROTO_IDPR: ::c_int = 35;
2692 /// XTP
2693 pub const IPPROTO_XTP: ::c_int = 36;
2694 /// Datagram Delivery
2695 pub const IPPROTO_DDP: ::c_int = 37;
2696 /// Control Message Transport
2697 pub const IPPROTO_CMTP: ::c_int = 38;
2698 /// TP++ Transport
2699 pub const IPPROTO_TPXX: ::c_int = 39;
2700 /// IL transport protocol
2701 pub const IPPROTO_IL: ::c_int = 40;
2702 // IPPROTO_IPV6 defined in src/unix/mod.rs
2703 /// Source Demand Routing
2704 pub const IPPROTO_SDRP: ::c_int = 42;
2705 /// IP6 routing header
2706 pub const IPPROTO_ROUTING: ::c_int = 43;
2707 /// IP6 fragmentation header
2708 pub const IPPROTO_FRAGMENT: ::c_int = 44;
2709 /// InterDomain Routing
2710 pub const IPPROTO_IDRP: ::c_int = 45;
2711 /// resource reservation
2712 pub const IPPROTO_RSVP: ::c_int = 46;
2713 /// General Routing Encap.
2714 pub const IPPROTO_GRE: ::c_int = 47;
2715 /// Mobile Host Routing
2716 pub const IPPROTO_MHRP: ::c_int = 48;
2717 /// BHA
2718 pub const IPPROTO_BHA: ::c_int = 49;
2719 /// IP6 Encap Sec. Payload
2720 pub const IPPROTO_ESP: ::c_int = 50;
2721 /// IP6 Auth Header
2722 pub const IPPROTO_AH: ::c_int = 51;
2723 /// Integ. Net Layer Security
2724 pub const IPPROTO_INLSP: ::c_int = 52;
2725 /// IP with encryption
2726 pub const IPPROTO_SWIPE: ::c_int = 53;
2727 /// Next Hop Resolution
2728 pub const IPPROTO_NHRP: ::c_int = 54;
2729 /// IP Mobility
2730 pub const IPPROTO_MOBILE: ::c_int = 55;
2731 /// Transport Layer Security
2732 pub const IPPROTO_TLSP: ::c_int = 56;
2733 /// SKIP
2734 pub const IPPROTO_SKIP: ::c_int = 57;
2735 // IPPROTO_ICMPV6 defined in src/unix/mod.rs
2736 /// IP6 no next header
2737 pub const IPPROTO_NONE: ::c_int = 59;
2738 /// IP6 destination option
2739 pub const IPPROTO_DSTOPTS: ::c_int = 60;
2740 /// any host internal protocol
2741 pub const IPPROTO_AHIP: ::c_int = 61;
2742 /// CFTP
2743 pub const IPPROTO_CFTP: ::c_int = 62;
2744 /// "hello" routing protocol
2745 pub const IPPROTO_HELLO: ::c_int = 63;
2746 /// SATNET/Backroom EXPAK
2747 pub const IPPROTO_SATEXPAK: ::c_int = 64;
2748 /// Kryptolan
2749 pub const IPPROTO_KRYPTOLAN: ::c_int = 65;
2750 /// Remote Virtual Disk
2751 pub const IPPROTO_RVD: ::c_int = 66;
2752 /// Pluribus Packet Core
2753 pub const IPPROTO_IPPC: ::c_int = 67;
2754 /// Any distributed FS
2755 pub const IPPROTO_ADFS: ::c_int = 68;
2756 /// Satnet Monitoring
2757 pub const IPPROTO_SATMON: ::c_int = 69;
2758 /// VISA Protocol
2759 pub const IPPROTO_VISA: ::c_int = 70;
2760 /// Packet Core Utility
2761 pub const IPPROTO_IPCV: ::c_int = 71;
2762 /// Comp. Prot. Net. Executive
2763 pub const IPPROTO_CPNX: ::c_int = 72;
2764 /// Comp. Prot. HeartBeat
2765 pub const IPPROTO_CPHB: ::c_int = 73;
2766 /// Wang Span Network
2767 pub const IPPROTO_WSN: ::c_int = 74;
2768 /// Packet Video Protocol
2769 pub const IPPROTO_PVP: ::c_int = 75;
2770 /// BackRoom SATNET Monitoring
2771 pub const IPPROTO_BRSATMON: ::c_int = 76;
2772 /// Sun net disk proto (temp.)
2773 pub const IPPROTO_ND: ::c_int = 77;
2774 /// WIDEBAND Monitoring
2775 pub const IPPROTO_WBMON: ::c_int = 78;
2776 /// WIDEBAND EXPAK
2777 pub const IPPROTO_WBEXPAK: ::c_int = 79;
2778 /// ISO cnlp
2779 pub const IPPROTO_EON: ::c_int = 80;
2780 /// VMTP
2781 pub const IPPROTO_VMTP: ::c_int = 81;
2782 /// Secure VMTP
2783 pub const IPPROTO_SVMTP: ::c_int = 82;
2784 /// Banyon VINES
2785 pub const IPPROTO_VINES: ::c_int = 83;
2786 /// TTP
2787 pub const IPPROTO_TTP: ::c_int = 84;
2788 /// NSFNET-IGP
2789 pub const IPPROTO_IGP: ::c_int = 85;
2790 /// dissimilar gateway prot.
2791 pub const IPPROTO_DGP: ::c_int = 86;
2792 /// TCF
2793 pub const IPPROTO_TCF: ::c_int = 87;
2794 /// Cisco/GXS IGRP
2795 pub const IPPROTO_IGRP: ::c_int = 88;
2796 /// OSPFIGP
2797 pub const IPPROTO_OSPFIGP: ::c_int = 89;
2798 /// Strite RPC protocol
2799 pub const IPPROTO_SRPC: ::c_int = 90;
2800 /// Locus Address Resoloution
2801 pub const IPPROTO_LARP: ::c_int = 91;
2802 /// Multicast Transport
2803 pub const IPPROTO_MTP: ::c_int = 92;
2804 /// AX.25 Frames
2805 pub const IPPROTO_AX25: ::c_int = 93;
2806 /// IP encapsulated in IP
2807 pub const IPPROTO_IPEIP: ::c_int = 94;
2808 /// Mobile Int.ing control
2809 pub const IPPROTO_MICP: ::c_int = 95;
2810 /// Semaphore Comm. security
2811 pub const IPPROTO_SCCSP: ::c_int = 96;
2812 /// Ethernet IP encapsulation
2813 pub const IPPROTO_ETHERIP: ::c_int = 97;
2814 /// encapsulation header
2815 pub const IPPROTO_ENCAP: ::c_int = 98;
2816 /// any private encr. scheme
2817 pub const IPPROTO_APES: ::c_int = 99;
2818 /// GMTP
2819 pub const IPPROTO_GMTP: ::c_int = 100;
2820 /// payload compression (IPComp)
2821 pub const IPPROTO_IPCOMP: ::c_int = 108;
2822 /// SCTP
2823 pub const IPPROTO_SCTP: ::c_int = 132;
2824 /// IPv6 Mobility Header
2825 pub const IPPROTO_MH: ::c_int = 135;
2826 /// UDP-Lite
2827 pub const IPPROTO_UDPLITE: ::c_int = 136;
2828 /// IP6 Host Identity Protocol
2829 pub const IPPROTO_HIP: ::c_int = 139;
2830 /// IP6 Shim6 Protocol
2831 pub const IPPROTO_SHIM6: ::c_int = 140;
2832 
2833 /* 101-254: Partly Unassigned */
2834 /// Protocol Independent Mcast
2835 pub const IPPROTO_PIM: ::c_int = 103;
2836 /// CARP
2837 pub const IPPROTO_CARP: ::c_int = 112;
2838 /// PGM
2839 pub const IPPROTO_PGM: ::c_int = 113;
2840 /// MPLS-in-IP
2841 pub const IPPROTO_MPLS: ::c_int = 137;
2842 /// PFSYNC
2843 pub const IPPROTO_PFSYNC: ::c_int = 240;
2844 
2845 /* 255: Reserved */
2846 /* BSD Private, local use, namespace incursion, no longer used */
2847 /// OLD divert pseudo-proto
2848 pub const IPPROTO_OLD_DIVERT: ::c_int = 254;
2849 pub const IPPROTO_MAX: ::c_int = 256;
2850 /// last return value of *_input(), meaning "all job for this pkt is done".
2851 pub const IPPROTO_DONE: ::c_int = 257;
2852 
2853 /* Only used internally, so can be outside the range of valid IP protocols. */
2854 /// divert pseudo-protocol
2855 pub const IPPROTO_DIVERT: ::c_int = 258;
2856 /// SeND pseudo-protocol
2857 pub const IPPROTO_SEND: ::c_int = 259;
2858 
2859 // sys/netinet/TCP.h
2860 pub const TCP_MD5SIG: ::c_int = 16;
2861 pub const TCP_INFO: ::c_int = 32;
2862 pub const TCP_CONGESTION: ::c_int = 64;
2863 pub const TCP_CCALGOOPT: ::c_int = 65;
2864 pub const TCP_MAXUNACKTIME: ::c_int = 68;
2865 pub const TCP_MAXPEAKRATE: ::c_int = 69;
2866 pub const TCP_IDLE_REDUCE: ::c_int = 70;
2867 pub const TCP_REMOTE_UDP_ENCAPS_PORT: ::c_int = 71;
2868 pub const TCP_DELACK: ::c_int = 72;
2869 pub const TCP_FIN_IS_RST: ::c_int = 73;
2870 pub const TCP_LOG_LIMIT: ::c_int = 74;
2871 pub const TCP_SHARED_CWND_ALLOWED: ::c_int = 75;
2872 pub const TCP_PROC_ACCOUNTING: ::c_int = 76;
2873 pub const TCP_USE_CMP_ACKS: ::c_int = 77;
2874 pub const TCP_PERF_INFO: ::c_int = 78;
2875 pub const TCP_LRD: ::c_int = 79;
2876 pub const TCP_KEEPINIT: ::c_int = 128;
2877 pub const TCP_FASTOPEN: ::c_int = 1025;
2878 pub const TCP_PCAP_OUT: ::c_int = 2048;
2879 pub const TCP_PCAP_IN: ::c_int = 4096;
2880 pub const TCP_FASTOPEN_PSK_LEN: ::c_int = 16;
2881 pub const TCP_FUNCTION_NAME_LEN_MAX: ::c_int = 32;
2882 
2883 pub const IP_BINDANY: ::c_int = 24;
2884 pub const IP_BINDMULTI: ::c_int = 25;
2885 pub const IP_RSS_LISTEN_BUCKET: ::c_int = 26;
2886 pub const IP_ORIGDSTADDR: ::c_int = 27;
2887 pub const IP_RECVORIGDSTADDR: ::c_int = IP_ORIGDSTADDR;
2888 
2889 pub const IP_RECVTOS: ::c_int = 68;
2890 
2891 pub const IPV6_BINDANY: ::c_int = 64;
2892 pub const IPV6_ORIGDSTADDR: ::c_int = 72;
2893 pub const IPV6_RECVORIGDSTADDR: ::c_int = IPV6_ORIGDSTADDR;
2894 
2895 pub const PF_SLOW: ::c_int = AF_SLOW;
2896 pub const PF_SCLUSTER: ::c_int = AF_SCLUSTER;
2897 pub const PF_ARP: ::c_int = AF_ARP;
2898 pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH;
2899 pub const PF_IEEE80211: ::c_int = AF_IEEE80211;
2900 pub const PF_INET_SDP: ::c_int = AF_INET_SDP;
2901 pub const PF_INET6_SDP: ::c_int = AF_INET6_SDP;
2902 
2903 pub const NET_RT_DUMP: ::c_int = 1;
2904 pub const NET_RT_FLAGS: ::c_int = 2;
2905 pub const NET_RT_IFLIST: ::c_int = 3;
2906 pub const NET_RT_IFMALIST: ::c_int = 4;
2907 pub const NET_RT_IFLISTL: ::c_int = 5;
2908 
2909 // System V IPC
2910 pub const IPC_INFO: ::c_int = 3;
2911 pub const MSG_NOERROR: ::c_int = 0o10000;
2912 pub const SHM_LOCK: ::c_int = 11;
2913 pub const SHM_UNLOCK: ::c_int = 12;
2914 pub const SHM_STAT: ::c_int = 13;
2915 pub const SHM_INFO: ::c_int = 14;
2916 pub const SHM_ANON: *mut ::c_char = 1 as *mut ::c_char;
2917 
2918 // The *_MAXID constants never should've been used outside of the
2919 // FreeBSD base system.  And with the exception of CTL_P1003_1B_MAXID,
2920 // they were all removed in svn r262489.  They remain here for backwards
2921 // compatibility only, and are scheduled to be removed in libc 1.0.0.
2922 #[doc(hidden)]
2923 #[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")]
2924 pub const CTL_MAXID: ::c_int = 10;
2925 #[doc(hidden)]
2926 #[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")]
2927 pub const KERN_MAXID: ::c_int = 38;
2928 #[doc(hidden)]
2929 #[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")]
2930 pub const HW_MAXID: ::c_int = 13;
2931 #[doc(hidden)]
2932 #[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")]
2933 pub const USER_MAXID: ::c_int = 21;
2934 #[doc(hidden)]
2935 #[deprecated(since = "0.2.74", note = "Removed in FreeBSD 13")]
2936 pub const CTL_P1003_1B_MAXID: ::c_int = 26;
2937 
2938 pub const MSG_NOTIFICATION: ::c_int = 0x00002000;
2939 pub const MSG_NBIO: ::c_int = 0x00004000;
2940 pub const MSG_COMPAT: ::c_int = 0x00008000;
2941 pub const MSG_CMSG_CLOEXEC: ::c_int = 0x00040000;
2942 pub const MSG_NOSIGNAL: ::c_int = 0x20000;
2943 
2944 // utmpx entry types
2945 pub const EMPTY: ::c_short = 0;
2946 pub const BOOT_TIME: ::c_short = 1;
2947 pub const OLD_TIME: ::c_short = 2;
2948 pub const NEW_TIME: ::c_short = 3;
2949 pub const USER_PROCESS: ::c_short = 4;
2950 pub const INIT_PROCESS: ::c_short = 5;
2951 pub const LOGIN_PROCESS: ::c_short = 6;
2952 pub const DEAD_PROCESS: ::c_short = 7;
2953 pub const SHUTDOWN_TIME: ::c_short = 8;
2954 // utmp database types
2955 pub const UTXDB_ACTIVE: ::c_int = 0;
2956 pub const UTXDB_LASTLOGIN: ::c_int = 1;
2957 pub const UTXDB_LOG: ::c_int = 2;
2958 
2959 pub const LC_COLLATE_MASK: ::c_int = 1 << 0;
2960 pub const LC_CTYPE_MASK: ::c_int = 1 << 1;
2961 pub const LC_MONETARY_MASK: ::c_int = 1 << 2;
2962 pub const LC_NUMERIC_MASK: ::c_int = 1 << 3;
2963 pub const LC_TIME_MASK: ::c_int = 1 << 4;
2964 pub const LC_MESSAGES_MASK: ::c_int = 1 << 5;
2965 pub const LC_ALL_MASK: ::c_int = LC_COLLATE_MASK
2966     | LC_CTYPE_MASK
2967     | LC_MESSAGES_MASK
2968     | LC_MONETARY_MASK
2969     | LC_NUMERIC_MASK
2970     | LC_TIME_MASK;
2971 
2972 pub const WSTOPPED: ::c_int = 2; // same as WUNTRACED
2973 pub const WCONTINUED: ::c_int = 4;
2974 pub const WNOWAIT: ::c_int = 8;
2975 pub const WEXITED: ::c_int = 16;
2976 pub const WTRAPPED: ::c_int = 32;
2977 
2978 // FreeBSD defines a great many more of these, we only expose the
2979 // standardized ones.
2980 pub const P_PID: idtype_t = 0;
2981 pub const P_PGID: idtype_t = 2;
2982 pub const P_ALL: idtype_t = 7;
2983 
2984 pub const UTIME_OMIT: c_long = -2;
2985 pub const UTIME_NOW: c_long = -1;
2986 
2987 pub const B460800: ::speed_t = 460800;
2988 pub const B921600: ::speed_t = 921600;
2989 
2990 pub const AT_FDCWD: ::c_int = -100;
2991 pub const AT_EACCESS: ::c_int = 0x100;
2992 pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x200;
2993 pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400;
2994 pub const AT_REMOVEDIR: ::c_int = 0x800;
2995 
2996 pub const AT_NULL: ::c_int = 0;
2997 pub const AT_IGNORE: ::c_int = 1;
2998 pub const AT_EXECFD: ::c_int = 2;
2999 pub const AT_PHDR: ::c_int = 3;
3000 pub const AT_PHENT: ::c_int = 4;
3001 pub const AT_PHNUM: ::c_int = 5;
3002 pub const AT_PAGESZ: ::c_int = 6;
3003 pub const AT_BASE: ::c_int = 7;
3004 pub const AT_FLAGS: ::c_int = 8;
3005 pub const AT_ENTRY: ::c_int = 9;
3006 pub const AT_NOTELF: ::c_int = 10;
3007 pub const AT_UID: ::c_int = 11;
3008 pub const AT_EUID: ::c_int = 12;
3009 pub const AT_GID: ::c_int = 13;
3010 pub const AT_EGID: ::c_int = 14;
3011 pub const AT_EXECPATH: ::c_int = 15;
3012 
3013 pub const TABDLY: ::tcflag_t = 0x00000004;
3014 pub const TAB0: ::tcflag_t = 0x00000000;
3015 pub const TAB3: ::tcflag_t = 0x00000004;
3016 
3017 pub const _PC_ACL_NFS4: ::c_int = 64;
3018 
3019 pub const _SC_CPUSET_SIZE: ::c_int = 122;
3020 
3021 pub const _UUID_NODE_LEN: usize = 6;
3022 
3023 // Flags which can be passed to pdfork(2)
3024 pub const PD_DAEMON: ::c_int = 0x00000001;
3025 pub const PD_CLOEXEC: ::c_int = 0x00000002;
3026 pub const PD_ALLOWED_AT_FORK: ::c_int = PD_DAEMON | PD_CLOEXEC;
3027 
3028 // Values for struct rtprio (type_ field)
3029 pub const RTP_PRIO_REALTIME: ::c_ushort = 2;
3030 pub const RTP_PRIO_NORMAL: ::c_ushort = 3;
3031 pub const RTP_PRIO_IDLE: ::c_ushort = 4;
3032 
3033 pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x01;
3034 pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x02;
3035 pub const POSIX_SPAWN_SETSCHEDPARAM: ::c_int = 0x04;
3036 pub const POSIX_SPAWN_SETSCHEDULER: ::c_int = 0x08;
3037 pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x10;
3038 pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x20;
3039 
3040 // Flags for chflags(2)
3041 pub const UF_SYSTEM: ::c_ulong = 0x00000080;
3042 pub const UF_SPARSE: ::c_ulong = 0x00000100;
3043 pub const UF_OFFLINE: ::c_ulong = 0x00000200;
3044 pub const UF_REPARSE: ::c_ulong = 0x00000400;
3045 pub const UF_ARCHIVE: ::c_ulong = 0x00000800;
3046 pub const UF_READONLY: ::c_ulong = 0x00001000;
3047 pub const UF_HIDDEN: ::c_ulong = 0x00008000;
3048 pub const SF_SNAPSHOT: ::c_ulong = 0x00200000;
3049 
3050 // fcntl commands
3051 pub const F_ADD_SEALS: ::c_int = 19;
3052 pub const F_GET_SEALS: ::c_int = 20;
3053 pub const F_OGETLK: ::c_int = 7;
3054 pub const F_OSETLK: ::c_int = 8;
3055 pub const F_OSETLKW: ::c_int = 9;
3056 pub const F_RDAHEAD: ::c_int = 16;
3057 pub const F_READAHEAD: ::c_int = 15;
3058 pub const F_SETLK_REMOTE: ::c_int = 14;
3059 pub const F_KINFO: ::c_int = 22;
3060 
3061 // for use with F_ADD_SEALS
3062 pub const F_SEAL_GROW: ::c_int = 4;
3063 pub const F_SEAL_SEAL: ::c_int = 1;
3064 pub const F_SEAL_SHRINK: ::c_int = 2;
3065 pub const F_SEAL_WRITE: ::c_int = 8;
3066 
3067 // for use with fspacectl
3068 pub const SPACECTL_DEALLOC: ::c_int = 1;
3069 
3070 // For getrandom()
3071 pub const GRND_NONBLOCK: ::c_uint = 0x1;
3072 pub const GRND_RANDOM: ::c_uint = 0x2;
3073 pub const GRND_INSECURE: ::c_uint = 0x4;
3074 
3075 // For realhostname* api
3076 pub const HOSTNAME_FOUND: ::c_int = 0;
3077 pub const HOSTNAME_INCORRECTNAME: ::c_int = 1;
3078 pub const HOSTNAME_INVALIDADDR: ::c_int = 2;
3079 pub const HOSTNAME_INVALIDNAME: ::c_int = 3;
3080 
3081 // For rfork
3082 pub const RFFDG: ::c_int = 4;
3083 pub const RFPROC: ::c_int = 16;
3084 pub const RFMEM: ::c_int = 32;
3085 pub const RFNOWAIT: ::c_int = 64;
3086 pub const RFCFDG: ::c_int = 4096;
3087 pub const RFTHREAD: ::c_int = 8192;
3088 pub const RFLINUXTHPN: ::c_int = 65536;
3089 pub const RFTSIGZMB: ::c_int = 524288;
3090 pub const RFSPAWN: ::c_int = 2147483648;
3091 
3092 // For eventfd
3093 pub const EFD_SEMAPHORE: ::c_int = 0x1;
3094 pub const EFD_NONBLOCK: ::c_int = 0x4;
3095 pub const EFD_CLOEXEC: ::c_int = 0x100000;
3096 
3097 pub const MALLOCX_ZERO: ::c_int = 0x40;
3098 
3099 /// size of returned wchan message
3100 pub const WMESGLEN: usize = 8;
3101 /// size of returned lock name
3102 pub const LOCKNAMELEN: usize = 8;
3103 /// size of returned thread name
3104 pub const TDNAMLEN: usize = 16;
3105 /// size of returned ki_comm name
3106 pub const COMMLEN: usize = 19;
3107 /// size of returned ki_emul
3108 pub const KI_EMULNAMELEN: usize = 16;
3109 /// number of groups in ki_groups
3110 pub const KI_NGROUPS: usize = 16;
3111 cfg_if! {
3112     if #[cfg(freebsd11)] {
3113         pub const KI_NSPARE_INT: usize = 4;
3114     } else {
3115         pub const KI_NSPARE_INT: usize = 2;
3116     }
3117 }
3118 pub const KI_NSPARE_LONG: usize = 12;
3119 /// Flags for the process credential.
3120 pub const KI_CRF_CAPABILITY_MODE: usize = 0x00000001;
3121 /// Steal a bit from ki_cr_flags to indicate that the cred had more than
3122 /// KI_NGROUPS groups.
3123 pub const KI_CRF_GRP_OVERFLOW: usize = 0x80000000;
3124 /// controlling tty vnode active
3125 pub const KI_CTTY: usize = 0x00000001;
3126 /// session leader
3127 pub const KI_SLEADER: usize = 0x00000002;
3128 /// proc blocked on lock ki_lockname
3129 pub const KI_LOCKBLOCK: usize = 0x00000004;
3130 /// size of returned ki_login
3131 pub const LOGNAMELEN: usize = 17;
3132 /// size of returned ki_loginclass
3133 pub const LOGINCLASSLEN: usize = 17;
3134 
3135 pub const KF_ATTR_VALID: ::c_int = 0x0001;
3136 pub const KF_TYPE_NONE: ::c_int = 0;
3137 pub const KF_TYPE_VNODE: ::c_int = 1;
3138 pub const KF_TYPE_SOCKET: ::c_int = 2;
3139 pub const KF_TYPE_PIPE: ::c_int = 3;
3140 pub const KF_TYPE_FIFO: ::c_int = 4;
3141 pub const KF_TYPE_KQUEUE: ::c_int = 5;
3142 pub const KF_TYPE_MQUEUE: ::c_int = 7;
3143 pub const KF_TYPE_SHM: ::c_int = 8;
3144 pub const KF_TYPE_SEM: ::c_int = 9;
3145 pub const KF_TYPE_PTS: ::c_int = 10;
3146 pub const KF_TYPE_PROCDESC: ::c_int = 11;
3147 pub const KF_TYPE_DEV: ::c_int = 12;
3148 pub const KF_TYPE_UNKNOWN: ::c_int = 255;
3149 
3150 pub const KF_VTYPE_VNON: ::c_int = 0;
3151 pub const KF_VTYPE_VREG: ::c_int = 1;
3152 pub const KF_VTYPE_VDIR: ::c_int = 2;
3153 pub const KF_VTYPE_VBLK: ::c_int = 3;
3154 pub const KF_VTYPE_VCHR: ::c_int = 4;
3155 pub const KF_VTYPE_VLNK: ::c_int = 5;
3156 pub const KF_VTYPE_VSOCK: ::c_int = 6;
3157 pub const KF_VTYPE_VFIFO: ::c_int = 7;
3158 pub const KF_VTYPE_VBAD: ::c_int = 8;
3159 pub const KF_VTYPE_UNKNOWN: ::c_int = 255;
3160 
3161 /// Current working directory
3162 pub const KF_FD_TYPE_CWD: ::c_int = -1;
3163 /// Root directory
3164 pub const KF_FD_TYPE_ROOT: ::c_int = -2;
3165 /// Jail directory
3166 pub const KF_FD_TYPE_JAIL: ::c_int = -3;
3167 /// Ktrace vnode
3168 pub const KF_FD_TYPE_TRACE: ::c_int = -4;
3169 pub const KF_FD_TYPE_TEXT: ::c_int = -5;
3170 /// Controlling terminal
3171 pub const KF_FD_TYPE_CTTY: ::c_int = -6;
3172 pub const KF_FLAG_READ: ::c_int = 0x00000001;
3173 pub const KF_FLAG_WRITE: ::c_int = 0x00000002;
3174 pub const KF_FLAG_APPEND: ::c_int = 0x00000004;
3175 pub const KF_FLAG_ASYNC: ::c_int = 0x00000008;
3176 pub const KF_FLAG_FSYNC: ::c_int = 0x00000010;
3177 pub const KF_FLAG_NONBLOCK: ::c_int = 0x00000020;
3178 pub const KF_FLAG_DIRECT: ::c_int = 0x00000040;
3179 pub const KF_FLAG_HASLOCK: ::c_int = 0x00000080;
3180 pub const KF_FLAG_SHLOCK: ::c_int = 0x00000100;
3181 pub const KF_FLAG_EXLOCK: ::c_int = 0x00000200;
3182 pub const KF_FLAG_NOFOLLOW: ::c_int = 0x00000400;
3183 pub const KF_FLAG_CREAT: ::c_int = 0x00000800;
3184 pub const KF_FLAG_TRUNC: ::c_int = 0x00001000;
3185 pub const KF_FLAG_EXCL: ::c_int = 0x00002000;
3186 pub const KF_FLAG_EXEC: ::c_int = 0x00004000;
3187 
3188 pub const KVME_TYPE_NONE: ::c_int = 0;
3189 pub const KVME_TYPE_DEFAULT: ::c_int = 1;
3190 pub const KVME_TYPE_VNODE: ::c_int = 2;
3191 pub const KVME_TYPE_SWAP: ::c_int = 3;
3192 pub const KVME_TYPE_DEVICE: ::c_int = 4;
3193 pub const KVME_TYPE_PHYS: ::c_int = 5;
3194 pub const KVME_TYPE_DEAD: ::c_int = 6;
3195 pub const KVME_TYPE_SG: ::c_int = 7;
3196 pub const KVME_TYPE_MGTDEVICE: ::c_int = 8;
3197 // Present in `sys/user.h` but is undefined for whatever reason...
3198 // pub const KVME_TYPE_GUARD: ::c_int = 9;
3199 pub const KVME_TYPE_UNKNOWN: ::c_int = 255;
3200 pub const KVME_PROT_READ: ::c_int = 0x00000001;
3201 pub const KVME_PROT_WRITE: ::c_int = 0x00000002;
3202 pub const KVME_PROT_EXEC: ::c_int = 0x00000004;
3203 pub const KVME_FLAG_COW: ::c_int = 0x00000001;
3204 pub const KVME_FLAG_NEEDS_COPY: ::c_int = 0x00000002;
3205 pub const KVME_FLAG_NOCOREDUMP: ::c_int = 0x00000004;
3206 pub const KVME_FLAG_SUPER: ::c_int = 0x00000008;
3207 pub const KVME_FLAG_GROWS_UP: ::c_int = 0x00000010;
3208 pub const KVME_FLAG_GROWS_DOWN: ::c_int = 0x00000020;
3209 pub const KVME_FLAG_USER_WIRED: ::c_int = 0x00000040;
3210 
3211 pub const KKST_MAXLEN: ::c_int = 1024;
3212 /// Stack is valid.
3213 pub const KKST_STATE_STACKOK: ::c_int = 0;
3214 /// Stack swapped out.
3215 pub const KKST_STATE_SWAPPED: ::c_int = 1;
3216 pub const KKST_STATE_RUNNING: ::c_int = 2;
3217 
3218 // Constants about priority.
3219 pub const PRI_MIN: ::c_int = 0;
3220 pub const PRI_MAX: ::c_int = 255;
3221 pub const PRI_MIN_ITHD: ::c_int = PRI_MIN;
3222 pub const PRI_MAX_ITHD: ::c_int = PRI_MIN_REALTIME - 1;
3223 pub const PI_REALTIME: ::c_int = PRI_MIN_ITHD + 0;
3224 pub const PI_AV: ::c_int = PRI_MIN_ITHD + 4;
3225 pub const PI_NET: ::c_int = PRI_MIN_ITHD + 8;
3226 pub const PI_DISK: ::c_int = PRI_MIN_ITHD + 12;
3227 pub const PI_TTY: ::c_int = PRI_MIN_ITHD + 16;
3228 pub const PI_DULL: ::c_int = PRI_MIN_ITHD + 20;
3229 pub const PI_SOFT: ::c_int = PRI_MIN_ITHD + 24;
3230 pub const PRI_MIN_REALTIME: ::c_int = 48;
3231 pub const PRI_MAX_REALTIME: ::c_int = PRI_MIN_KERN - 1;
3232 pub const PRI_MIN_KERN: ::c_int = 80;
3233 pub const PRI_MAX_KERN: ::c_int = PRI_MIN_TIMESHARE - 1;
3234 pub const PSWP: ::c_int = PRI_MIN_KERN + 0;
3235 pub const PVM: ::c_int = PRI_MIN_KERN + 4;
3236 pub const PINOD: ::c_int = PRI_MIN_KERN + 8;
3237 pub const PRIBIO: ::c_int = PRI_MIN_KERN + 12;
3238 pub const PVFS: ::c_int = PRI_MIN_KERN + 16;
3239 pub const PZERO: ::c_int = PRI_MIN_KERN + 20;
3240 pub const PSOCK: ::c_int = PRI_MIN_KERN + 24;
3241 pub const PWAIT: ::c_int = PRI_MIN_KERN + 28;
3242 pub const PLOCK: ::c_int = PRI_MIN_KERN + 32;
3243 pub const PPAUSE: ::c_int = PRI_MIN_KERN + 36;
3244 pub const PRI_MIN_TIMESHARE: ::c_int = 120;
3245 pub const PRI_MAX_TIMESHARE: ::c_int = PRI_MIN_IDLE - 1;
3246 pub const PUSER: ::c_int = PRI_MIN_TIMESHARE;
3247 pub const PRI_MIN_IDLE: ::c_int = 224;
3248 pub const PRI_MAX_IDLE: ::c_int = PRI_MAX;
3249 
3250 pub const NZERO: ::c_int = 0;
3251 
3252 // Resource utilization information.
3253 pub const RUSAGE_THREAD: ::c_int = 1;
3254 
3255 cfg_if! {
3256     if #[cfg(any(freebsd11, target_pointer_width = "32"))] {
3257         pub const ARG_MAX: ::c_int = 256 * 1024;
3258     } else {
3259         pub const ARG_MAX: ::c_int = 2 * 256 * 1024;
3260     }
3261 }
3262 pub const CHILD_MAX: ::c_int = 40;
3263 /// max command name remembered
3264 pub const MAXCOMLEN: usize = 19;
3265 /// max interpreter file name length
3266 pub const MAXINTERP: ::c_int = ::PATH_MAX;
3267 /// max login name length (incl. NUL)
3268 pub const MAXLOGNAME: ::c_int = 33;
3269 /// max simultaneous processes
3270 pub const MAXUPRC: ::c_int = CHILD_MAX;
3271 /// max bytes for an exec function
3272 pub const NCARGS: ::c_int = ARG_MAX;
3273 ///  /* max number groups
3274 pub const NGROUPS: ::c_int = NGROUPS_MAX + 1;
3275 /// max open files per process
3276 pub const NOFILE: ::c_int = OPEN_MAX;
3277 /// marker for empty group set member
3278 pub const NOGROUP: ::c_int = 65535;
3279 /// max hostname size
3280 pub const MAXHOSTNAMELEN: ::c_int = 256;
3281 /// max bytes in term canon input line
3282 pub const MAX_CANON: ::c_int = 255;
3283 /// max bytes in terminal input
3284 pub const MAX_INPUT: ::c_int = 255;
3285 /// max bytes in a file name
3286 pub const NAME_MAX: ::c_int = 255;
3287 pub const MAXSYMLINKS: ::c_int = 32;
3288 /// max supplemental group id's
3289 pub const NGROUPS_MAX: ::c_int = 1023;
3290 /// max open files per process
3291 pub const OPEN_MAX: ::c_int = 64;
3292 
3293 pub const _POSIX_ARG_MAX: ::c_int = 4096;
3294 pub const _POSIX_LINK_MAX: ::c_int = 8;
3295 pub const _POSIX_MAX_CANON: ::c_int = 255;
3296 pub const _POSIX_MAX_INPUT: ::c_int = 255;
3297 pub const _POSIX_NAME_MAX: ::c_int = 14;
3298 pub const _POSIX_PIPE_BUF: ::c_int = 512;
3299 pub const _POSIX_SSIZE_MAX: ::c_int = 32767;
3300 pub const _POSIX_STREAM_MAX: ::c_int = 8;
3301 
3302 /// max ibase/obase values in bc(1)
3303 pub const BC_BASE_MAX: ::c_int = 99;
3304 /// max array elements in bc(1)
3305 pub const BC_DIM_MAX: ::c_int = 2048;
3306 /// max scale value in bc(1)
3307 pub const BC_SCALE_MAX: ::c_int = 99;
3308 /// max const string length in bc(1)
3309 pub const BC_STRING_MAX: ::c_int = 1000;
3310 /// max character class name size
3311 pub const CHARCLASS_NAME_MAX: ::c_int = 14;
3312 /// max weights for order keyword
3313 pub const COLL_WEIGHTS_MAX: ::c_int = 10;
3314 /// max expressions nested in expr(1)
3315 pub const EXPR_NEST_MAX: ::c_int = 32;
3316 /// max bytes in an input line
3317 pub const LINE_MAX: ::c_int = 2048;
3318 /// max RE's in interval notation
3319 pub const RE_DUP_MAX: ::c_int = 255;
3320 
3321 pub const _POSIX2_BC_BASE_MAX: ::c_int = 99;
3322 pub const _POSIX2_BC_DIM_MAX: ::c_int = 2048;
3323 pub const _POSIX2_BC_SCALE_MAX: ::c_int = 99;
3324 pub const _POSIX2_BC_STRING_MAX: ::c_int = 1000;
3325 pub const _POSIX2_CHARCLASS_NAME_MAX: ::c_int = 14;
3326 pub const _POSIX2_COLL_WEIGHTS_MAX: ::c_int = 2;
3327 pub const _POSIX2_EQUIV_CLASS_MAX: ::c_int = 2;
3328 pub const _POSIX2_EXPR_NEST_MAX: ::c_int = 32;
3329 pub const _POSIX2_LINE_MAX: ::c_int = 2048;
3330 pub const _POSIX2_RE_DUP_MAX: ::c_int = 255;
3331 
3332 // sys/proc.h
3333 pub const TDF_BORROWING: ::c_int = 0x00000001;
3334 pub const TDF_INPANIC: ::c_int = 0x00000002;
3335 pub const TDF_INMEM: ::c_int = 0x00000004;
3336 pub const TDF_SINTR: ::c_int = 0x00000008;
3337 pub const TDF_TIMEOUT: ::c_int = 0x00000010;
3338 pub const TDF_IDLETD: ::c_int = 0x00000020;
3339 pub const TDF_CANSWAP: ::c_int = 0x00000040;
3340 pub const TDF_KTH_SUSP: ::c_int = 0x00000100;
3341 pub const TDF_ALLPROCSUSP: ::c_int = 0x00000200;
3342 pub const TDF_BOUNDARY: ::c_int = 0x00000400;
3343 pub const TDF_ASTPENDING: ::c_int = 0x00000800;
3344 pub const TDF_SBDRY: ::c_int = 0x00002000;
3345 pub const TDF_UPIBLOCKED: ::c_int = 0x00004000;
3346 pub const TDF_NEEDSUSPCHK: ::c_int = 0x00008000;
3347 pub const TDF_NEEDRESCHED: ::c_int = 0x00010000;
3348 pub const TDF_NEEDSIGCHK: ::c_int = 0x00020000;
3349 pub const TDF_NOLOAD: ::c_int = 0x00040000;
3350 pub const TDF_SERESTART: ::c_int = 0x00080000;
3351 pub const TDF_THRWAKEUP: ::c_int = 0x00100000;
3352 pub const TDF_SEINTR: ::c_int = 0x00200000;
3353 pub const TDF_SWAPINREQ: ::c_int = 0x00400000;
3354 pub const TDF_UNUSED23: ::c_int = 0x00800000;
3355 pub const TDF_SCHED0: ::c_int = 0x01000000;
3356 pub const TDF_SCHED1: ::c_int = 0x02000000;
3357 pub const TDF_SCHED2: ::c_int = 0x04000000;
3358 pub const TDF_SCHED3: ::c_int = 0x08000000;
3359 pub const TDF_ALRMPEND: ::c_int = 0x10000000;
3360 pub const TDF_PROFPEND: ::c_int = 0x20000000;
3361 pub const TDF_MACPEND: ::c_int = 0x40000000;
3362 
3363 pub const TDB_SUSPEND: ::c_int = 0x00000001;
3364 pub const TDB_XSIG: ::c_int = 0x00000002;
3365 pub const TDB_USERWR: ::c_int = 0x00000004;
3366 pub const TDB_SCE: ::c_int = 0x00000008;
3367 pub const TDB_SCX: ::c_int = 0x00000010;
3368 pub const TDB_EXEC: ::c_int = 0x00000020;
3369 pub const TDB_FORK: ::c_int = 0x00000040;
3370 pub const TDB_STOPATFORK: ::c_int = 0x00000080;
3371 pub const TDB_CHILD: ::c_int = 0x00000100;
3372 pub const TDB_BORN: ::c_int = 0x00000200;
3373 pub const TDB_EXIT: ::c_int = 0x00000400;
3374 pub const TDB_VFORK: ::c_int = 0x00000800;
3375 pub const TDB_FSTP: ::c_int = 0x00001000;
3376 pub const TDB_STEP: ::c_int = 0x00002000;
3377 
3378 pub const TDP_OLDMASK: ::c_int = 0x00000001;
3379 pub const TDP_INKTR: ::c_int = 0x00000002;
3380 pub const TDP_INKTRACE: ::c_int = 0x00000004;
3381 pub const TDP_BUFNEED: ::c_int = 0x00000008;
3382 pub const TDP_COWINPROGRESS: ::c_int = 0x00000010;
3383 pub const TDP_ALTSTACK: ::c_int = 0x00000020;
3384 pub const TDP_DEADLKTREAT: ::c_int = 0x00000040;
3385 pub const TDP_NOFAULTING: ::c_int = 0x00000080;
3386 pub const TDP_OWEUPC: ::c_int = 0x00000200;
3387 pub const TDP_ITHREAD: ::c_int = 0x00000400;
3388 pub const TDP_SYNCIO: ::c_int = 0x00000800;
3389 pub const TDP_SCHED1: ::c_int = 0x00001000;
3390 pub const TDP_SCHED2: ::c_int = 0x00002000;
3391 pub const TDP_SCHED3: ::c_int = 0x00004000;
3392 pub const TDP_SCHED4: ::c_int = 0x00008000;
3393 pub const TDP_GEOM: ::c_int = 0x00010000;
3394 pub const TDP_SOFTDEP: ::c_int = 0x00020000;
3395 pub const TDP_NORUNNINGBUF: ::c_int = 0x00040000;
3396 pub const TDP_WAKEUP: ::c_int = 0x00080000;
3397 pub const TDP_INBDFLUSH: ::c_int = 0x00100000;
3398 pub const TDP_KTHREAD: ::c_int = 0x00200000;
3399 pub const TDP_CALLCHAIN: ::c_int = 0x00400000;
3400 pub const TDP_IGNSUSP: ::c_int = 0x00800000;
3401 pub const TDP_AUDITREC: ::c_int = 0x01000000;
3402 pub const TDP_RFPPWAIT: ::c_int = 0x02000000;
3403 pub const TDP_RESETSPUR: ::c_int = 0x04000000;
3404 pub const TDP_NERRNO: ::c_int = 0x08000000;
3405 pub const TDP_EXECVMSPC: ::c_int = 0x40000000;
3406 
3407 pub const TDI_SUSPENDED: ::c_int = 0x0001;
3408 pub const TDI_SLEEPING: ::c_int = 0x0002;
3409 pub const TDI_SWAPPED: ::c_int = 0x0004;
3410 pub const TDI_LOCK: ::c_int = 0x0008;
3411 pub const TDI_IWAIT: ::c_int = 0x0010;
3412 
3413 pub const P_ADVLOCK: ::c_int = 0x00000001;
3414 pub const P_CONTROLT: ::c_int = 0x00000002;
3415 pub const P_KPROC: ::c_int = 0x00000004;
3416 pub const P_UNUSED3: ::c_int = 0x00000008;
3417 pub const P_PPWAIT: ::c_int = 0x00000010;
3418 pub const P_PROFIL: ::c_int = 0x00000020;
3419 pub const P_STOPPROF: ::c_int = 0x00000040;
3420 pub const P_HADTHREADS: ::c_int = 0x00000080;
3421 pub const P_SUGID: ::c_int = 0x00000100;
3422 pub const P_SYSTEM: ::c_int = 0x00000200;
3423 pub const P_SINGLE_EXIT: ::c_int = 0x00000400;
3424 pub const P_TRACED: ::c_int = 0x00000800;
3425 pub const P_WAITED: ::c_int = 0x00001000;
3426 pub const P_WEXIT: ::c_int = 0x00002000;
3427 pub const P_EXEC: ::c_int = 0x00004000;
3428 pub const P_WKILLED: ::c_int = 0x00008000;
3429 pub const P_CONTINUED: ::c_int = 0x00010000;
3430 pub const P_STOPPED_SIG: ::c_int = 0x00020000;
3431 pub const P_STOPPED_TRACE: ::c_int = 0x00040000;
3432 pub const P_STOPPED_SINGLE: ::c_int = 0x00080000;
3433 pub const P_PROTECTED: ::c_int = 0x00100000;
3434 pub const P_SIGEVENT: ::c_int = 0x00200000;
3435 pub const P_SINGLE_BOUNDARY: ::c_int = 0x00400000;
3436 pub const P_HWPMC: ::c_int = 0x00800000;
3437 pub const P_JAILED: ::c_int = 0x01000000;
3438 pub const P_TOTAL_STOP: ::c_int = 0x02000000;
3439 pub const P_INEXEC: ::c_int = 0x04000000;
3440 pub const P_STATCHILD: ::c_int = 0x08000000;
3441 pub const P_INMEM: ::c_int = 0x10000000;
3442 pub const P_SWAPPINGOUT: ::c_int = 0x20000000;
3443 pub const P_SWAPPINGIN: ::c_int = 0x40000000;
3444 pub const P_PPTRACE: ::c_int = 0x80000000;
3445 pub const P_STOPPED: ::c_int = P_STOPPED_SIG | P_STOPPED_SINGLE | P_STOPPED_TRACE;
3446 
3447 pub const P2_INHERIT_PROTECTED: ::c_int = 0x00000001;
3448 pub const P2_NOTRACE: ::c_int = 0x00000002;
3449 pub const P2_NOTRACE_EXEC: ::c_int = 0x00000004;
3450 pub const P2_AST_SU: ::c_int = 0x00000008;
3451 pub const P2_PTRACE_FSTP: ::c_int = 0x00000010;
3452 pub const P2_TRAPCAP: ::c_int = 0x00000020;
3453 pub const P2_STKGAP_DISABLE: ::c_int = 0x00000800;
3454 pub const P2_STKGAP_DISABLE_EXEC: ::c_int = 0x00001000;
3455 
3456 pub const P_TREE_ORPHANED: ::c_int = 0x00000001;
3457 pub const P_TREE_FIRST_ORPHAN: ::c_int = 0x00000002;
3458 pub const P_TREE_REAPER: ::c_int = 0x00000004;
3459 
3460 pub const SIDL: ::c_char = 1;
3461 pub const SRUN: ::c_char = 2;
3462 pub const SSLEEP: ::c_char = 3;
3463 pub const SSTOP: ::c_char = 4;
3464 pub const SZOMB: ::c_char = 5;
3465 pub const SWAIT: ::c_char = 6;
3466 pub const SLOCK: ::c_char = 7;
3467 
3468 pub const P_MAGIC: ::c_int = 0xbeefface;
3469 
3470 pub const TDP_SIGFASTBLOCK: ::c_int = 0x00000100;
3471 pub const TDP_UIOHELD: ::c_int = 0x10000000;
3472 pub const TDP_SIGFASTPENDING: ::c_int = 0x80000000;
3473 pub const TDP2_COMPAT32RB: ::c_int = 0x00000002;
3474 pub const P2_PROTMAX_ENABLE: ::c_int = 0x00000200;
3475 pub const P2_PROTMAX_DISABLE: ::c_int = 0x00000400;
3476 pub const TDP2_SBPAGES: ::c_int = 0x00000001;
3477 pub const P2_ASLR_ENABLE: ::c_int = 0x00000040;
3478 pub const P2_ASLR_DISABLE: ::c_int = 0x00000080;
3479 pub const P2_ASLR_IGNSTART: ::c_int = 0x00000100;
3480 pub const P_TREE_GRPEXITED: ::c_int = 0x00000008;
3481 
3482 // libprocstat.h
3483 pub const PS_FST_VTYPE_VNON: ::c_int = 1;
3484 pub const PS_FST_VTYPE_VREG: ::c_int = 2;
3485 pub const PS_FST_VTYPE_VDIR: ::c_int = 3;
3486 pub const PS_FST_VTYPE_VBLK: ::c_int = 4;
3487 pub const PS_FST_VTYPE_VCHR: ::c_int = 5;
3488 pub const PS_FST_VTYPE_VLNK: ::c_int = 6;
3489 pub const PS_FST_VTYPE_VSOCK: ::c_int = 7;
3490 pub const PS_FST_VTYPE_VFIFO: ::c_int = 8;
3491 pub const PS_FST_VTYPE_VBAD: ::c_int = 9;
3492 pub const PS_FST_VTYPE_UNKNOWN: ::c_int = 255;
3493 
3494 pub const PS_FST_TYPE_VNODE: ::c_int = 1;
3495 pub const PS_FST_TYPE_FIFO: ::c_int = 2;
3496 pub const PS_FST_TYPE_SOCKET: ::c_int = 3;
3497 pub const PS_FST_TYPE_PIPE: ::c_int = 4;
3498 pub const PS_FST_TYPE_PTS: ::c_int = 5;
3499 pub const PS_FST_TYPE_KQUEUE: ::c_int = 6;
3500 pub const PS_FST_TYPE_MQUEUE: ::c_int = 8;
3501 pub const PS_FST_TYPE_SHM: ::c_int = 9;
3502 pub const PS_FST_TYPE_SEM: ::c_int = 10;
3503 pub const PS_FST_TYPE_UNKNOWN: ::c_int = 11;
3504 pub const PS_FST_TYPE_NONE: ::c_int = 12;
3505 pub const PS_FST_TYPE_PROCDESC: ::c_int = 13;
3506 pub const PS_FST_TYPE_DEV: ::c_int = 14;
3507 pub const PS_FST_TYPE_EVENTFD: ::c_int = 15;
3508 
3509 pub const PS_FST_UFLAG_RDIR: ::c_int = 0x0001;
3510 pub const PS_FST_UFLAG_CDIR: ::c_int = 0x0002;
3511 pub const PS_FST_UFLAG_JAIL: ::c_int = 0x0004;
3512 pub const PS_FST_UFLAG_TRACE: ::c_int = 0x0008;
3513 pub const PS_FST_UFLAG_TEXT: ::c_int = 0x0010;
3514 pub const PS_FST_UFLAG_MMAP: ::c_int = 0x0020;
3515 pub const PS_FST_UFLAG_CTTY: ::c_int = 0x0040;
3516 
3517 pub const PS_FST_FFLAG_READ: ::c_int = 0x0001;
3518 pub const PS_FST_FFLAG_WRITE: ::c_int = 0x0002;
3519 pub const PS_FST_FFLAG_NONBLOCK: ::c_int = 0x0004;
3520 pub const PS_FST_FFLAG_APPEND: ::c_int = 0x0008;
3521 pub const PS_FST_FFLAG_SHLOCK: ::c_int = 0x0010;
3522 pub const PS_FST_FFLAG_EXLOCK: ::c_int = 0x0020;
3523 pub const PS_FST_FFLAG_ASYNC: ::c_int = 0x0040;
3524 pub const PS_FST_FFLAG_SYNC: ::c_int = 0x0080;
3525 pub const PS_FST_FFLAG_NOFOLLOW: ::c_int = 0x0100;
3526 pub const PS_FST_FFLAG_CREAT: ::c_int = 0x0200;
3527 pub const PS_FST_FFLAG_TRUNC: ::c_int = 0x0400;
3528 pub const PS_FST_FFLAG_EXCL: ::c_int = 0x0800;
3529 pub const PS_FST_FFLAG_DIRECT: ::c_int = 0x1000;
3530 pub const PS_FST_FFLAG_EXEC: ::c_int = 0x2000;
3531 pub const PS_FST_FFLAG_HASLOCK: ::c_int = 0x4000;
3532 
3533 // sys/mount.h
3534 
3535 /// File identifier.
3536 /// These are unique per filesystem on a single machine.
3537 ///
3538 /// Note that the offset of fid_data is 4 bytes, so care must be taken to avoid
3539 /// undefined behavior accessing unaligned fields within an embedded struct.
3540 pub const MAXFIDSZ: ::c_int = 16;
3541 /// Length of type name including null.
3542 pub const MFSNAMELEN: ::c_int = 16;
3543 cfg_if! {
3544     if #[cfg(any(freebsd10, freebsd11))] {
3545         /// Size of on/from name bufs.
3546         pub const MNAMELEN: ::c_int = 88;
3547     } else {
3548         /// Size of on/from name bufs.
3549         pub const MNAMELEN: ::c_int = 1024;
3550     }
3551 }
3552 
3553 /// Using journaled soft updates.
3554 pub const MNT_SUJ: u64 = 0x100000000;
3555 /// Mounted by automountd(8).
3556 pub const MNT_AUTOMOUNTED: u64 = 0x200000000;
3557 /// Filesys metadata untrusted.
3558 pub const MNT_UNTRUSTED: u64 = 0x800000000;
3559 
3560 /// Require TLS.
3561 pub const MNT_EXTLS: u64 = 0x4000000000;
3562 /// Require TLS with client cert.
3563 pub const MNT_EXTLSCERT: u64 = 0x8000000000;
3564 /// Require TLS with user cert.
3565 pub const MNT_EXTLSCERTUSER: u64 = 0x10000000000;
3566 
3567 /// Filesystem is stored locally.
3568 pub const MNT_LOCAL: u64 = 0x000001000;
3569 /// Quotas are enabled on fs.
3570 pub const MNT_QUOTA: u64 = 0x000002000;
3571 /// Identifies the root fs.
3572 pub const MNT_ROOTFS: u64 = 0x000004000;
3573 /// Mounted by a user.
3574 pub const MNT_USER: u64 = 0x000008000;
3575 /// Do not show entry in df.
3576 pub const MNT_IGNORE: u64 = 0x000800000;
3577 /// Filesystem is verified.
3578 pub const MNT_VERIFIED: u64 = 0x400000000;
3579 
3580 /// Do not cover a mount point.
3581 pub const MNT_NOCOVER: u64 = 0x001000000000;
3582 /// Only mount on empty dir.
3583 pub const MNT_EMPTYDIR: u64 = 0x002000000000;
3584 /// Recursively unmount uppers.
3585 pub const MNT_RECURSE: u64 = 0x100000000000;
3586 /// Unmount in async context.
3587 pub const MNT_DEFERRED: u64 = 0x200000000000;
3588 
3589 /// Get configured filesystems.
3590 pub const VFS_VFSCONF: ::c_int = 0;
3591 /// Generic filesystem information.
3592 pub const VFS_GENERIC: ::c_int = 0;
3593 
3594 /// int: highest defined filesystem type.
3595 pub const VFS_MAXTYPENUM: ::c_int = 1;
3596 /// struct: vfsconf for filesystem given as next argument.
3597 pub const VFS_CONF: ::c_int = 2;
3598 
3599 /// Synchronously wait for I/O to complete.
3600 pub const MNT_WAIT: ::c_int = 1;
3601 /// Start all I/O, but do not wait for it.
3602 pub const MNT_NOWAIT: ::c_int = 2;
3603 /// Push data not written by filesystem syncer.
3604 pub const MNT_LAZY: ::c_int = 3;
3605 /// Suspend file system after sync.
3606 pub const MNT_SUSPEND: ::c_int = 4;
3607 
3608 pub const MAXSECFLAVORS: ::c_int = 5;
3609 
3610 /// Statically compiled into kernel.
3611 pub const VFCF_STATIC: ::c_int = 0x00010000;
3612 /// May get data over the network.
3613 pub const VFCF_NETWORK: ::c_int = 0x00020000;
3614 /// Writes are not implemented.
3615 pub const VFCF_READONLY: ::c_int = 0x00040000;
3616 /// Data does not represent real files.
3617 pub const VFCF_SYNTHETIC: ::c_int = 0x00080000;
3618 /// Aliases some other mounted FS.
3619 pub const VFCF_LOOPBACK: ::c_int = 0x00100000;
3620 /// Stores file names as Unicode.
3621 pub const VFCF_UNICODE: ::c_int = 0x00200000;
3622 /// Can be mounted from within a jail.
3623 pub const VFCF_JAIL: ::c_int = 0x00400000;
3624 /// Supports delegated administration.
3625 pub const VFCF_DELEGADMIN: ::c_int = 0x00800000;
3626 /// Stop at Boundary: defer stop requests to kernel->user (AST) transition.
3627 pub const VFCF_SBDRY: ::c_int = 0x01000000;
3628 
3629 // time.h
3630 
3631 /// not on dst
3632 pub const DST_NONE: ::c_int = 0;
3633 /// USA style dst
3634 pub const DST_USA: ::c_int = 1;
3635 /// Australian style dst
3636 pub const DST_AUST: ::c_int = 2;
3637 /// Western European dst
3638 pub const DST_WET: ::c_int = 3;
3639 /// Middle European dst
3640 pub const DST_MET: ::c_int = 4;
3641 /// Eastern European dst
3642 pub const DST_EET: ::c_int = 5;
3643 /// Canada
3644 pub const DST_CAN: ::c_int = 6;
3645 
3646 pub const CPUCLOCK_WHICH_PID: ::c_int = 0;
3647 pub const CPUCLOCK_WHICH_TID: ::c_int = 1;
3648 
3649 pub const MFD_CLOEXEC: ::c_uint = 0x00000001;
3650 pub const MFD_ALLOW_SEALING: ::c_uint = 0x00000002;
3651 pub const MFD_HUGETLB: ::c_uint = 0x00000004;
3652 
3653 pub const SHM_LARGEPAGE_ALLOC_DEFAULT: ::c_int = 0;
3654 pub const SHM_LARGEPAGE_ALLOC_NOWAIT: ::c_int = 1;
3655 pub const SHM_LARGEPAGE_ALLOC_HARD: ::c_int = 2;
3656 pub const SHM_RENAME_NOREPLACE: ::c_int = 1 << 0;
3657 pub const SHM_RENAME_EXCHANGE: ::c_int = 1 << 1;
3658 
3659 const_fn! {
3660     {const} fn _ALIGN(p: usize) -> usize {
3661         (p + _ALIGNBYTES) & !_ALIGNBYTES
3662     }
3663 }
3664 
3665 f! {
3666     pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar {
3667         (cmsg as *mut ::c_uchar)
3668             .offset(_ALIGN(::mem::size_of::<::cmsghdr>()) as isize)
3669     }
3670 
3671     pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
3672         _ALIGN(::mem::size_of::<::cmsghdr>()) as ::c_uint + length
3673     }
3674 
3675     pub fn CMSG_NXTHDR(mhdr: *const ::msghdr, cmsg: *const ::cmsghdr)
3676         -> *mut ::cmsghdr
3677     {
3678         if cmsg.is_null() {
3679             return ::CMSG_FIRSTHDR(mhdr);
3680         };
3681         let next = cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize)
3682             + _ALIGN(::mem::size_of::<::cmsghdr>());
3683         let max = (*mhdr).msg_control as usize
3684             + (*mhdr).msg_controllen as usize;
3685         if next > max {
3686             0 as *mut ::cmsghdr
3687         } else {
3688             (cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize))
3689                 as *mut ::cmsghdr
3690         }
3691     }
3692 
3693     pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {
3694         (_ALIGN(::mem::size_of::<::cmsghdr>()) + _ALIGN(length as usize))
3695             as ::c_uint
3696     }
3697 
3698     pub fn MALLOCX_ALIGN(lg: ::c_uint) -> ::c_int {
3699         ffsl(lg as ::c_long - 1)
3700     }
3701 
3702     pub {const} fn MALLOCX_TCACHE(tc: ::c_int) -> ::c_int {
3703         (tc + 2) << 8 as ::c_int
3704     }
3705 
3706     pub {const} fn MALLOCX_ARENA(a: ::c_int) -> ::c_int {
3707         (a + 1) << 20 as ::c_int
3708     }
3709 
3710     pub fn SOCKCREDSIZE(ngrps: usize) -> usize {
3711         let ngrps = if ngrps > 0 {
3712             ngrps - 1
3713         } else {
3714             0
3715         };
3716         ::mem::size_of::<sockcred>() + ::mem::size_of::<::gid_t>() * ngrps
3717     }
3718 
3719     pub fn uname(buf: *mut ::utsname) -> ::c_int {
3720         __xuname(256, buf as *mut ::c_void)
3721     }
3722 
3723     pub fn CPU_ZERO(cpuset: &mut cpuset_t) -> () {
3724         for slot in cpuset.__bits.iter_mut() {
3725             *slot = 0;
3726         }
3727     }
3728 
3729     pub fn CPU_FILL(cpuset: &mut cpuset_t) -> () {
3730         for slot in cpuset.__bits.iter_mut() {
3731             *slot = !0;
3732         }
3733     }
3734 
3735     pub fn CPU_SET(cpu: usize, cpuset: &mut cpuset_t) -> () {
3736         let bitset_bits = ::mem::size_of::<::c_long>();
3737         let (idx, offset) = (cpu / bitset_bits, cpu % bitset_bits);
3738         cpuset.__bits[idx] |= 1 << offset;
3739         ()
3740     }
3741 
3742     pub fn CPU_CLR(cpu: usize, cpuset: &mut cpuset_t) -> () {
3743         let bitset_bits = ::mem::size_of::<::c_long>();
3744         let (idx, offset) = (cpu / bitset_bits, cpu % bitset_bits);
3745         cpuset.__bits[idx] &= !(1 << offset);
3746         ()
3747     }
3748 
3749     pub fn CPU_ISSET(cpu: usize, cpuset: &cpuset_t) -> bool {
3750         let bitset_bits = ::mem::size_of::<::c_long>();
3751         let (idx, offset) = (cpu / bitset_bits, cpu % bitset_bits);
3752         0 != cpuset.__bits[idx] & (1 << offset)
3753     }
3754 
3755     pub fn CPU_COUNT(cpuset: &cpuset_t) -> ::c_int {
3756         let mut s: u32 = 0;
3757         let cpuset_size = ::mem::size_of::<cpuset_t>();
3758         let bitset_bits = ::mem::size_of::<::c_long>();
3759 
3760         for i in cpuset.__bits[..(cpuset_size / bitset_bits)].iter() {
3761             s += i.count_ones();
3762         };
3763         s as ::c_int
3764     }
3765 
3766     pub fn SOCKCRED2SIZE(ngrps: usize) -> usize {
3767         let ngrps = if ngrps > 0 {
3768             ngrps - 1
3769         } else {
3770             0
3771         };
3772         ::mem::size_of::<sockcred2>() + ::mem::size_of::<::gid_t>() * ngrps
3773     }
3774 }
3775 
3776 safe_f! {
3777     pub {const} fn WIFSIGNALED(status: ::c_int) -> bool {
3778         (status & 0o177) != 0o177 && (status & 0o177) != 0 && status != 0x13
3779     }
3780 }
3781 
3782 cfg_if! {
3783     if #[cfg(not(any(freebsd10, freebsd11)))] {
3784         extern "C" {
3785             pub fn fhlink(fhp: *mut fhandle_t, to: *const ::c_char) -> ::c_int;
3786             pub fn fhlinkat(fhp: *mut fhandle_t, tofd: ::c_int, to: *const ::c_char) -> ::c_int;
3787             pub fn fhreadlink(
3788                 fhp: *mut fhandle_t,
3789                 buf: *mut ::c_char,
3790                 bufsize: ::size_t,
3791             ) -> ::c_int;
3792             pub fn getfhat(
3793                 fd: ::c_int,
3794                 path: *mut ::c_char,
3795                 fhp: *mut fhandle,
3796                 flag: ::c_int,
3797             ) -> ::c_int;
3798         }
3799     }
3800 }
3801 
3802 extern "C" {
__error() -> *mut ::c_int3803     pub fn __error() -> *mut ::c_int;
3804 
aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int3805     pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
aio_error(aiocbp: *const aiocb) -> ::c_int3806     pub fn aio_error(aiocbp: *const aiocb) -> ::c_int;
aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int3807     pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
aio_read(aiocbp: *mut aiocb) -> ::c_int3808     pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int;
aio_return(aiocbp: *mut aiocb) -> ::ssize_t3809     pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t;
aio_suspend( aiocb_list: *const *const aiocb, nitems: ::c_int, timeout: *const ::timespec, ) -> ::c_int3810     pub fn aio_suspend(
3811         aiocb_list: *const *const aiocb,
3812         nitems: ::c_int,
3813         timeout: *const ::timespec,
3814     ) -> ::c_int;
aio_write(aiocbp: *mut aiocb) -> ::c_int3815     pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
3816 
devname_r( dev: ::dev_t, mode: ::mode_t, buf: *mut ::c_char, len: ::c_int, ) -> *mut ::c_char3817     pub fn devname_r(
3818         dev: ::dev_t,
3819         mode: ::mode_t,
3820         buf: *mut ::c_char,
3821         len: ::c_int,
3822     ) -> *mut ::c_char;
3823 
extattr_delete_fd( fd: ::c_int, attrnamespace: ::c_int, attrname: *const ::c_char, ) -> ::c_int3824     pub fn extattr_delete_fd(
3825         fd: ::c_int,
3826         attrnamespace: ::c_int,
3827         attrname: *const ::c_char,
3828     ) -> ::c_int;
extattr_delete_file( path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char, ) -> ::c_int3829     pub fn extattr_delete_file(
3830         path: *const ::c_char,
3831         attrnamespace: ::c_int,
3832         attrname: *const ::c_char,
3833     ) -> ::c_int;
extattr_delete_link( path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char, ) -> ::c_int3834     pub fn extattr_delete_link(
3835         path: *const ::c_char,
3836         attrnamespace: ::c_int,
3837         attrname: *const ::c_char,
3838     ) -> ::c_int;
extattr_get_fd( fd: ::c_int, attrnamespace: ::c_int, attrname: *const ::c_char, data: *mut ::c_void, nbytes: ::size_t, ) -> ::ssize_t3839     pub fn extattr_get_fd(
3840         fd: ::c_int,
3841         attrnamespace: ::c_int,
3842         attrname: *const ::c_char,
3843         data: *mut ::c_void,
3844         nbytes: ::size_t,
3845     ) -> ::ssize_t;
extattr_get_file( path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char, data: *mut ::c_void, nbytes: ::size_t, ) -> ::ssize_t3846     pub fn extattr_get_file(
3847         path: *const ::c_char,
3848         attrnamespace: ::c_int,
3849         attrname: *const ::c_char,
3850         data: *mut ::c_void,
3851         nbytes: ::size_t,
3852     ) -> ::ssize_t;
extattr_get_link( path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char, data: *mut ::c_void, nbytes: ::size_t, ) -> ::ssize_t3853     pub fn extattr_get_link(
3854         path: *const ::c_char,
3855         attrnamespace: ::c_int,
3856         attrname: *const ::c_char,
3857         data: *mut ::c_void,
3858         nbytes: ::size_t,
3859     ) -> ::ssize_t;
extattr_list_fd( fd: ::c_int, attrnamespace: ::c_int, data: *mut ::c_void, nbytes: ::size_t, ) -> ::ssize_t3860     pub fn extattr_list_fd(
3861         fd: ::c_int,
3862         attrnamespace: ::c_int,
3863         data: *mut ::c_void,
3864         nbytes: ::size_t,
3865     ) -> ::ssize_t;
extattr_list_file( path: *const ::c_char, attrnamespace: ::c_int, data: *mut ::c_void, nbytes: ::size_t, ) -> ::ssize_t3866     pub fn extattr_list_file(
3867         path: *const ::c_char,
3868         attrnamespace: ::c_int,
3869         data: *mut ::c_void,
3870         nbytes: ::size_t,
3871     ) -> ::ssize_t;
extattr_list_link( path: *const ::c_char, attrnamespace: ::c_int, data: *mut ::c_void, nbytes: ::size_t, ) -> ::ssize_t3872     pub fn extattr_list_link(
3873         path: *const ::c_char,
3874         attrnamespace: ::c_int,
3875         data: *mut ::c_void,
3876         nbytes: ::size_t,
3877     ) -> ::ssize_t;
extattr_set_fd( fd: ::c_int, attrnamespace: ::c_int, attrname: *const ::c_char, data: *const ::c_void, nbytes: ::size_t, ) -> ::ssize_t3878     pub fn extattr_set_fd(
3879         fd: ::c_int,
3880         attrnamespace: ::c_int,
3881         attrname: *const ::c_char,
3882         data: *const ::c_void,
3883         nbytes: ::size_t,
3884     ) -> ::ssize_t;
extattr_set_file( path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char, data: *const ::c_void, nbytes: ::size_t, ) -> ::ssize_t3885     pub fn extattr_set_file(
3886         path: *const ::c_char,
3887         attrnamespace: ::c_int,
3888         attrname: *const ::c_char,
3889         data: *const ::c_void,
3890         nbytes: ::size_t,
3891     ) -> ::ssize_t;
extattr_set_link( path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char, data: *const ::c_void, nbytes: ::size_t, ) -> ::ssize_t3892     pub fn extattr_set_link(
3893         path: *const ::c_char,
3894         attrnamespace: ::c_int,
3895         attrname: *const ::c_char,
3896         data: *const ::c_void,
3897         nbytes: ::size_t,
3898     ) -> ::ssize_t;
3899 
fspacectl( fd: ::c_int, cmd: ::c_int, rqsr: *const spacectl_range, flags: ::c_int, rmsr: *mut spacectl_range, ) -> ::c_int3900     pub fn fspacectl(
3901         fd: ::c_int,
3902         cmd: ::c_int,
3903         rqsr: *const spacectl_range,
3904         flags: ::c_int,
3905         rmsr: *mut spacectl_range,
3906     ) -> ::c_int;
3907 
jail(jail: *mut ::jail) -> ::c_int3908     pub fn jail(jail: *mut ::jail) -> ::c_int;
jail_attach(jid: ::c_int) -> ::c_int3909     pub fn jail_attach(jid: ::c_int) -> ::c_int;
jail_remove(jid: ::c_int) -> ::c_int3910     pub fn jail_remove(jid: ::c_int) -> ::c_int;
jail_get(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int3911     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_int3912     pub fn jail_set(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int;
3913 
lio_listio( mode: ::c_int, aiocb_list: *const *mut aiocb, nitems: ::c_int, sevp: *mut sigevent, ) -> ::c_int3914     pub fn lio_listio(
3915         mode: ::c_int,
3916         aiocb_list: *const *mut aiocb,
3917         nitems: ::c_int,
3918         sevp: *mut sigevent,
3919     ) -> ::c_int;
3920 
mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int3921     pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int;
mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int3922     pub fn mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int;
3923 
getutxuser(user: *const ::c_char) -> *mut utmpx3924     pub fn getutxuser(user: *const ::c_char) -> *mut utmpx;
setutxdb(_type: ::c_int, file: *const ::c_char) -> ::c_int3925     pub fn setutxdb(_type: ::c_int, file: *const ::c_char) -> ::c_int;
3926 
aio_waitcomplete(iocbp: *mut *mut aiocb, timeout: *mut ::timespec) -> ::ssize_t3927     pub fn aio_waitcomplete(iocbp: *mut *mut aiocb, timeout: *mut ::timespec) -> ::ssize_t;
mq_getfd_np(mqd: ::mqd_t) -> ::c_int3928     pub fn mq_getfd_np(mqd: ::mqd_t) -> ::c_int;
3929 
waitid( idtype: idtype_t, id: ::id_t, infop: *mut ::siginfo_t, options: ::c_int, ) -> ::c_int3930     pub fn waitid(
3931         idtype: idtype_t,
3932         id: ::id_t,
3933         infop: *mut ::siginfo_t,
3934         options: ::c_int,
3935     ) -> ::c_int;
3936 
ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t3937     pub fn ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t;
shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int3938     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_void3939     pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void;
shmdt(shmaddr: *const ::c_void) -> ::c_int3940     pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int;
shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int3941     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_int3942     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_int3943     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_int3944     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_int3945     pub fn msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut ::msqid_ds) -> ::c_int;
msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int3946     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_int3947     pub fn msgsnd(
3948         msqid: ::c_int,
3949         msgp: *const ::c_void,
3950         msgsz: ::size_t,
3951         msgflg: ::c_int,
3952     ) -> ::c_int;
cfmakesane(termios: *mut ::termios)3953     pub fn cfmakesane(termios: *mut ::termios);
3954 
pdfork(fdp: *mut ::c_int, flags: ::c_int) -> ::pid_t3955     pub fn pdfork(fdp: *mut ::c_int, flags: ::c_int) -> ::pid_t;
pdgetpid(fd: ::c_int, pidp: *mut ::pid_t) -> ::c_int3956     pub fn pdgetpid(fd: ::c_int, pidp: *mut ::pid_t) -> ::c_int;
pdkill(fd: ::c_int, signum: ::c_int) -> ::c_int3957     pub fn pdkill(fd: ::c_int, signum: ::c_int) -> ::c_int;
3958 
rtprio_thread(function: ::c_int, lwpid: ::lwpid_t, rtp: *mut super::rtprio) -> ::c_int3959     pub fn rtprio_thread(function: ::c_int, lwpid: ::lwpid_t, rtp: *mut super::rtprio) -> ::c_int;
3960 
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_int3961     pub fn posix_spawn(
3962         pid: *mut ::pid_t,
3963         path: *const ::c_char,
3964         file_actions: *const ::posix_spawn_file_actions_t,
3965         attrp: *const ::posix_spawnattr_t,
3966         argv: *const *mut ::c_char,
3967         envp: *const *mut ::c_char,
3968     ) -> ::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_int3969     pub fn posix_spawnp(
3970         pid: *mut ::pid_t,
3971         file: *const ::c_char,
3972         file_actions: *const ::posix_spawn_file_actions_t,
3973         attrp: *const ::posix_spawnattr_t,
3974         argv: *const *mut ::c_char,
3975         envp: *const *mut ::c_char,
3976     ) -> ::c_int;
posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int3977     pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int;
posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int3978     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_int3979     pub fn posix_spawnattr_getsigdefault(
3980         attr: *const posix_spawnattr_t,
3981         default: *mut ::sigset_t,
3982     ) -> ::c_int;
posix_spawnattr_setsigdefault( attr: *mut posix_spawnattr_t, default: *const ::sigset_t, ) -> ::c_int3983     pub fn posix_spawnattr_setsigdefault(
3984         attr: *mut posix_spawnattr_t,
3985         default: *const ::sigset_t,
3986     ) -> ::c_int;
posix_spawnattr_getsigmask( attr: *const posix_spawnattr_t, default: *mut ::sigset_t, ) -> ::c_int3987     pub fn posix_spawnattr_getsigmask(
3988         attr: *const posix_spawnattr_t,
3989         default: *mut ::sigset_t,
3990     ) -> ::c_int;
posix_spawnattr_setsigmask( attr: *mut posix_spawnattr_t, default: *const ::sigset_t, ) -> ::c_int3991     pub fn posix_spawnattr_setsigmask(
3992         attr: *mut posix_spawnattr_t,
3993         default: *const ::sigset_t,
3994     ) -> ::c_int;
posix_spawnattr_getflags( attr: *const posix_spawnattr_t, flags: *mut ::c_short, ) -> ::c_int3995     pub fn posix_spawnattr_getflags(
3996         attr: *const posix_spawnattr_t,
3997         flags: *mut ::c_short,
3998     ) -> ::c_int;
posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int3999     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_int4000     pub fn posix_spawnattr_getpgroup(
4001         attr: *const posix_spawnattr_t,
4002         flags: *mut ::pid_t,
4003     ) -> ::c_int;
posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int4004     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_int4005     pub fn posix_spawnattr_getschedpolicy(
4006         attr: *const posix_spawnattr_t,
4007         flags: *mut ::c_int,
4008     ) -> ::c_int;
posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: ::c_int) -> ::c_int4009     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_int4010     pub fn posix_spawnattr_getschedparam(
4011         attr: *const posix_spawnattr_t,
4012         param: *mut ::sched_param,
4013     ) -> ::c_int;
posix_spawnattr_setschedparam( attr: *mut posix_spawnattr_t, param: *const ::sched_param, ) -> ::c_int4014     pub fn posix_spawnattr_setschedparam(
4015         attr: *mut posix_spawnattr_t,
4016         param: *const ::sched_param,
4017     ) -> ::c_int;
4018 
posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> ::c_int4019     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_int4020     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_int4021     pub fn posix_spawn_file_actions_addopen(
4022         actions: *mut posix_spawn_file_actions_t,
4023         fd: ::c_int,
4024         path: *const ::c_char,
4025         oflag: ::c_int,
4026         mode: ::mode_t,
4027     ) -> ::c_int;
posix_spawn_file_actions_addclose( actions: *mut posix_spawn_file_actions_t, fd: ::c_int, ) -> ::c_int4028     pub fn posix_spawn_file_actions_addclose(
4029         actions: *mut posix_spawn_file_actions_t,
4030         fd: ::c_int,
4031     ) -> ::c_int;
posix_spawn_file_actions_adddup2( actions: *mut posix_spawn_file_actions_t, fd: ::c_int, newfd: ::c_int, ) -> ::c_int4032     pub fn posix_spawn_file_actions_adddup2(
4033         actions: *mut posix_spawn_file_actions_t,
4034         fd: ::c_int,
4035         newfd: ::c_int,
4036     ) -> ::c_int;
4037 
uuidgen(store: *mut uuid, count: ::c_int) -> ::c_int4038     pub fn uuidgen(store: *mut uuid, count: ::c_int) -> ::c_int;
4039 
thr_kill(id: ::c_long, sig: ::c_int) -> ::c_int4040     pub fn thr_kill(id: ::c_long, sig: ::c_int) -> ::c_int;
thr_kill2(pid: ::pid_t, id: ::c_long, sig: ::c_int) -> ::c_int4041     pub fn thr_kill2(pid: ::pid_t, id: ::c_long, sig: ::c_int) -> ::c_int;
thr_self(tid: *mut ::c_long) -> ::c_int4042     pub fn thr_self(tid: *mut ::c_long) -> ::c_int;
pthread_getthreadid_np() -> ::c_int4043     pub fn pthread_getthreadid_np() -> ::c_int;
pthread_getaffinity_np( td: ::pthread_t, cpusetsize: ::size_t, cpusetp: *mut cpuset_t, ) -> ::c_int4044     pub fn pthread_getaffinity_np(
4045         td: ::pthread_t,
4046         cpusetsize: ::size_t,
4047         cpusetp: *mut cpuset_t,
4048     ) -> ::c_int;
pthread_setaffinity_np( td: ::pthread_t, cpusetsize: ::size_t, cpusetp: *const cpuset_t, ) -> ::c_int4049     pub fn pthread_setaffinity_np(
4050         td: ::pthread_t,
4051         cpusetsize: ::size_t,
4052         cpusetp: *const cpuset_t,
4053     ) -> ::c_int;
4054 
4055     // sched.h linux compatibility api
sched_getaffinity(pid: ::pid_t, cpusetsz: ::size_t, cpuset: *mut ::cpuset_t) -> ::c_int4056     pub fn sched_getaffinity(pid: ::pid_t, cpusetsz: ::size_t, cpuset: *mut ::cpuset_t) -> ::c_int;
sched_setaffinity( pid: ::pid_t, cpusetsz: ::size_t, cpuset: *const ::cpuset_t, ) -> ::c_int4057     pub fn sched_setaffinity(
4058         pid: ::pid_t,
4059         cpusetsz: ::size_t,
4060         cpuset: *const ::cpuset_t,
4061     ) -> ::c_int;
sched_getcpu() -> ::c_int4062     pub fn sched_getcpu() -> ::c_int;
4063 
pthread_mutex_consistent(mutex: *mut ::pthread_mutex_t) -> ::c_int4064     pub fn pthread_mutex_consistent(mutex: *mut ::pthread_mutex_t) -> ::c_int;
4065 
pthread_mutexattr_getrobust( attr: *mut ::pthread_mutexattr_t, robust: *mut ::c_int, ) -> ::c_int4066     pub fn pthread_mutexattr_getrobust(
4067         attr: *mut ::pthread_mutexattr_t,
4068         robust: *mut ::c_int,
4069     ) -> ::c_int;
pthread_mutexattr_setrobust( attr: *mut ::pthread_mutexattr_t, robust: ::c_int, ) -> ::c_int4070     pub fn pthread_mutexattr_setrobust(
4071         attr: *mut ::pthread_mutexattr_t,
4072         robust: ::c_int,
4073     ) -> ::c_int;
4074 
pthread_spin_init(lock: *mut pthread_spinlock_t, pshared: ::c_int) -> ::c_int4075     pub fn pthread_spin_init(lock: *mut pthread_spinlock_t, pshared: ::c_int) -> ::c_int;
pthread_spin_destroy(lock: *mut pthread_spinlock_t) -> ::c_int4076     pub fn pthread_spin_destroy(lock: *mut pthread_spinlock_t) -> ::c_int;
pthread_spin_lock(lock: *mut pthread_spinlock_t) -> ::c_int4077     pub fn pthread_spin_lock(lock: *mut pthread_spinlock_t) -> ::c_int;
pthread_spin_trylock(lock: *mut pthread_spinlock_t) -> ::c_int4078     pub fn pthread_spin_trylock(lock: *mut pthread_spinlock_t) -> ::c_int;
pthread_spin_unlock(lock: *mut pthread_spinlock_t) -> ::c_int4079     pub fn pthread_spin_unlock(lock: *mut pthread_spinlock_t) -> ::c_int;
4080 
4081     #[cfg_attr(all(target_os = "freebsd", freebsd11), link_name = "statfs@FBSD_1.0")]
statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int4082     pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
4083     #[cfg_attr(all(target_os = "freebsd", freebsd11), link_name = "fstatfs@FBSD_1.0")]
fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int4084     pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
4085 
dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int4086     pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int;
__xuname(nmln: ::c_int, buf: *mut ::c_void) -> ::c_int4087     pub fn __xuname(nmln: ::c_int, buf: *mut ::c_void) -> ::c_int;
4088 
sendmmsg( sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::size_t, flags: ::c_int, ) -> ::ssize_t4089     pub fn sendmmsg(
4090         sockfd: ::c_int,
4091         msgvec: *mut ::mmsghdr,
4092         vlen: ::size_t,
4093         flags: ::c_int,
4094     ) -> ::ssize_t;
recvmmsg( sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::size_t, flags: ::c_int, timeout: *const ::timespec, ) -> ::ssize_t4095     pub fn recvmmsg(
4096         sockfd: ::c_int,
4097         msgvec: *mut ::mmsghdr,
4098         vlen: ::size_t,
4099         flags: ::c_int,
4100         timeout: *const ::timespec,
4101     ) -> ::ssize_t;
memmem( haystack: *const ::c_void, haystacklen: ::size_t, needle: *const ::c_void, needlelen: ::size_t, ) -> *mut ::c_void4102     pub fn memmem(
4103         haystack: *const ::c_void,
4104         haystacklen: ::size_t,
4105         needle: *const ::c_void,
4106         needlelen: ::size_t,
4107     ) -> *mut ::c_void;
4108 
fhopen(fhp: *const fhandle_t, flags: ::c_int) -> ::c_int4109     pub fn fhopen(fhp: *const fhandle_t, flags: ::c_int) -> ::c_int;
fhstat(fhp: *const fhandle, buf: *mut ::stat) -> ::c_int4110     pub fn fhstat(fhp: *const fhandle, buf: *mut ::stat) -> ::c_int;
fhstatfs(fhp: *const fhandle_t, buf: *mut ::statfs) -> ::c_int4111     pub fn fhstatfs(fhp: *const fhandle_t, buf: *mut ::statfs) -> ::c_int;
getfh(path: *const ::c_char, fhp: *mut fhandle_t) -> ::c_int4112     pub fn getfh(path: *const ::c_char, fhp: *mut fhandle_t) -> ::c_int;
lgetfh(path: *const ::c_char, fhp: *mut fhandle_t) -> ::c_int4113     pub fn lgetfh(path: *const ::c_char, fhp: *mut fhandle_t) -> ::c_int;
getfsstat(buf: *mut ::statfs, bufsize: ::c_long, mode: ::c_int) -> ::c_int4114     pub fn getfsstat(buf: *mut ::statfs, bufsize: ::c_long, mode: ::c_int) -> ::c_int;
4115     #[cfg_attr(
4116         all(target_os = "freebsd", freebsd11),
4117         link_name = "getmntinfo@FBSD_1.0"
4118     )]
getmntinfo(mntbufp: *mut *mut ::statfs, mode: ::c_int) -> ::c_int4119     pub fn getmntinfo(mntbufp: *mut *mut ::statfs, mode: ::c_int) -> ::c_int;
mount( type_: *const ::c_char, dir: *const ::c_char, flags: ::c_int, data: *mut ::c_void, ) -> ::c_int4120     pub fn mount(
4121         type_: *const ::c_char,
4122         dir: *const ::c_char,
4123         flags: ::c_int,
4124         data: *mut ::c_void,
4125     ) -> ::c_int;
nmount(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int4126     pub fn nmount(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int;
4127 
setproctitle(fmt: *const ::c_char, ...)4128     pub fn setproctitle(fmt: *const ::c_char, ...);
rfork(flags: ::c_int) -> ::c_int4129     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_int4130     pub fn cpuset_getaffinity(
4131         level: cpulevel_t,
4132         which: cpuwhich_t,
4133         id: ::id_t,
4134         setsize: ::size_t,
4135         mask: *mut cpuset_t,
4136     ) -> ::c_int;
cpuset_setaffinity( level: cpulevel_t, which: cpuwhich_t, id: ::id_t, setsize: ::size_t, mask: *const cpuset_t, ) -> ::c_int4137     pub fn cpuset_setaffinity(
4138         level: cpulevel_t,
4139         which: cpuwhich_t,
4140         id: ::id_t,
4141         setsize: ::size_t,
4142         mask: *const cpuset_t,
4143     ) -> ::c_int;
cap_enter() -> ::c_int4144     pub fn cap_enter() -> ::c_int;
cap_getmode(modep: *mut ::c_uint) -> ::c_int4145     pub fn cap_getmode(modep: *mut ::c_uint) -> ::c_int;
__cap_rights_init(version: ::c_int, rights: *mut cap_rights_t, ...) -> *mut cap_rights_t4146     pub fn __cap_rights_init(version: ::c_int, rights: *mut cap_rights_t, ...)
4147         -> *mut cap_rights_t;
__cap_rights_set(rights: *mut cap_rights_t, ...) -> *mut cap_rights_t4148     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_t4149     pub fn __cap_rights_clear(rights: *mut cap_rights_t, ...) -> *mut cap_rights_t;
__cap_rights_is_set(rights: *const cap_rights_t, ...) -> bool4150     pub fn __cap_rights_is_set(rights: *const cap_rights_t, ...) -> bool;
cap_rights_is_valid(rights: *const cap_rights_t) -> bool4151     pub fn cap_rights_is_valid(rights: *const cap_rights_t) -> bool;
cap_rights_limit(fd: ::c_int, rights: *const cap_rights_t) -> ::c_int4152     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_t4153     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_t4154     pub fn cap_rights_remove(dst: *mut cap_rights_t, src: *const cap_rights_t)
4155         -> *mut cap_rights_t;
cap_rights_contains(big: *const cap_rights_t, little: *const cap_rights_t) -> bool4156     pub fn cap_rights_contains(big: *const cap_rights_t, little: *const cap_rights_t) -> bool;
4157 
reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void4158     pub fn reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void;
4159 
ffs(value: ::c_int) -> ::c_int4160     pub fn ffs(value: ::c_int) -> ::c_int;
ffsl(value: ::c_long) -> ::c_int4161     pub fn ffsl(value: ::c_long) -> ::c_int;
ffsll(value: ::c_longlong) -> ::c_int4162     pub fn ffsll(value: ::c_longlong) -> ::c_int;
fls(value: ::c_int) -> ::c_int4163     pub fn fls(value: ::c_int) -> ::c_int;
flsl(value: ::c_long) -> ::c_int4164     pub fn flsl(value: ::c_long) -> ::c_int;
flsll(value: ::c_longlong) -> ::c_int4165     pub fn flsll(value: ::c_longlong) -> ::c_int;
malloc_usable_size(ptr: *const ::c_void) -> ::size_t4166     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, )4167     pub fn malloc_stats_print(
4168         write_cb: unsafe extern "C" fn(*mut ::c_void, *const ::c_char),
4169         cbopaque: *mut ::c_void,
4170         opt: *const ::c_char,
4171     );
mallctl( name: *const ::c_char, oldp: *mut ::c_void, oldlenp: *mut ::size_t, newp: *mut ::c_void, newlen: ::size_t, ) -> ::c_int4172     pub fn mallctl(
4173         name: *const ::c_char,
4174         oldp: *mut ::c_void,
4175         oldlenp: *mut ::size_t,
4176         newp: *mut ::c_void,
4177         newlen: ::size_t,
4178     ) -> ::c_int;
mallctlnametomib( name: *const ::c_char, mibp: *mut ::size_t, miplen: *mut ::size_t, ) -> ::c_int4179     pub fn mallctlnametomib(
4180         name: *const ::c_char,
4181         mibp: *mut ::size_t,
4182         miplen: *mut ::size_t,
4183     ) -> ::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_int4184     pub fn mallctlbymib(
4185         mib: *const ::size_t,
4186         mible: ::size_t,
4187         oldp: *mut ::c_void,
4188         oldlenp: *mut ::size_t,
4189         newp: *mut ::c_void,
4190         newlen: ::size_t,
4191     ) -> ::c_int;
mallocx(size: ::size_t, flags: ::c_int) -> *mut ::c_void4192     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_void4193     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_t4194     pub fn xallocx(ptr: *mut ::c_void, size: ::size_t, extra: ::size_t, flags: ::c_int)
4195         -> ::size_t;
sallocx(ptr: *const ::c_void, flags: ::c_int) -> ::size_t4196     pub fn sallocx(ptr: *const ::c_void, flags: ::c_int) -> ::size_t;
dallocx(ptr: *mut ::c_void, flags: ::c_int)4197     pub fn dallocx(ptr: *mut ::c_void, flags: ::c_int);
sdallocx(ptr: *mut ::c_void, size: ::size_t, flags: ::c_int)4198     pub fn sdallocx(ptr: *mut ::c_void, size: ::size_t, flags: ::c_int);
nallocx(size: ::size_t, flags: ::c_int) -> ::size_t4199     pub fn nallocx(size: ::size_t, flags: ::c_int) -> ::size_t;
4200 
procctl(idtype: ::idtype_t, id: ::id_t, cmd: ::c_int, data: *mut ::c_void) -> ::c_int4201     pub fn procctl(idtype: ::idtype_t, id: ::id_t, cmd: ::c_int, data: *mut ::c_void) -> ::c_int;
4202 
getpagesize() -> ::c_int4203     pub fn getpagesize() -> ::c_int;
getpagesizes(pagesize: *mut ::size_t, nelem: ::c_int) -> ::c_int4204     pub fn getpagesizes(pagesize: *mut ::size_t, nelem: ::c_int) -> ::c_int;
4205 
adjtime(arg1: *const ::timeval, arg2: *mut ::timeval) -> ::c_int4206     pub fn adjtime(arg1: *const ::timeval, arg2: *mut ::timeval) -> ::c_int;
clock_getcpuclockid2(arg1: ::id_t, arg2: ::c_int, arg3: *mut clockid_t) -> ::c_int4207     pub fn clock_getcpuclockid2(arg1: ::id_t, arg2: ::c_int, arg3: *mut clockid_t) -> ::c_int;
4208 
shm_create_largepage( path: *const ::c_char, flags: ::c_int, psind: ::c_int, alloc_policy: ::c_int, mode: ::mode_t, ) -> ::c_int4209     pub fn shm_create_largepage(
4210         path: *const ::c_char,
4211         flags: ::c_int,
4212         psind: ::c_int,
4213         alloc_policy: ::c_int,
4214         mode: ::mode_t,
4215     ) -> ::c_int;
shm_rename( path_from: *const ::c_char, path_to: *const ::c_char, flags: ::c_int, ) -> ::c_int4216     pub fn shm_rename(
4217         path_from: *const ::c_char,
4218         path_to: *const ::c_char,
4219         flags: ::c_int,
4220     ) -> ::c_int;
memfd_create(name: *const ::c_char, flags: ::c_uint) -> ::c_int4221     pub fn memfd_create(name: *const ::c_char, flags: ::c_uint) -> ::c_int;
setaudit(auditinfo: *const auditinfo_t) -> ::c_int4222     pub fn setaudit(auditinfo: *const auditinfo_t) -> ::c_int;
4223 }
4224 
4225 #[link(name = "kvm")]
4226 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_t4227     pub fn kvm_open(
4228         execfile: *const ::c_char,
4229         corefile: *const ::c_char,
4230         swapfile: *const ::c_char,
4231         flags: ::c_int,
4232         errstr: *const ::c_char,
4233     ) -> *mut kvm_t;
kvm_close(kd: *mut kvm_t) -> ::c_int4234     pub fn kvm_close(kd: *mut kvm_t) -> ::c_int;
kvm_dpcpu_setcpu(kd: *mut kvm_t, cpu: ::c_uint) -> ::c_int4235     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_char4236     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_int4237     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_char4238     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_char4239     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_int4240     pub fn kvm_getloadavg(kd: *mut kvm_t, loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int;
kvm_getmaxcpu(kd: *mut kvm_t) -> ::c_int4241     pub fn kvm_getmaxcpu(kd: *mut kvm_t) -> ::c_int;
kvm_getncpus(kd: *mut kvm_t) -> ::c_int4242     pub fn kvm_getncpus(kd: *mut kvm_t) -> ::c_int;
kvm_getpcpu(kd: *mut kvm_t, cpu: ::c_int) -> *mut ::c_void4243     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) -> u644244     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_proc4245     pub fn kvm_getprocs(
4246         kd: *mut kvm_t,
4247         op: ::c_int,
4248         arg: ::c_int,
4249         cnt: *mut ::c_int,
4250     ) -> *mut kinfo_proc;
kvm_getswapinfo( kd: *mut kvm_t, info: *mut kvm_swap, maxswap: ::c_int, flags: ::c_int, ) -> ::c_int4251     pub fn kvm_getswapinfo(
4252         kd: *mut kvm_t,
4253         info: *mut kvm_swap,
4254         maxswap: ::c_int,
4255         flags: ::c_int,
4256     ) -> ::c_int;
kvm_native(kd: *mut kvm_t) -> ::c_int4257     pub fn kvm_native(kd: *mut kvm_t) -> ::c_int;
kvm_nlist(kd: *mut kvm_t, nl: *mut nlist) -> ::c_int4258     pub fn kvm_nlist(kd: *mut kvm_t, nl: *mut nlist) -> ::c_int;
kvm_nlist2(kd: *mut kvm_t, nl: *mut kvm_nlist) -> ::c_int4259     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_t4260     pub fn kvm_openfiles(
4261         execfile: *const ::c_char,
4262         corefile: *const ::c_char,
4263         swapfile: *const ::c_char,
4264         flags: ::c_int,
4265         errbuf: *mut ::c_char,
4266     ) -> *mut kvm_t;
kvm_read( kd: *mut kvm_t, addr: ::c_ulong, buf: *mut ::c_void, nbytes: ::size_t, ) -> ::ssize_t4267     pub fn kvm_read(
4268         kd: *mut kvm_t,
4269         addr: ::c_ulong,
4270         buf: *mut ::c_void,
4271         nbytes: ::size_t,
4272     ) -> ::ssize_t;
kvm_read_zpcpu( kd: *mut kvm_t, base: ::c_ulong, buf: *mut ::c_void, size: ::size_t, cpu: ::c_int, ) -> ::ssize_t4273     pub fn kvm_read_zpcpu(
4274         kd: *mut kvm_t,
4275         base: ::c_ulong,
4276         buf: *mut ::c_void,
4277         size: ::size_t,
4278         cpu: ::c_int,
4279     ) -> ::ssize_t;
kvm_read2( kd: *mut kvm_t, addr: kvaddr_t, buf: *mut ::c_void, nbytes: ::size_t, ) -> ::ssize_t4280     pub fn kvm_read2(
4281         kd: *mut kvm_t,
4282         addr: kvaddr_t,
4283         buf: *mut ::c_void,
4284         nbytes: ::size_t,
4285     ) -> ::ssize_t;
kvm_write( kd: *mut kvm_t, addr: ::c_ulong, buf: *const ::c_void, nbytes: ::size_t, ) -> ::ssize_t4286     pub fn kvm_write(
4287         kd: *mut kvm_t,
4288         addr: ::c_ulong,
4289         buf: *const ::c_void,
4290         nbytes: ::size_t,
4291     ) -> ::ssize_t;
4292 }
4293 
4294 #[link(name = "util")]
4295 extern "C" {
extattr_namespace_to_string( attrnamespace: ::c_int, string: *mut *mut ::c_char, ) -> ::c_int4296     pub fn extattr_namespace_to_string(
4297         attrnamespace: ::c_int,
4298         string: *mut *mut ::c_char,
4299     ) -> ::c_int;
extattr_string_to_namespace( string: *const ::c_char, attrnamespace: *mut ::c_int, ) -> ::c_int4300     pub fn extattr_string_to_namespace(
4301         string: *const ::c_char,
4302         attrnamespace: *mut ::c_int,
4303     ) -> ::c_int;
realhostname(host: *mut ::c_char, hsize: ::size_t, ip: *const ::in_addr) -> ::c_int4304     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_int4305     pub fn realhostname_sa(
4306         host: *mut ::c_char,
4307         hsize: ::size_t,
4308         addr: *mut ::sockaddr,
4309         addrlen: ::c_int,
4310     ) -> ::c_int;
4311 
kld_isloaded(name: *const ::c_char) -> ::c_int4312     pub fn kld_isloaded(name: *const ::c_char) -> ::c_int;
kld_load(name: *const ::c_char) -> ::c_int4313     pub fn kld_load(name: *const ::c_char) -> ::c_int;
4314 
kinfo_getvmmap(pid: ::pid_t, cntp: *mut ::c_int) -> *mut kinfo_vmentry4315     pub fn kinfo_getvmmap(pid: ::pid_t, cntp: *mut ::c_int) -> *mut kinfo_vmentry;
4316 
hexdump(ptr: *const ::c_void, length: ::c_int, hdr: *const ::c_char, flags: ::c_int)4317     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_int4318     pub fn humanize_number(
4319         buf: *mut ::c_char,
4320         len: ::size_t,
4321         number: i64,
4322         suffix: *const ::c_char,
4323         scale: ::c_int,
4324         flags: ::c_int,
4325     ) -> ::c_int;
4326 
flopen(path: *const ::c_char, flags: ::c_int, ...) -> ::c_int4327     pub fn flopen(path: *const ::c_char, flags: ::c_int, ...) -> ::c_int;
flopenat(fd: ::c_int, path: *const ::c_char, flags: ::c_int, ...) -> ::c_int4328     pub fn flopenat(fd: ::c_int, path: *const ::c_char, flags: ::c_int, ...) -> ::c_int;
4329 
getlocalbase() -> *const ::c_char4330     pub fn getlocalbase() -> *const ::c_char;
4331 }
4332 
4333 #[link(name = "procstat")]
4334 extern "C" {
procstat_open_sysctl() -> *mut procstat4335     pub fn procstat_open_sysctl() -> *mut procstat;
procstat_getfiles( procstat: *mut procstat, kp: *mut kinfo_proc, mmapped: ::c_int, ) -> *mut filestat_list4336     pub fn procstat_getfiles(
4337         procstat: *mut procstat,
4338         kp: *mut kinfo_proc,
4339         mmapped: ::c_int,
4340     ) -> *mut filestat_list;
procstat_freefiles(procstat: *mut procstat, head: *mut filestat_list)4341     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_proc4342     pub fn procstat_getprocs(
4343         procstat: *mut procstat,
4344         what: ::c_int,
4345         arg: ::c_int,
4346         count: *mut ::c_uint,
4347     ) -> *mut kinfo_proc;
procstat_freeprocs(procstat: *mut procstat, p: *mut kinfo_proc)4348     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_vmentry4349     pub fn procstat_getvmmap(
4350         procstat: *mut procstat,
4351         kp: *mut kinfo_proc,
4352         count: *mut ::c_uint,
4353     ) -> *mut kinfo_vmentry;
procstat_freevmmap(procstat: *mut procstat, vmmap: *mut kinfo_vmentry)4354     pub fn procstat_freevmmap(procstat: *mut procstat, vmmap: *mut kinfo_vmentry);
procstat_close(procstat: *mut procstat)4355     pub fn procstat_close(procstat: *mut procstat);
procstat_freeargv(procstat: *mut procstat)4356     pub fn procstat_freeargv(procstat: *mut procstat);
procstat_freeenvv(procstat: *mut procstat)4357     pub fn procstat_freeenvv(procstat: *mut procstat);
procstat_freegroups(procstat: *mut procstat, groups: *mut ::gid_t)4358     pub fn procstat_freegroups(procstat: *mut procstat, groups: *mut ::gid_t);
procstat_freeptlwpinfo(procstat: *mut procstat, pl: *mut ptrace_lwpinfo)4359     pub fn procstat_freeptlwpinfo(procstat: *mut procstat, pl: *mut ptrace_lwpinfo);
procstat_getargv( procstat: *mut procstat, kp: *mut kinfo_proc, nchr: ::size_t, ) -> *mut *mut ::c_char4360     pub fn procstat_getargv(
4361         procstat: *mut procstat,
4362         kp: *mut kinfo_proc,
4363         nchr: ::size_t,
4364     ) -> *mut *mut ::c_char;
procstat_getenvv( procstat: *mut procstat, kp: *mut kinfo_proc, nchr: ::size_t, ) -> *mut *mut ::c_char4365     pub fn procstat_getenvv(
4366         procstat: *mut procstat,
4367         kp: *mut kinfo_proc,
4368         nchr: ::size_t,
4369     ) -> *mut *mut ::c_char;
procstat_getgroups( procstat: *mut procstat, kp: *mut kinfo_proc, count: *mut ::c_uint, ) -> *mut ::gid_t4370     pub fn procstat_getgroups(
4371         procstat: *mut procstat,
4372         kp: *mut kinfo_proc,
4373         count: *mut ::c_uint,
4374     ) -> *mut ::gid_t;
procstat_getosrel( procstat: *mut procstat, kp: *mut kinfo_proc, osrelp: *mut ::c_int, ) -> ::c_int4375     pub fn procstat_getosrel(
4376         procstat: *mut procstat,
4377         kp: *mut kinfo_proc,
4378         osrelp: *mut ::c_int,
4379     ) -> ::c_int;
procstat_getpathname( procstat: *mut procstat, kp: *mut kinfo_proc, pathname: *mut ::c_char, maxlen: ::size_t, ) -> ::c_int4380     pub fn procstat_getpathname(
4381         procstat: *mut procstat,
4382         kp: *mut kinfo_proc,
4383         pathname: *mut ::c_char,
4384         maxlen: ::size_t,
4385     ) -> ::c_int;
procstat_getrlimit( procstat: *mut procstat, kp: *mut kinfo_proc, which: ::c_int, rlimit: *mut ::rlimit, ) -> ::c_int4386     pub fn procstat_getrlimit(
4387         procstat: *mut procstat,
4388         kp: *mut kinfo_proc,
4389         which: ::c_int,
4390         rlimit: *mut ::rlimit,
4391     ) -> ::c_int;
procstat_getumask( procstat: *mut procstat, kp: *mut kinfo_proc, maskp: *mut ::c_ushort, ) -> ::c_int4392     pub fn procstat_getumask(
4393         procstat: *mut procstat,
4394         kp: *mut kinfo_proc,
4395         maskp: *mut ::c_ushort,
4396     ) -> ::c_int;
procstat_open_core(filename: *const ::c_char) -> *mut procstat4397     pub fn procstat_open_core(filename: *const ::c_char) -> *mut procstat;
procstat_open_kvm(nlistf: *const ::c_char, memf: *const ::c_char) -> *mut procstat4398     pub fn procstat_open_kvm(nlistf: *const ::c_char, memf: *const ::c_char) -> *mut procstat;
procstat_get_socket_info( proc_: *mut procstat, fst: *mut filestat, sock: *mut sockstat, errbuf: *mut ::c_char, ) -> ::c_int4399     pub fn procstat_get_socket_info(
4400         proc_: *mut procstat,
4401         fst: *mut filestat,
4402         sock: *mut sockstat,
4403         errbuf: *mut ::c_char,
4404     ) -> ::c_int;
procstat_get_vnode_info( proc_: *mut procstat, fst: *mut filestat, vn: *mut vnstat, errbuf: *mut ::c_char, ) -> ::c_int4405     pub fn procstat_get_vnode_info(
4406         proc_: *mut procstat,
4407         fst: *mut filestat,
4408         vn: *mut vnstat,
4409         errbuf: *mut ::c_char,
4410     ) -> ::c_int;
procstat_get_pts_info( proc_: *mut procstat, fst: *mut filestat, pts: *mut ptsstat, errbuf: *mut ::c_char, ) -> ::c_int4411     pub fn procstat_get_pts_info(
4412         proc_: *mut procstat,
4413         fst: *mut filestat,
4414         pts: *mut ptsstat,
4415         errbuf: *mut ::c_char,
4416     ) -> ::c_int;
procstat_get_shm_info( proc_: *mut procstat, fst: *mut filestat, shm: *mut shmstat, errbuf: *mut ::c_char, ) -> ::c_int4417     pub fn procstat_get_shm_info(
4418         proc_: *mut procstat,
4419         fst: *mut filestat,
4420         shm: *mut shmstat,
4421         errbuf: *mut ::c_char,
4422     ) -> ::c_int;
4423 }
4424 
4425 #[link(name = "rt")]
4426 extern "C" {
timer_create(clock_id: clockid_t, evp: *mut sigevent, timerid: *mut timer_t) -> ::c_int4427     pub fn timer_create(clock_id: clockid_t, evp: *mut sigevent, timerid: *mut timer_t) -> ::c_int;
timer_delete(timerid: timer_t) -> ::c_int4428     pub fn timer_delete(timerid: timer_t) -> ::c_int;
timer_getoverrun(timerid: timer_t) -> ::c_int4429     pub fn timer_getoverrun(timerid: timer_t) -> ::c_int;
timer_gettime(timerid: timer_t, value: *mut itimerspec) -> ::c_int4430     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_int4431     pub fn timer_settime(
4432         timerid: timer_t,
4433         flags: ::c_int,
4434         value: *const itimerspec,
4435         ovalue: *mut itimerspec,
4436     ) -> ::c_int;
4437 }
4438 
4439 #[link(name = "devstat")]
4440 extern "C" {
devstat_getnumdevs(kd: *mut kvm_t) -> ::c_int4441     pub fn devstat_getnumdevs(kd: *mut kvm_t) -> ::c_int;
devstat_getgeneration(kd: *mut kvm_t) -> ::c_long4442     pub fn devstat_getgeneration(kd: *mut kvm_t) -> ::c_long;
devstat_getversion(kd: *mut kvm_t) -> ::c_int4443     pub fn devstat_getversion(kd: *mut kvm_t) -> ::c_int;
devstat_checkversion(kd: *mut kvm_t) -> ::c_int4444     pub fn devstat_checkversion(kd: *mut kvm_t) -> ::c_int;
devstat_selectdevs( dev_select: *mut *mut device_selection, num_selected: *mut ::c_int, num_selections: *mut ::c_int, select_generation: *mut ::c_long, current_generation: ::c_long, devices: *mut devstat, numdevs: ::c_int, matches: *mut devstat_match, num_matches: ::c_int, dev_selections: *mut *mut ::c_char, num_dev_selections: ::c_int, select_mode: devstat_select_mode, maxshowdevs: ::c_int, perf_select: ::c_int, ) -> ::c_int4445     pub fn devstat_selectdevs(
4446         dev_select: *mut *mut device_selection,
4447         num_selected: *mut ::c_int,
4448         num_selections: *mut ::c_int,
4449         select_generation: *mut ::c_long,
4450         current_generation: ::c_long,
4451         devices: *mut devstat,
4452         numdevs: ::c_int,
4453         matches: *mut devstat_match,
4454         num_matches: ::c_int,
4455         dev_selections: *mut *mut ::c_char,
4456         num_dev_selections: ::c_int,
4457         select_mode: devstat_select_mode,
4458         maxshowdevs: ::c_int,
4459         perf_select: ::c_int,
4460     ) -> ::c_int;
devstat_buildmatch( match_str: *mut ::c_char, matches: *mut *mut devstat_match, num_matches: *mut ::c_int, ) -> ::c_int4461     pub fn devstat_buildmatch(
4462         match_str: *mut ::c_char,
4463         matches: *mut *mut devstat_match,
4464         num_matches: *mut ::c_int,
4465     ) -> ::c_int;
4466 }
4467 
4468 cfg_if! {
4469     if #[cfg(freebsd14)] {
4470         mod freebsd14;
4471         pub use self::freebsd14::*;
4472     } else if #[cfg(freebsd13)] {
4473         mod freebsd13;
4474         pub use self::freebsd13::*;
4475     } else if #[cfg(freebsd12)] {
4476         mod freebsd12;
4477         pub use self::freebsd12::*;
4478     } else if #[cfg(any(freebsd10, freebsd11))] {
4479         mod freebsd11;
4480         pub use self::freebsd11::*;
4481     } else {
4482         // Unknown freebsd version
4483     }
4484 }
4485 
4486 cfg_if! {
4487     if #[cfg(target_arch = "x86")] {
4488         mod x86;
4489         pub use self::x86::*;
4490     } else if #[cfg(target_arch = "x86_64")] {
4491         mod x86_64;
4492         pub use self::x86_64::*;
4493     } else if #[cfg(target_arch = "aarch64")] {
4494         mod aarch64;
4495         pub use self::aarch64::*;
4496     } else if #[cfg(target_arch = "arm")] {
4497         mod arm;
4498         pub use self::arm::*;
4499     } else if #[cfg(target_arch = "powerpc64")] {
4500         mod powerpc64;
4501         pub use self::powerpc64::*;
4502     } else if #[cfg(target_arch = "powerpc")] {
4503         mod powerpc;
4504         pub use self::powerpc::*;
4505     } else if #[cfg(target_arch = "riscv64")] {
4506         mod riscv64;
4507         pub use self::riscv64::*;
4508     } else {
4509         // Unknown target_arch
4510     }
4511 }
4512