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