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