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