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