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