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