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