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