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