1 pub type pthread_t = c_ulong; 2 pub type __priority_which_t = ::c_uint; 3 pub type __rlimit_resource_t = ::c_uint; 4 pub type Lmid_t = ::c_long; 5 pub type regoff_t = ::c_int; 6 pub type __kernel_rwf_t = ::c_int; 7 8 cfg_if! { 9 if #[cfg(doc)] { 10 // Used in `linux::arch` to define ioctl constants. 11 pub(crate) type Ioctl = ::c_ulong; 12 } else { 13 #[doc(hidden)] 14 pub type Ioctl = ::c_ulong; 15 } 16 } 17 18 s! { 19 pub struct aiocb { 20 pub aio_fildes: ::c_int, 21 pub aio_lio_opcode: ::c_int, 22 pub aio_reqprio: ::c_int, 23 pub aio_buf: *mut ::c_void, 24 pub aio_nbytes: ::size_t, 25 pub aio_sigevent: ::sigevent, 26 __next_prio: *mut aiocb, 27 __abs_prio: ::c_int, 28 __policy: ::c_int, 29 __error_code: ::c_int, 30 __return_value: ::ssize_t, 31 pub aio_offset: off_t, 32 #[cfg(all(not(target_arch = "x86_64"), target_pointer_width = "32"))] 33 __unused1: [::c_char; 4], 34 __glibc_reserved: [::c_char; 32], 35 } 36 37 pub struct __exit_status { 38 pub e_termination: ::c_short, 39 pub e_exit: ::c_short, 40 } 41 42 pub struct __timeval { 43 pub tv_sec: i32, 44 pub tv_usec: i32, 45 } 46 47 pub struct glob64_t { 48 pub gl_pathc: ::size_t, 49 pub gl_pathv: *mut *mut ::c_char, 50 pub gl_offs: ::size_t, 51 pub gl_flags: ::c_int, 52 53 __unused1: *mut ::c_void, 54 __unused2: *mut ::c_void, 55 __unused3: *mut ::c_void, 56 __unused4: *mut ::c_void, 57 __unused5: *mut ::c_void, 58 } 59 60 pub struct msghdr { 61 pub msg_name: *mut ::c_void, 62 pub msg_namelen: ::socklen_t, 63 pub msg_iov: *mut ::iovec, 64 pub msg_iovlen: ::size_t, 65 pub msg_control: *mut ::c_void, 66 pub msg_controllen: ::size_t, 67 pub msg_flags: ::c_int, 68 } 69 70 pub struct cmsghdr { 71 pub cmsg_len: ::size_t, 72 pub cmsg_level: ::c_int, 73 pub cmsg_type: ::c_int, 74 } 75 76 pub struct termios { 77 pub c_iflag: ::tcflag_t, 78 pub c_oflag: ::tcflag_t, 79 pub c_cflag: ::tcflag_t, 80 pub c_lflag: ::tcflag_t, 81 pub c_line: ::cc_t, 82 pub c_cc: [::cc_t; ::NCCS], 83 #[cfg(not(any( 84 target_arch = "sparc", 85 target_arch = "sparc64", 86 target_arch = "mips", 87 target_arch = "mips32r6", 88 target_arch = "mips64", 89 target_arch = "mips64r6" 90 )))] 91 pub c_ispeed: ::speed_t, 92 #[cfg(not(any( 93 target_arch = "sparc", 94 target_arch = "sparc64", 95 target_arch = "mips", 96 target_arch = "mips32r6", 97 target_arch = "mips64", 98 target_arch = "mips64r6" 99 )))] 100 pub c_ospeed: ::speed_t, 101 } 102 103 pub struct mallinfo { 104 pub arena: ::c_int, 105 pub ordblks: ::c_int, 106 pub smblks: ::c_int, 107 pub hblks: ::c_int, 108 pub hblkhd: ::c_int, 109 pub usmblks: ::c_int, 110 pub fsmblks: ::c_int, 111 pub uordblks: ::c_int, 112 pub fordblks: ::c_int, 113 pub keepcost: ::c_int, 114 } 115 116 pub struct mallinfo2 { 117 pub arena: ::size_t, 118 pub ordblks: ::size_t, 119 pub smblks: ::size_t, 120 pub hblks: ::size_t, 121 pub hblkhd: ::size_t, 122 pub usmblks: ::size_t, 123 pub fsmblks: ::size_t, 124 pub uordblks: ::size_t, 125 pub fordblks: ::size_t, 126 pub keepcost: ::size_t, 127 } 128 129 pub struct nl_pktinfo { 130 pub group: u32, 131 } 132 133 pub struct nl_mmap_req { 134 pub nm_block_size: ::c_uint, 135 pub nm_block_nr: ::c_uint, 136 pub nm_frame_size: ::c_uint, 137 pub nm_frame_nr: ::c_uint, 138 } 139 140 pub struct nl_mmap_hdr { 141 pub nm_status: ::c_uint, 142 pub nm_len: ::c_uint, 143 pub nm_group: u32, 144 pub nm_pid: u32, 145 pub nm_uid: u32, 146 pub nm_gid: u32, 147 } 148 149 pub struct rtentry { 150 pub rt_pad1: ::c_ulong, 151 pub rt_dst: ::sockaddr, 152 pub rt_gateway: ::sockaddr, 153 pub rt_genmask: ::sockaddr, 154 pub rt_flags: ::c_ushort, 155 pub rt_pad2: ::c_short, 156 pub rt_pad3: ::c_ulong, 157 pub rt_tos: ::c_uchar, 158 pub rt_class: ::c_uchar, 159 #[cfg(target_pointer_width = "64")] 160 pub rt_pad4: [::c_short; 3usize], 161 #[cfg(not(target_pointer_width = "64"))] 162 pub rt_pad4: ::c_short, 163 pub rt_metric: ::c_short, 164 pub rt_dev: *mut ::c_char, 165 pub rt_mtu: ::c_ulong, 166 pub rt_window: ::c_ulong, 167 pub rt_irtt: ::c_ushort, 168 } 169 170 pub struct timex { 171 pub modes: ::c_uint, 172 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] 173 pub offset: i64, 174 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] 175 pub offset: ::c_long, 176 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] 177 pub freq: i64, 178 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] 179 pub freq: ::c_long, 180 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] 181 pub maxerror: i64, 182 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] 183 pub maxerror: ::c_long, 184 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] 185 pub esterror: i64, 186 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] 187 pub esterror: ::c_long, 188 pub status: ::c_int, 189 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] 190 pub constant: i64, 191 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] 192 pub constant: ::c_long, 193 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] 194 pub precision: i64, 195 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] 196 pub precision: ::c_long, 197 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] 198 pub tolerance: i64, 199 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] 200 pub tolerance: ::c_long, 201 pub time: ::timeval, 202 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] 203 pub tick: i64, 204 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] 205 pub tick: ::c_long, 206 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] 207 pub ppsfreq: i64, 208 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] 209 pub ppsfreq: ::c_long, 210 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] 211 pub jitter: i64, 212 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] 213 pub jitter: ::c_long, 214 pub shift: ::c_int, 215 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] 216 pub stabil: i64, 217 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] 218 pub stabil: ::c_long, 219 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] 220 pub jitcnt: i64, 221 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] 222 pub jitcnt: ::c_long, 223 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] 224 pub calcnt: i64, 225 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] 226 pub calcnt: ::c_long, 227 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] 228 pub errcnt: i64, 229 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] 230 pub errcnt: ::c_long, 231 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] 232 pub stbcnt: i64, 233 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] 234 pub stbcnt: ::c_long, 235 pub tai: ::c_int, 236 pub __unused1: i32, 237 pub __unused2: i32, 238 pub __unused3: i32, 239 pub __unused4: i32, 240 pub __unused5: i32, 241 pub __unused6: i32, 242 pub __unused7: i32, 243 pub __unused8: i32, 244 pub __unused9: i32, 245 pub __unused10: i32, 246 pub __unused11: i32, 247 } 248 249 pub struct ntptimeval { 250 pub time: ::timeval, 251 pub maxerror: ::c_long, 252 pub esterror: ::c_long, 253 pub tai: ::c_long, 254 pub __glibc_reserved1: ::c_long, 255 pub __glibc_reserved2: ::c_long, 256 pub __glibc_reserved3: ::c_long, 257 pub __glibc_reserved4: ::c_long, 258 } 259 260 pub struct regex_t { 261 __buffer: *mut ::c_void, 262 __allocated: ::size_t, 263 __used: ::size_t, 264 __syntax: ::c_ulong, 265 __fastmap: *mut ::c_char, 266 __translate: *mut ::c_char, 267 __re_nsub: ::size_t, 268 __bitfield: u8, 269 } 270 271 pub struct Elf64_Chdr { 272 pub ch_type: ::Elf64_Word, 273 pub ch_reserved: ::Elf64_Word, 274 pub ch_size: ::Elf64_Xword, 275 pub ch_addralign: ::Elf64_Xword, 276 } 277 278 pub struct Elf32_Chdr { 279 pub ch_type: ::Elf32_Word, 280 pub ch_size: ::Elf32_Word, 281 pub ch_addralign: ::Elf32_Word, 282 } 283 284 pub struct seminfo { 285 pub semmap: ::c_int, 286 pub semmni: ::c_int, 287 pub semmns: ::c_int, 288 pub semmnu: ::c_int, 289 pub semmsl: ::c_int, 290 pub semopm: ::c_int, 291 pub semume: ::c_int, 292 pub semusz: ::c_int, 293 pub semvmx: ::c_int, 294 pub semaem: ::c_int, 295 } 296 297 pub struct ptrace_peeksiginfo_args { 298 pub off: ::__u64, 299 pub flags: ::__u32, 300 pub nr: ::__s32, 301 } 302 303 pub struct __c_anonymous_ptrace_syscall_info_entry { 304 pub nr: ::__u64, 305 pub args: [::__u64; 6], 306 } 307 308 pub struct __c_anonymous_ptrace_syscall_info_exit { 309 pub sval: ::__s64, 310 pub is_error: ::__u8, 311 } 312 313 pub struct __c_anonymous_ptrace_syscall_info_seccomp { 314 pub nr: ::__u64, 315 pub args: [::__u64; 6], 316 pub ret_data: ::__u32, 317 } 318 319 pub struct ptrace_syscall_info { 320 pub op: ::__u8, 321 pub pad: [::__u8; 3], 322 pub arch: ::__u32, 323 pub instruction_pointer: ::__u64, 324 pub stack_pointer: ::__u64, 325 pub u: __c_anonymous_ptrace_syscall_info_data, 326 } 327 328 // linux/if_xdp.h 329 330 pub struct sockaddr_xdp { 331 pub sxdp_family: ::__u16, 332 pub sxdp_flags: ::__u16, 333 pub sxdp_ifindex: ::__u32, 334 pub sxdp_queue_id: ::__u32, 335 pub sxdp_shared_umem_fd: ::__u32, 336 } 337 338 pub struct xdp_ring_offset { 339 pub producer: ::__u64, 340 pub consumer: ::__u64, 341 pub desc: ::__u64, 342 pub flags: ::__u64, 343 } 344 345 pub struct xdp_mmap_offsets { 346 pub rx: xdp_ring_offset, 347 pub tx: xdp_ring_offset, 348 pub fr: xdp_ring_offset, 349 pub cr: xdp_ring_offset, 350 } 351 352 pub struct xdp_ring_offset_v1 { 353 pub producer: ::__u64, 354 pub consumer: ::__u64, 355 pub desc: ::__u64, 356 } 357 358 pub struct xdp_mmap_offsets_v1 { 359 pub rx: xdp_ring_offset_v1, 360 pub tx: xdp_ring_offset_v1, 361 pub fr: xdp_ring_offset_v1, 362 pub cr: xdp_ring_offset_v1, 363 } 364 365 pub struct xdp_umem_reg { 366 pub addr: ::__u64, 367 pub len: ::__u64, 368 pub chunk_size: ::__u32, 369 pub headroom: ::__u32, 370 pub flags: ::__u32, 371 pub tx_metadata_len: ::__u32, 372 } 373 374 pub struct xdp_umem_reg_v1 { 375 pub addr: ::__u64, 376 pub len: ::__u64, 377 pub chunk_size: ::__u32, 378 pub headroom: ::__u32, 379 } 380 381 pub struct xdp_statistics { 382 pub rx_dropped: ::__u64, 383 pub rx_invalid_descs: ::__u64, 384 pub tx_invalid_descs: ::__u64, 385 pub rx_ring_full: ::__u64, 386 pub rx_fill_ring_empty_descs: ::__u64, 387 pub tx_ring_empty_descs: ::__u64, 388 } 389 390 pub struct xdp_statistics_v1 { 391 pub rx_dropped: ::__u64, 392 pub rx_invalid_descs: ::__u64, 393 pub tx_invalid_descs: ::__u64, 394 } 395 396 pub struct xdp_options { 397 pub flags: ::__u32, 398 } 399 400 pub struct xdp_desc { 401 pub addr: ::__u64, 402 pub len: ::__u32, 403 pub options: ::__u32, 404 } 405 406 pub struct iocb { 407 pub aio_data: ::__u64, 408 #[cfg(target_endian = "little")] 409 pub aio_key: ::__u32, 410 #[cfg(target_endian = "little")] 411 pub aio_rw_flags: ::__kernel_rwf_t, 412 #[cfg(target_endian = "big")] 413 pub aio_rw_flags: ::__kernel_rwf_t, 414 #[cfg(target_endian = "big")] 415 pub aio_key: ::__u32, 416 pub aio_lio_opcode: ::__u16, 417 pub aio_reqprio: ::__s16, 418 pub aio_fildes: ::__u32, 419 pub aio_buf: ::__u64, 420 pub aio_nbytes: ::__u64, 421 pub aio_offset: ::__s64, 422 aio_reserved2: ::__u64, 423 pub aio_flags: ::__u32, 424 pub aio_resfd: ::__u32, 425 } 426 427 // netinet/tcp.h 428 429 pub struct tcp_info { 430 pub tcpi_state: u8, 431 pub tcpi_ca_state: u8, 432 pub tcpi_retransmits: u8, 433 pub tcpi_probes: u8, 434 pub tcpi_backoff: u8, 435 pub tcpi_options: u8, 436 /// This contains the bitfields `tcpi_snd_wscale` and `tcpi_rcv_wscale`. 437 /// Each is 4 bits. 438 pub tcpi_snd_rcv_wscale: u8, 439 pub tcpi_rto: u32, 440 pub tcpi_ato: u32, 441 pub tcpi_snd_mss: u32, 442 pub tcpi_rcv_mss: u32, 443 pub tcpi_unacked: u32, 444 pub tcpi_sacked: u32, 445 pub tcpi_lost: u32, 446 pub tcpi_retrans: u32, 447 pub tcpi_fackets: u32, 448 pub tcpi_last_data_sent: u32, 449 pub tcpi_last_ack_sent: u32, 450 pub tcpi_last_data_recv: u32, 451 pub tcpi_last_ack_recv: u32, 452 pub tcpi_pmtu: u32, 453 pub tcpi_rcv_ssthresh: u32, 454 pub tcpi_rtt: u32, 455 pub tcpi_rttvar: u32, 456 pub tcpi_snd_ssthresh: u32, 457 pub tcpi_snd_cwnd: u32, 458 pub tcpi_advmss: u32, 459 pub tcpi_reordering: u32, 460 pub tcpi_rcv_rtt: u32, 461 pub tcpi_rcv_space: u32, 462 pub tcpi_total_retrans: u32, 463 } 464 465 pub struct fanotify_event_info_pidfd { 466 pub hdr: ::fanotify_event_info_header, 467 pub pidfd: ::__s32, 468 } 469 470 pub struct fanotify_event_info_error { 471 pub hdr: ::fanotify_event_info_header, 472 pub error: ::__s32, 473 pub error_count: ::__u32, 474 } 475 476 // FIXME(1.0) this is actually a union 477 #[cfg_attr(target_pointer_width = "32", repr(align(4)))] 478 #[cfg_attr(target_pointer_width = "64", repr(align(8)))] 479 pub struct sem_t { 480 #[cfg(target_pointer_width = "32")] 481 __size: [::c_char; 16], 482 #[cfg(target_pointer_width = "64")] 483 __size: [::c_char; 32], 484 } 485 } 486 487 impl siginfo_t { 488 pub unsafe fn si_addr(&self) -> *mut ::c_void { 489 #[repr(C)] 490 struct siginfo_sigfault { 491 _si_signo: ::c_int, 492 _si_errno: ::c_int, 493 _si_code: ::c_int, 494 si_addr: *mut ::c_void, 495 } 496 (*(self as *const siginfo_t as *const siginfo_sigfault)).si_addr 497 } 498 499 pub unsafe fn si_value(&self) -> ::sigval { 500 #[repr(C)] 501 struct siginfo_timer { 502 _si_signo: ::c_int, 503 _si_errno: ::c_int, 504 _si_code: ::c_int, 505 _si_tid: ::c_int, 506 _si_overrun: ::c_int, 507 si_sigval: ::sigval, 508 } 509 (*(self as *const siginfo_t as *const siginfo_timer)).si_sigval 510 } 511 } 512 513 // Internal, for casts to access union fields 514 #[repr(C)] 515 struct sifields_sigchld { 516 si_pid: ::pid_t, 517 si_uid: ::uid_t, 518 si_status: ::c_int, 519 si_utime: ::c_long, 520 si_stime: ::c_long, 521 } 522 impl ::Copy for sifields_sigchld {} 523 impl ::Clone for sifields_sigchld { 524 fn clone(&self) -> sifields_sigchld { 525 *self 526 } 527 } 528 529 // Internal, for casts to access union fields 530 #[repr(C)] 531 union sifields { 532 _align_pointer: *mut ::c_void, 533 sigchld: sifields_sigchld, 534 } 535 536 // Internal, for casts to access union fields. Note that some variants 537 // of sifields start with a pointer, which makes the alignment of 538 // sifields vary on 32-bit and 64-bit architectures. 539 #[repr(C)] 540 struct siginfo_f { 541 _siginfo_base: [::c_int; 3], 542 sifields: sifields, 543 } 544 545 impl siginfo_t { 546 unsafe fn sifields(&self) -> &sifields { 547 &(*(self as *const siginfo_t as *const siginfo_f)).sifields 548 } 549 550 pub unsafe fn si_pid(&self) -> ::pid_t { 551 self.sifields().sigchld.si_pid 552 } 553 554 pub unsafe fn si_uid(&self) -> ::uid_t { 555 self.sifields().sigchld.si_uid 556 } 557 558 pub unsafe fn si_status(&self) -> ::c_int { 559 self.sifields().sigchld.si_status 560 } 561 562 pub unsafe fn si_utime(&self) -> ::c_long { 563 self.sifields().sigchld.si_utime 564 } 565 566 pub unsafe fn si_stime(&self) -> ::c_long { 567 self.sifields().sigchld.si_stime 568 } 569 } 570 571 pub union __c_anonymous_ptrace_syscall_info_data { 572 pub entry: __c_anonymous_ptrace_syscall_info_entry, 573 pub exit: __c_anonymous_ptrace_syscall_info_exit, 574 pub seccomp: __c_anonymous_ptrace_syscall_info_seccomp, 575 } 576 impl ::Copy for __c_anonymous_ptrace_syscall_info_data {} 577 impl ::Clone for __c_anonymous_ptrace_syscall_info_data { 578 fn clone(&self) -> __c_anonymous_ptrace_syscall_info_data { 579 *self 580 } 581 } 582 583 s_no_extra_traits! { 584 pub struct utmpx { 585 pub ut_type: ::c_short, 586 pub ut_pid: ::pid_t, 587 pub ut_line: [::c_char; __UT_LINESIZE], 588 pub ut_id: [::c_char; 4], 589 590 pub ut_user: [::c_char; __UT_NAMESIZE], 591 pub ut_host: [::c_char; __UT_HOSTSIZE], 592 pub ut_exit: __exit_status, 593 594 #[cfg(any( 595 target_arch = "aarch64", 596 target_arch = "s390x", 597 target_arch = "loongarch64", 598 all(target_pointer_width = "32", not(target_arch = "x86_64")) 599 ))] 600 pub ut_session: ::c_long, 601 #[cfg(any( 602 target_arch = "aarch64", 603 target_arch = "s390x", 604 target_arch = "loongarch64", 605 all(target_pointer_width = "32", not(target_arch = "x86_64")) 606 ))] 607 pub ut_tv: ::timeval, 608 609 #[cfg(not(any( 610 target_arch = "aarch64", 611 target_arch = "s390x", 612 target_arch = "loongarch64", 613 all(target_pointer_width = "32", not(target_arch = "x86_64")) 614 )))] 615 pub ut_session: i32, 616 #[cfg(not(any( 617 target_arch = "aarch64", 618 target_arch = "s390x", 619 target_arch = "loongarch64", 620 all(target_pointer_width = "32", not(target_arch = "x86_64")) 621 )))] 622 pub ut_tv: __timeval, 623 624 pub ut_addr_v6: [i32; 4], 625 __glibc_reserved: [::c_char; 20], 626 } 627 } 628 629 cfg_if! { 630 if #[cfg(feature = "extra_traits")] { 631 impl PartialEq for utmpx { 632 fn eq(&self, other: &utmpx) -> bool { 633 self.ut_type == other.ut_type 634 && self.ut_pid == other.ut_pid 635 && self.ut_line == other.ut_line 636 && self.ut_id == other.ut_id 637 && self.ut_user == other.ut_user 638 && self 639 .ut_host 640 .iter() 641 .zip(other.ut_host.iter()) 642 .all(|(a, b)| a == b) 643 && self.ut_exit == other.ut_exit 644 && self.ut_session == other.ut_session 645 && self.ut_tv == other.ut_tv 646 && self.ut_addr_v6 == other.ut_addr_v6 647 && self.__glibc_reserved == other.__glibc_reserved 648 } 649 } 650 651 impl Eq for utmpx {} 652 653 impl ::fmt::Debug for utmpx { 654 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 655 f.debug_struct("utmpx") 656 .field("ut_type", &self.ut_type) 657 .field("ut_pid", &self.ut_pid) 658 .field("ut_line", &self.ut_line) 659 .field("ut_id", &self.ut_id) 660 .field("ut_user", &self.ut_user) 661 // FIXME: .field("ut_host", &self.ut_host) 662 .field("ut_exit", &self.ut_exit) 663 .field("ut_session", &self.ut_session) 664 .field("ut_tv", &self.ut_tv) 665 .field("ut_addr_v6", &self.ut_addr_v6) 666 .field("__glibc_reserved", &self.__glibc_reserved) 667 .finish() 668 } 669 } 670 671 impl ::hash::Hash for utmpx { 672 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 673 self.ut_type.hash(state); 674 self.ut_pid.hash(state); 675 self.ut_line.hash(state); 676 self.ut_id.hash(state); 677 self.ut_user.hash(state); 678 self.ut_host.hash(state); 679 self.ut_exit.hash(state); 680 self.ut_session.hash(state); 681 self.ut_tv.hash(state); 682 self.ut_addr_v6.hash(state); 683 self.__glibc_reserved.hash(state); 684 } 685 } 686 687 impl PartialEq for __c_anonymous_ptrace_syscall_info_data { 688 fn eq(&self, other: &__c_anonymous_ptrace_syscall_info_data) -> bool { 689 unsafe { 690 self.entry == other.entry 691 || self.exit == other.exit 692 || self.seccomp == other.seccomp 693 } 694 } 695 } 696 697 impl Eq for __c_anonymous_ptrace_syscall_info_data {} 698 699 impl ::fmt::Debug for __c_anonymous_ptrace_syscall_info_data { 700 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 701 unsafe { 702 f.debug_struct("__c_anonymous_ptrace_syscall_info_data") 703 .field("entry", &self.entry) 704 .field("exit", &self.exit) 705 .field("seccomp", &self.seccomp) 706 .finish() 707 } 708 } 709 } 710 711 impl ::hash::Hash for __c_anonymous_ptrace_syscall_info_data { 712 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 713 unsafe { 714 self.entry.hash(state); 715 self.exit.hash(state); 716 self.seccomp.hash(state); 717 } 718 } 719 } 720 } 721 } 722 723 // include/uapi/asm-generic/hugetlb_encode.h 724 pub const HUGETLB_FLAG_ENCODE_SHIFT: ::c_int = 26; 725 pub const HUGETLB_FLAG_ENCODE_MASK: ::c_int = 0x3f; 726 727 pub const HUGETLB_FLAG_ENCODE_64KB: ::c_int = 16 << HUGETLB_FLAG_ENCODE_SHIFT; 728 pub const HUGETLB_FLAG_ENCODE_512KB: ::c_int = 19 << HUGETLB_FLAG_ENCODE_SHIFT; 729 pub const HUGETLB_FLAG_ENCODE_1MB: ::c_int = 20 << HUGETLB_FLAG_ENCODE_SHIFT; 730 pub const HUGETLB_FLAG_ENCODE_2MB: ::c_int = 21 << HUGETLB_FLAG_ENCODE_SHIFT; 731 pub const HUGETLB_FLAG_ENCODE_8MB: ::c_int = 23 << HUGETLB_FLAG_ENCODE_SHIFT; 732 pub const HUGETLB_FLAG_ENCODE_16MB: ::c_int = 24 << HUGETLB_FLAG_ENCODE_SHIFT; 733 pub const HUGETLB_FLAG_ENCODE_32MB: ::c_int = 25 << HUGETLB_FLAG_ENCODE_SHIFT; 734 pub const HUGETLB_FLAG_ENCODE_256MB: ::c_int = 28 << HUGETLB_FLAG_ENCODE_SHIFT; 735 pub const HUGETLB_FLAG_ENCODE_512MB: ::c_int = 29 << HUGETLB_FLAG_ENCODE_SHIFT; 736 pub const HUGETLB_FLAG_ENCODE_1GB: ::c_int = 30 << HUGETLB_FLAG_ENCODE_SHIFT; 737 pub const HUGETLB_FLAG_ENCODE_2GB: ::c_int = 31 << HUGETLB_FLAG_ENCODE_SHIFT; 738 pub const HUGETLB_FLAG_ENCODE_16GB: ::c_int = 34 << HUGETLB_FLAG_ENCODE_SHIFT; 739 740 // include/uapi/linux/mman.h 741 /* 742 * Huge page size encoding when MAP_HUGETLB is specified, and a huge page 743 * size other than the default is desired. See hugetlb_encode.h. 744 * All known huge page size encodings are provided here. It is the 745 * responsibility of the application to know which sizes are supported on 746 * the running system. See mmap(2) man page for details. 747 */ 748 pub const MAP_HUGE_SHIFT: ::c_int = HUGETLB_FLAG_ENCODE_SHIFT; 749 pub const MAP_HUGE_MASK: ::c_int = HUGETLB_FLAG_ENCODE_MASK; 750 751 pub const MAP_HUGE_64KB: ::c_int = HUGETLB_FLAG_ENCODE_64KB; 752 pub const MAP_HUGE_512KB: ::c_int = HUGETLB_FLAG_ENCODE_512KB; 753 pub const MAP_HUGE_1MB: ::c_int = HUGETLB_FLAG_ENCODE_1MB; 754 pub const MAP_HUGE_2MB: ::c_int = HUGETLB_FLAG_ENCODE_2MB; 755 pub const MAP_HUGE_8MB: ::c_int = HUGETLB_FLAG_ENCODE_8MB; 756 pub const MAP_HUGE_16MB: ::c_int = HUGETLB_FLAG_ENCODE_16MB; 757 pub const MAP_HUGE_32MB: ::c_int = HUGETLB_FLAG_ENCODE_32MB; 758 pub const MAP_HUGE_256MB: ::c_int = HUGETLB_FLAG_ENCODE_256MB; 759 pub const MAP_HUGE_512MB: ::c_int = HUGETLB_FLAG_ENCODE_512MB; 760 pub const MAP_HUGE_1GB: ::c_int = HUGETLB_FLAG_ENCODE_1GB; 761 pub const MAP_HUGE_2GB: ::c_int = HUGETLB_FLAG_ENCODE_2GB; 762 pub const MAP_HUGE_16GB: ::c_int = HUGETLB_FLAG_ENCODE_16GB; 763 764 pub const PRIO_PROCESS: ::__priority_which_t = 0; 765 pub const PRIO_PGRP: ::__priority_which_t = 1; 766 pub const PRIO_USER: ::__priority_which_t = 2; 767 768 pub const MS_RMT_MASK: ::c_ulong = 0x02800051; 769 770 pub const __UT_LINESIZE: usize = 32; 771 pub const __UT_NAMESIZE: usize = 32; 772 pub const __UT_HOSTSIZE: usize = 256; 773 pub const EMPTY: ::c_short = 0; 774 pub const RUN_LVL: ::c_short = 1; 775 pub const BOOT_TIME: ::c_short = 2; 776 pub const NEW_TIME: ::c_short = 3; 777 pub const OLD_TIME: ::c_short = 4; 778 pub const INIT_PROCESS: ::c_short = 5; 779 pub const LOGIN_PROCESS: ::c_short = 6; 780 pub const USER_PROCESS: ::c_short = 7; 781 pub const DEAD_PROCESS: ::c_short = 8; 782 pub const ACCOUNTING: ::c_short = 9; 783 784 // dlfcn.h 785 pub const LM_ID_BASE: ::c_long = 0; 786 pub const LM_ID_NEWLM: ::c_long = -1; 787 788 pub const RTLD_DI_LMID: ::c_int = 1; 789 pub const RTLD_DI_LINKMAP: ::c_int = 2; 790 pub const RTLD_DI_CONFIGADDR: ::c_int = 3; 791 pub const RTLD_DI_SERINFO: ::c_int = 4; 792 pub const RTLD_DI_SERINFOSIZE: ::c_int = 5; 793 pub const RTLD_DI_ORIGIN: ::c_int = 6; 794 pub const RTLD_DI_PROFILENAME: ::c_int = 7; 795 pub const RTLD_DI_PROFILEOUT: ::c_int = 8; 796 pub const RTLD_DI_TLS_MODID: ::c_int = 9; 797 pub const RTLD_DI_TLS_DATA: ::c_int = 10; 798 799 pub const SOCK_NONBLOCK: ::c_int = O_NONBLOCK; 800 pub const PIDFD_NONBLOCK: ::c_uint = O_NONBLOCK as ::c_uint; 801 802 pub const SOL_RXRPC: ::c_int = 272; 803 pub const SOL_PPPOL2TP: ::c_int = 273; 804 pub const SOL_PNPIPE: ::c_int = 275; 805 pub const SOL_RDS: ::c_int = 276; 806 pub const SOL_IUCV: ::c_int = 277; 807 pub const SOL_CAIF: ::c_int = 278; 808 pub const SOL_NFC: ::c_int = 280; 809 pub const SOL_XDP: ::c_int = 283; 810 811 pub const MSG_TRYHARD: ::c_int = 4; 812 813 pub const LC_PAPER: ::c_int = 7; 814 pub const LC_NAME: ::c_int = 8; 815 pub const LC_ADDRESS: ::c_int = 9; 816 pub const LC_TELEPHONE: ::c_int = 10; 817 pub const LC_MEASUREMENT: ::c_int = 11; 818 pub const LC_IDENTIFICATION: ::c_int = 12; 819 pub const LC_PAPER_MASK: ::c_int = 1 << LC_PAPER; 820 pub const LC_NAME_MASK: ::c_int = 1 << LC_NAME; 821 pub const LC_ADDRESS_MASK: ::c_int = 1 << LC_ADDRESS; 822 pub const LC_TELEPHONE_MASK: ::c_int = 1 << LC_TELEPHONE; 823 pub const LC_MEASUREMENT_MASK: ::c_int = 1 << LC_MEASUREMENT; 824 pub const LC_IDENTIFICATION_MASK: ::c_int = 1 << LC_IDENTIFICATION; 825 pub const LC_ALL_MASK: ::c_int = ::LC_CTYPE_MASK 826 | ::LC_NUMERIC_MASK 827 | ::LC_TIME_MASK 828 | ::LC_COLLATE_MASK 829 | ::LC_MONETARY_MASK 830 | ::LC_MESSAGES_MASK 831 | LC_PAPER_MASK 832 | LC_NAME_MASK 833 | LC_ADDRESS_MASK 834 | LC_TELEPHONE_MASK 835 | LC_MEASUREMENT_MASK 836 | LC_IDENTIFICATION_MASK; 837 838 pub const ENOTSUP: ::c_int = EOPNOTSUPP; 839 840 pub const SOCK_SEQPACKET: ::c_int = 5; 841 pub const SOCK_DCCP: ::c_int = 6; 842 pub const SOCK_PACKET: ::c_int = 10; 843 844 pub const AF_IB: ::c_int = 27; 845 pub const AF_MPLS: ::c_int = 28; 846 pub const AF_NFC: ::c_int = 39; 847 pub const AF_VSOCK: ::c_int = 40; 848 pub const AF_XDP: ::c_int = 44; 849 pub const PF_IB: ::c_int = AF_IB; 850 pub const PF_MPLS: ::c_int = AF_MPLS; 851 pub const PF_NFC: ::c_int = AF_NFC; 852 pub const PF_VSOCK: ::c_int = AF_VSOCK; 853 pub const PF_XDP: ::c_int = AF_XDP; 854 855 pub const SIGEV_THREAD_ID: ::c_int = 4; 856 857 pub const BUFSIZ: ::c_uint = 8192; 858 pub const TMP_MAX: ::c_uint = 238328; 859 pub const FOPEN_MAX: ::c_uint = 16; 860 pub const FILENAME_MAX: ::c_uint = 4096; 861 pub const POSIX_MADV_DONTNEED: ::c_int = 4; 862 pub const _CS_GNU_LIBC_VERSION: ::c_int = 2; 863 pub const _CS_GNU_LIBPTHREAD_VERSION: ::c_int = 3; 864 pub const _CS_V6_ENV: ::c_int = 1148; 865 pub const _CS_V7_ENV: ::c_int = 1149; 866 pub const _SC_EQUIV_CLASS_MAX: ::c_int = 41; 867 pub const _SC_CHARCLASS_NAME_MAX: ::c_int = 45; 868 pub const _SC_PII: ::c_int = 53; 869 pub const _SC_PII_XTI: ::c_int = 54; 870 pub const _SC_PII_SOCKET: ::c_int = 55; 871 pub const _SC_PII_INTERNET: ::c_int = 56; 872 pub const _SC_PII_OSI: ::c_int = 57; 873 pub const _SC_POLL: ::c_int = 58; 874 pub const _SC_SELECT: ::c_int = 59; 875 pub const _SC_PII_INTERNET_STREAM: ::c_int = 61; 876 pub const _SC_PII_INTERNET_DGRAM: ::c_int = 62; 877 pub const _SC_PII_OSI_COTS: ::c_int = 63; 878 pub const _SC_PII_OSI_CLTS: ::c_int = 64; 879 pub const _SC_PII_OSI_M: ::c_int = 65; 880 pub const _SC_T_IOV_MAX: ::c_int = 66; 881 pub const _SC_2_C_VERSION: ::c_int = 96; 882 pub const _SC_CHAR_BIT: ::c_int = 101; 883 pub const _SC_CHAR_MAX: ::c_int = 102; 884 pub const _SC_CHAR_MIN: ::c_int = 103; 885 pub const _SC_INT_MAX: ::c_int = 104; 886 pub const _SC_INT_MIN: ::c_int = 105; 887 pub const _SC_LONG_BIT: ::c_int = 106; 888 pub const _SC_WORD_BIT: ::c_int = 107; 889 pub const _SC_MB_LEN_MAX: ::c_int = 108; 890 pub const _SC_SSIZE_MAX: ::c_int = 110; 891 pub const _SC_SCHAR_MAX: ::c_int = 111; 892 pub const _SC_SCHAR_MIN: ::c_int = 112; 893 pub const _SC_SHRT_MAX: ::c_int = 113; 894 pub const _SC_SHRT_MIN: ::c_int = 114; 895 pub const _SC_UCHAR_MAX: ::c_int = 115; 896 pub const _SC_UINT_MAX: ::c_int = 116; 897 pub const _SC_ULONG_MAX: ::c_int = 117; 898 pub const _SC_USHRT_MAX: ::c_int = 118; 899 pub const _SC_NL_ARGMAX: ::c_int = 119; 900 pub const _SC_NL_LANGMAX: ::c_int = 120; 901 pub const _SC_NL_MSGMAX: ::c_int = 121; 902 pub const _SC_NL_NMAX: ::c_int = 122; 903 pub const _SC_NL_SETMAX: ::c_int = 123; 904 pub const _SC_NL_TEXTMAX: ::c_int = 124; 905 pub const _SC_BASE: ::c_int = 134; 906 pub const _SC_C_LANG_SUPPORT: ::c_int = 135; 907 pub const _SC_C_LANG_SUPPORT_R: ::c_int = 136; 908 pub const _SC_DEVICE_IO: ::c_int = 140; 909 pub const _SC_DEVICE_SPECIFIC: ::c_int = 141; 910 pub const _SC_DEVICE_SPECIFIC_R: ::c_int = 142; 911 pub const _SC_FD_MGMT: ::c_int = 143; 912 pub const _SC_FIFO: ::c_int = 144; 913 pub const _SC_PIPE: ::c_int = 145; 914 pub const _SC_FILE_ATTRIBUTES: ::c_int = 146; 915 pub const _SC_FILE_LOCKING: ::c_int = 147; 916 pub const _SC_FILE_SYSTEM: ::c_int = 148; 917 pub const _SC_MULTI_PROCESS: ::c_int = 150; 918 pub const _SC_SINGLE_PROCESS: ::c_int = 151; 919 pub const _SC_NETWORKING: ::c_int = 152; 920 pub const _SC_REGEX_VERSION: ::c_int = 156; 921 pub const _SC_SIGNALS: ::c_int = 158; 922 pub const _SC_SYSTEM_DATABASE: ::c_int = 162; 923 pub const _SC_SYSTEM_DATABASE_R: ::c_int = 163; 924 pub const _SC_USER_GROUPS: ::c_int = 166; 925 pub const _SC_USER_GROUPS_R: ::c_int = 167; 926 pub const _SC_LEVEL1_ICACHE_SIZE: ::c_int = 185; 927 pub const _SC_LEVEL1_ICACHE_ASSOC: ::c_int = 186; 928 pub const _SC_LEVEL1_ICACHE_LINESIZE: ::c_int = 187; 929 pub const _SC_LEVEL1_DCACHE_SIZE: ::c_int = 188; 930 pub const _SC_LEVEL1_DCACHE_ASSOC: ::c_int = 189; 931 pub const _SC_LEVEL1_DCACHE_LINESIZE: ::c_int = 190; 932 pub const _SC_LEVEL2_CACHE_SIZE: ::c_int = 191; 933 pub const _SC_LEVEL2_CACHE_ASSOC: ::c_int = 192; 934 pub const _SC_LEVEL2_CACHE_LINESIZE: ::c_int = 193; 935 pub const _SC_LEVEL3_CACHE_SIZE: ::c_int = 194; 936 pub const _SC_LEVEL3_CACHE_ASSOC: ::c_int = 195; 937 pub const _SC_LEVEL3_CACHE_LINESIZE: ::c_int = 196; 938 pub const _SC_LEVEL4_CACHE_SIZE: ::c_int = 197; 939 pub const _SC_LEVEL4_CACHE_ASSOC: ::c_int = 198; 940 pub const _SC_LEVEL4_CACHE_LINESIZE: ::c_int = 199; 941 pub const O_ACCMODE: ::c_int = 3; 942 pub const ST_RELATIME: ::c_ulong = 4096; 943 pub const NI_MAXHOST: ::socklen_t = 1025; 944 945 // Most `*_SUPER_MAGIC` constants are defined at the `linux_like` level; the 946 // following are only available on newer Linux versions than the versions 947 // currently used in CI in some configurations, so we define them here. 948 cfg_if! { 949 if #[cfg(not(target_arch = "s390x"))] { 950 pub const BINDERFS_SUPER_MAGIC: ::c_long = 0x6c6f6f70; 951 pub const XFS_SUPER_MAGIC: ::c_long = 0x58465342; 952 } else if #[cfg(target_arch = "s390x")] { 953 pub const BINDERFS_SUPER_MAGIC: ::c_uint = 0x6c6f6f70; 954 pub const XFS_SUPER_MAGIC: ::c_uint = 0x58465342; 955 } 956 } 957 958 pub const CPU_SETSIZE: ::c_int = 0x400; 959 960 pub const PTRACE_TRACEME: ::c_uint = 0; 961 pub const PTRACE_PEEKTEXT: ::c_uint = 1; 962 pub const PTRACE_PEEKDATA: ::c_uint = 2; 963 pub const PTRACE_PEEKUSER: ::c_uint = 3; 964 pub const PTRACE_POKETEXT: ::c_uint = 4; 965 pub const PTRACE_POKEDATA: ::c_uint = 5; 966 pub const PTRACE_POKEUSER: ::c_uint = 6; 967 pub const PTRACE_CONT: ::c_uint = 7; 968 pub const PTRACE_KILL: ::c_uint = 8; 969 pub const PTRACE_SINGLESTEP: ::c_uint = 9; 970 pub const PTRACE_ATTACH: ::c_uint = 16; 971 pub const PTRACE_SYSCALL: ::c_uint = 24; 972 pub const PTRACE_SETOPTIONS: ::c_uint = 0x4200; 973 pub const PTRACE_GETEVENTMSG: ::c_uint = 0x4201; 974 pub const PTRACE_GETSIGINFO: ::c_uint = 0x4202; 975 pub const PTRACE_SETSIGINFO: ::c_uint = 0x4203; 976 pub const PTRACE_GETREGSET: ::c_uint = 0x4204; 977 pub const PTRACE_SETREGSET: ::c_uint = 0x4205; 978 pub const PTRACE_SEIZE: ::c_uint = 0x4206; 979 pub const PTRACE_INTERRUPT: ::c_uint = 0x4207; 980 pub const PTRACE_LISTEN: ::c_uint = 0x4208; 981 pub const PTRACE_PEEKSIGINFO: ::c_uint = 0x4209; 982 pub const PTRACE_GETSIGMASK: ::c_uint = 0x420a; 983 pub const PTRACE_SETSIGMASK: ::c_uint = 0x420b; 984 pub const PTRACE_GET_SYSCALL_INFO: ::c_uint = 0x420e; 985 pub const PTRACE_SYSCALL_INFO_NONE: ::__u8 = 0; 986 pub const PTRACE_SYSCALL_INFO_ENTRY: ::__u8 = 1; 987 pub const PTRACE_SYSCALL_INFO_EXIT: ::__u8 = 2; 988 pub const PTRACE_SYSCALL_INFO_SECCOMP: ::__u8 = 3; 989 990 // linux/fs.h 991 992 // Flags for preadv2/pwritev2 993 pub const RWF_HIPRI: ::c_int = 0x00000001; 994 pub const RWF_DSYNC: ::c_int = 0x00000002; 995 pub const RWF_SYNC: ::c_int = 0x00000004; 996 pub const RWF_NOWAIT: ::c_int = 0x00000008; 997 pub const RWF_APPEND: ::c_int = 0x00000010; 998 999 // linux/rtnetlink.h 1000 pub const TCA_PAD: ::c_ushort = 9; 1001 pub const TCA_DUMP_INVISIBLE: ::c_ushort = 10; 1002 pub const TCA_CHAIN: ::c_ushort = 11; 1003 pub const TCA_HW_OFFLOAD: ::c_ushort = 12; 1004 1005 pub const RTM_DELNETCONF: u16 = 81; 1006 pub const RTM_NEWSTATS: u16 = 92; 1007 pub const RTM_GETSTATS: u16 = 94; 1008 pub const RTM_NEWCACHEREPORT: u16 = 96; 1009 1010 pub const RTM_F_LOOKUP_TABLE: ::c_uint = 0x1000; 1011 pub const RTM_F_FIB_MATCH: ::c_uint = 0x2000; 1012 1013 pub const RTA_VIA: ::c_ushort = 18; 1014 pub const RTA_NEWDST: ::c_ushort = 19; 1015 pub const RTA_PREF: ::c_ushort = 20; 1016 pub const RTA_ENCAP_TYPE: ::c_ushort = 21; 1017 pub const RTA_ENCAP: ::c_ushort = 22; 1018 pub const RTA_EXPIRES: ::c_ushort = 23; 1019 pub const RTA_PAD: ::c_ushort = 24; 1020 pub const RTA_UID: ::c_ushort = 25; 1021 pub const RTA_TTL_PROPAGATE: ::c_ushort = 26; 1022 1023 // linux/neighbor.h 1024 pub const NTF_EXT_LEARNED: u8 = 0x10; 1025 pub const NTF_OFFLOADED: u8 = 0x20; 1026 1027 pub const NDA_MASTER: ::c_ushort = 9; 1028 pub const NDA_LINK_NETNSID: ::c_ushort = 10; 1029 pub const NDA_SRC_VNI: ::c_ushort = 11; 1030 1031 // linux/personality.h 1032 pub const UNAME26: ::c_int = 0x0020000; 1033 pub const FDPIC_FUNCPTRS: ::c_int = 0x0080000; 1034 1035 // linux/if_addr.h 1036 pub const IFA_FLAGS: ::c_ushort = 8; 1037 1038 pub const IFA_F_MANAGETEMPADDR: u32 = 0x100; 1039 pub const IFA_F_NOPREFIXROUTE: u32 = 0x200; 1040 pub const IFA_F_MCAUTOJOIN: u32 = 0x400; 1041 pub const IFA_F_STABLE_PRIVACY: u32 = 0x800; 1042 1043 pub const MAX_LINKS: ::c_int = 32; 1044 1045 pub const GENL_UNS_ADMIN_PERM: ::c_int = 0x10; 1046 1047 pub const GENL_ID_VFS_DQUOT: ::c_int = ::NLMSG_MIN_TYPE + 1; 1048 pub const GENL_ID_PMCRAID: ::c_int = ::NLMSG_MIN_TYPE + 2; 1049 1050 // linux/if_xdp.h 1051 pub const XDP_SHARED_UMEM: ::__u16 = 1 << 0; 1052 pub const XDP_COPY: ::__u16 = 1 << 1; 1053 pub const XDP_ZEROCOPY: ::__u16 = 1 << 2; 1054 pub const XDP_USE_NEED_WAKEUP: ::__u16 = 1 << 3; 1055 pub const XDP_USE_SG: ::__u16 = 1 << 4; 1056 1057 pub const XDP_UMEM_UNALIGNED_CHUNK_FLAG: ::__u32 = 1 << 0; 1058 1059 pub const XDP_RING_NEED_WAKEUP: ::__u32 = 1 << 0; 1060 1061 pub const XDP_MMAP_OFFSETS: ::c_int = 1; 1062 pub const XDP_RX_RING: ::c_int = 2; 1063 pub const XDP_TX_RING: ::c_int = 3; 1064 pub const XDP_UMEM_REG: ::c_int = 4; 1065 pub const XDP_UMEM_FILL_RING: ::c_int = 5; 1066 pub const XDP_UMEM_COMPLETION_RING: ::c_int = 6; 1067 pub const XDP_STATISTICS: ::c_int = 7; 1068 pub const XDP_OPTIONS: ::c_int = 8; 1069 1070 pub const XDP_OPTIONS_ZEROCOPY: ::__u32 = 1 << 0; 1071 1072 pub const XDP_PGOFF_RX_RING: ::off_t = 0; 1073 pub const XDP_PGOFF_TX_RING: ::off_t = 0x80000000; 1074 pub const XDP_UMEM_PGOFF_FILL_RING: ::c_ulonglong = 0x100000000; 1075 pub const XDP_UMEM_PGOFF_COMPLETION_RING: ::c_ulonglong = 0x180000000; 1076 1077 pub const XSK_UNALIGNED_BUF_OFFSET_SHIFT: ::c_int = 48; 1078 pub const XSK_UNALIGNED_BUF_ADDR_MASK: ::c_ulonglong = (1 << XSK_UNALIGNED_BUF_OFFSET_SHIFT) - 1; 1079 1080 pub const XDP_PKT_CONTD: ::__u32 = 1 << 0; 1081 1082 pub const ELFOSABI_ARM_AEABI: u8 = 64; 1083 1084 // linux/sched.h 1085 pub const CLONE_NEWTIME: ::c_int = 0x80; 1086 // DIFF(main): changed to `c_ulonglong` in e9abac9ac2 1087 pub const CLONE_CLEAR_SIGHAND: ::c_int = 0x100000000; 1088 pub const CLONE_INTO_CGROUP: ::c_int = 0x200000000; 1089 1090 // linux/keyctl.h 1091 pub const KEYCTL_DH_COMPUTE: u32 = 23; 1092 pub const KEYCTL_PKEY_QUERY: u32 = 24; 1093 pub const KEYCTL_PKEY_ENCRYPT: u32 = 25; 1094 pub const KEYCTL_PKEY_DECRYPT: u32 = 26; 1095 pub const KEYCTL_PKEY_SIGN: u32 = 27; 1096 pub const KEYCTL_PKEY_VERIFY: u32 = 28; 1097 pub const KEYCTL_RESTRICT_KEYRING: u32 = 29; 1098 1099 pub const KEYCTL_SUPPORTS_ENCRYPT: u32 = 0x01; 1100 pub const KEYCTL_SUPPORTS_DECRYPT: u32 = 0x02; 1101 pub const KEYCTL_SUPPORTS_SIGN: u32 = 0x04; 1102 pub const KEYCTL_SUPPORTS_VERIFY: u32 = 0x08; 1103 cfg_if! { 1104 if #[cfg(not(any( 1105 target_arch = "mips", 1106 target_arch = "mips32r6", 1107 target_arch = "mips64", 1108 target_arch = "mips64r6" 1109 )))] { 1110 pub const KEYCTL_MOVE: u32 = 30; 1111 pub const KEYCTL_CAPABILITIES: u32 = 31; 1112 1113 pub const KEYCTL_CAPS0_CAPABILITIES: u32 = 0x01; 1114 pub const KEYCTL_CAPS0_PERSISTENT_KEYRINGS: u32 = 0x02; 1115 pub const KEYCTL_CAPS0_DIFFIE_HELLMAN: u32 = 0x04; 1116 pub const KEYCTL_CAPS0_PUBLIC_KEY: u32 = 0x08; 1117 pub const KEYCTL_CAPS0_BIG_KEY: u32 = 0x10; 1118 pub const KEYCTL_CAPS0_INVALIDATE: u32 = 0x20; 1119 pub const KEYCTL_CAPS0_RESTRICT_KEYRING: u32 = 0x40; 1120 pub const KEYCTL_CAPS0_MOVE: u32 = 0x80; 1121 pub const KEYCTL_CAPS1_NS_KEYRING_NAME: u32 = 0x01; 1122 pub const KEYCTL_CAPS1_NS_KEY_TAG: u32 = 0x02; 1123 } 1124 } 1125 1126 pub const M_MXFAST: ::c_int = 1; 1127 pub const M_NLBLKS: ::c_int = 2; 1128 pub const M_GRAIN: ::c_int = 3; 1129 pub const M_KEEP: ::c_int = 4; 1130 pub const M_TRIM_THRESHOLD: ::c_int = -1; 1131 pub const M_TOP_PAD: ::c_int = -2; 1132 pub const M_MMAP_THRESHOLD: ::c_int = -3; 1133 pub const M_MMAP_MAX: ::c_int = -4; 1134 pub const M_CHECK_ACTION: ::c_int = -5; 1135 pub const M_PERTURB: ::c_int = -6; 1136 pub const M_ARENA_TEST: ::c_int = -7; 1137 pub const M_ARENA_MAX: ::c_int = -8; 1138 1139 pub const SOMAXCONN: ::c_int = 4096; 1140 1141 // linux/mount.h 1142 pub const MOVE_MOUNT_F_SYMLINKS: ::c_uint = 0x00000001; 1143 pub const MOVE_MOUNT_F_AUTOMOUNTS: ::c_uint = 0x00000002; 1144 pub const MOVE_MOUNT_F_EMPTY_PATH: ::c_uint = 0x00000004; 1145 pub const MOVE_MOUNT_T_SYMLINKS: ::c_uint = 0x00000010; 1146 pub const MOVE_MOUNT_T_AUTOMOUNTS: ::c_uint = 0x00000020; 1147 pub const MOVE_MOUNT_T_EMPTY_PATH: ::c_uint = 0x00000040; 1148 pub const MOVE_MOUNT_SET_GROUP: ::c_uint = 0x00000100; 1149 pub const MOVE_MOUNT_BENEATH: ::c_uint = 0x00000200; 1150 1151 // sys/timex.h 1152 pub const ADJ_OFFSET: ::c_uint = 0x0001; 1153 pub const ADJ_FREQUENCY: ::c_uint = 0x0002; 1154 pub const ADJ_MAXERROR: ::c_uint = 0x0004; 1155 pub const ADJ_ESTERROR: ::c_uint = 0x0008; 1156 pub const ADJ_STATUS: ::c_uint = 0x0010; 1157 pub const ADJ_TIMECONST: ::c_uint = 0x0020; 1158 pub const ADJ_TAI: ::c_uint = 0x0080; 1159 pub const ADJ_SETOFFSET: ::c_uint = 0x0100; 1160 pub const ADJ_MICRO: ::c_uint = 0x1000; 1161 pub const ADJ_NANO: ::c_uint = 0x2000; 1162 pub const ADJ_TICK: ::c_uint = 0x4000; 1163 pub const ADJ_OFFSET_SINGLESHOT: ::c_uint = 0x8001; 1164 pub const ADJ_OFFSET_SS_READ: ::c_uint = 0xa001; 1165 pub const MOD_OFFSET: ::c_uint = ADJ_OFFSET; 1166 pub const MOD_FREQUENCY: ::c_uint = ADJ_FREQUENCY; 1167 pub const MOD_MAXERROR: ::c_uint = ADJ_MAXERROR; 1168 pub const MOD_ESTERROR: ::c_uint = ADJ_ESTERROR; 1169 pub const MOD_STATUS: ::c_uint = ADJ_STATUS; 1170 pub const MOD_TIMECONST: ::c_uint = ADJ_TIMECONST; 1171 pub const MOD_CLKB: ::c_uint = ADJ_TICK; 1172 pub const MOD_CLKA: ::c_uint = ADJ_OFFSET_SINGLESHOT; 1173 pub const MOD_TAI: ::c_uint = ADJ_TAI; 1174 pub const MOD_MICRO: ::c_uint = ADJ_MICRO; 1175 pub const MOD_NANO: ::c_uint = ADJ_NANO; 1176 pub const STA_PLL: ::c_int = 0x0001; 1177 pub const STA_PPSFREQ: ::c_int = 0x0002; 1178 pub const STA_PPSTIME: ::c_int = 0x0004; 1179 pub const STA_FLL: ::c_int = 0x0008; 1180 pub const STA_INS: ::c_int = 0x0010; 1181 pub const STA_DEL: ::c_int = 0x0020; 1182 pub const STA_UNSYNC: ::c_int = 0x0040; 1183 pub const STA_FREQHOLD: ::c_int = 0x0080; 1184 pub const STA_PPSSIGNAL: ::c_int = 0x0100; 1185 pub const STA_PPSJITTER: ::c_int = 0x0200; 1186 pub const STA_PPSWANDER: ::c_int = 0x0400; 1187 pub const STA_PPSERROR: ::c_int = 0x0800; 1188 pub const STA_CLOCKERR: ::c_int = 0x1000; 1189 pub const STA_NANO: ::c_int = 0x2000; 1190 pub const STA_MODE: ::c_int = 0x4000; 1191 pub const STA_CLK: ::c_int = 0x8000; 1192 pub const STA_RONLY: ::c_int = STA_PPSSIGNAL 1193 | STA_PPSJITTER 1194 | STA_PPSWANDER 1195 | STA_PPSERROR 1196 | STA_CLOCKERR 1197 | STA_NANO 1198 | STA_MODE 1199 | STA_CLK; 1200 pub const NTP_API: ::c_int = 4; 1201 pub const TIME_OK: ::c_int = 0; 1202 pub const TIME_INS: ::c_int = 1; 1203 pub const TIME_DEL: ::c_int = 2; 1204 pub const TIME_OOP: ::c_int = 3; 1205 pub const TIME_WAIT: ::c_int = 4; 1206 pub const TIME_ERROR: ::c_int = 5; 1207 pub const TIME_BAD: ::c_int = TIME_ERROR; 1208 pub const MAXTC: ::c_long = 6; 1209 1210 // Portable GLOB_* flags are defined at the `linux_like` level. 1211 // The following are GNU extensions. 1212 pub const GLOB_PERIOD: ::c_int = 1 << 7; 1213 pub const GLOB_ALTDIRFUNC: ::c_int = 1 << 9; 1214 pub const GLOB_BRACE: ::c_int = 1 << 10; 1215 pub const GLOB_NOMAGIC: ::c_int = 1 << 11; 1216 pub const GLOB_TILDE: ::c_int = 1 << 12; 1217 pub const GLOB_ONLYDIR: ::c_int = 1 << 13; 1218 pub const GLOB_TILDE_CHECK: ::c_int = 1 << 14; 1219 1220 pub const MADV_COLLAPSE: ::c_int = 25; 1221 1222 cfg_if! { 1223 if #[cfg(any( 1224 target_arch = "arm", 1225 target_arch = "x86", 1226 target_arch = "x86_64", 1227 target_arch = "s390x", 1228 target_arch = "riscv64", 1229 target_arch = "riscv32" 1230 ))] { 1231 pub const PTHREAD_STACK_MIN: ::size_t = 16384; 1232 } else if #[cfg(any(target_arch = "sparc", target_arch = "sparc64"))] { 1233 pub const PTHREAD_STACK_MIN: ::size_t = 0x6000; 1234 } else { 1235 pub const PTHREAD_STACK_MIN: ::size_t = 131072; 1236 } 1237 } 1238 pub const PTHREAD_MUTEX_ADAPTIVE_NP: ::c_int = 3; 1239 1240 pub const REG_STARTEND: ::c_int = 4; 1241 1242 pub const REG_EEND: ::c_int = 14; 1243 pub const REG_ESIZE: ::c_int = 15; 1244 pub const REG_ERPAREN: ::c_int = 16; 1245 1246 cfg_if! { 1247 if #[cfg(any( 1248 target_arch = "x86", 1249 target_arch = "x86_64", 1250 target_arch = "arm", 1251 target_arch = "aarch64", 1252 target_arch = "loongarch64", 1253 target_arch = "riscv64", 1254 target_arch = "s390x" 1255 ))] { 1256 pub const TUNSETCARRIER: ::Ioctl = 0x400454e2; 1257 pub const TUNGETDEVNETNS: ::Ioctl = 0x54e3; 1258 } else if #[cfg(any( 1259 target_arch = "mips", 1260 target_arch = "mips64", 1261 target_arch = "powerpc", 1262 target_arch = "powerpc64", 1263 target_arch = "sparc", 1264 target_arch = "sparc64" 1265 ))] { 1266 pub const TUNSETCARRIER: ::Ioctl = 0x800454e2; 1267 pub const TUNGETDEVNETNS: ::Ioctl = 0x200054e3; 1268 } else { 1269 // Unknown target_arch 1270 } 1271 } 1272 1273 extern "C" { 1274 pub fn fgetspent_r( 1275 fp: *mut ::FILE, 1276 spbuf: *mut ::spwd, 1277 buf: *mut ::c_char, 1278 buflen: ::size_t, 1279 spbufp: *mut *mut ::spwd, 1280 ) -> ::c_int; 1281 pub fn sgetspent_r( 1282 s: *const ::c_char, 1283 spbuf: *mut ::spwd, 1284 buf: *mut ::c_char, 1285 buflen: ::size_t, 1286 spbufp: *mut *mut ::spwd, 1287 ) -> ::c_int; 1288 pub fn getspent_r( 1289 spbuf: *mut ::spwd, 1290 buf: *mut ::c_char, 1291 buflen: ::size_t, 1292 spbufp: *mut *mut ::spwd, 1293 ) -> ::c_int; 1294 pub fn qsort_r( 1295 base: *mut ::c_void, 1296 num: ::size_t, 1297 size: ::size_t, 1298 compar: ::Option< 1299 unsafe extern "C" fn(*const ::c_void, *const ::c_void, *mut ::c_void) -> ::c_int, 1300 >, 1301 arg: *mut ::c_void, 1302 ); 1303 pub fn sendmmsg( 1304 sockfd: ::c_int, 1305 msgvec: *mut ::mmsghdr, 1306 vlen: ::c_uint, 1307 flags: ::c_int, 1308 ) -> ::c_int; 1309 pub fn recvmmsg( 1310 sockfd: ::c_int, 1311 msgvec: *mut ::mmsghdr, 1312 vlen: ::c_uint, 1313 flags: ::c_int, 1314 timeout: *mut ::timespec, 1315 ) -> ::c_int; 1316 1317 pub fn getrlimit64(resource: ::__rlimit_resource_t, rlim: *mut ::rlimit64) -> ::c_int; 1318 pub fn setrlimit64(resource: ::__rlimit_resource_t, rlim: *const ::rlimit64) -> ::c_int; 1319 pub fn getrlimit(resource: ::__rlimit_resource_t, rlim: *mut ::rlimit) -> ::c_int; 1320 pub fn setrlimit(resource: ::__rlimit_resource_t, rlim: *const ::rlimit) -> ::c_int; 1321 pub fn prlimit( 1322 pid: ::pid_t, 1323 resource: ::__rlimit_resource_t, 1324 new_limit: *const ::rlimit, 1325 old_limit: *mut ::rlimit, 1326 ) -> ::c_int; 1327 pub fn prlimit64( 1328 pid: ::pid_t, 1329 resource: ::__rlimit_resource_t, 1330 new_limit: *const ::rlimit64, 1331 old_limit: *mut ::rlimit64, 1332 ) -> ::c_int; 1333 pub fn utmpname(file: *const ::c_char) -> ::c_int; 1334 pub fn utmpxname(file: *const ::c_char) -> ::c_int; 1335 pub fn getutxent() -> *mut utmpx; 1336 pub fn getutxid(ut: *const utmpx) -> *mut utmpx; 1337 pub fn getutxline(ut: *const utmpx) -> *mut utmpx; 1338 pub fn pututxline(ut: *const utmpx) -> *mut utmpx; 1339 pub fn setutxent(); 1340 pub fn endutxent(); 1341 pub fn getpt() -> ::c_int; 1342 pub fn mallopt(param: ::c_int, value: ::c_int) -> ::c_int; 1343 pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int; 1344 pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int; 1345 pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t; 1346 pub fn getauxval(type_: ::c_ulong) -> ::c_ulong; 1347 1348 pub fn adjtimex(buf: *mut timex) -> ::c_int; 1349 pub fn ntp_adjtime(buf: *mut timex) -> ::c_int; 1350 #[link_name = "ntp_gettimex"] 1351 pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int; 1352 pub fn clock_adjtime(clk_id: ::clockid_t, buf: *mut ::timex) -> ::c_int; 1353 1354 pub fn fanotify_mark( 1355 fd: ::c_int, 1356 flags: ::c_uint, 1357 mask: u64, 1358 dirfd: ::c_int, 1359 path: *const ::c_char, 1360 ) -> ::c_int; 1361 pub fn preadv2( 1362 fd: ::c_int, 1363 iov: *const ::iovec, 1364 iovcnt: ::c_int, 1365 offset: ::off_t, 1366 flags: ::c_int, 1367 ) -> ::ssize_t; 1368 pub fn pwritev2( 1369 fd: ::c_int, 1370 iov: *const ::iovec, 1371 iovcnt: ::c_int, 1372 offset: ::off_t, 1373 flags: ::c_int, 1374 ) -> ::ssize_t; 1375 pub fn preadv64v2( 1376 fd: ::c_int, 1377 iov: *const ::iovec, 1378 iovcnt: ::c_int, 1379 offset: ::off64_t, 1380 flags: ::c_int, 1381 ) -> ::ssize_t; 1382 pub fn pwritev64v2( 1383 fd: ::c_int, 1384 iov: *const ::iovec, 1385 iovcnt: ::c_int, 1386 offset: ::off64_t, 1387 flags: ::c_int, 1388 ) -> ::ssize_t; 1389 pub fn renameat2( 1390 olddirfd: ::c_int, 1391 oldpath: *const ::c_char, 1392 newdirfd: ::c_int, 1393 newpath: *const ::c_char, 1394 flags: ::c_uint, 1395 ) -> ::c_int; 1396 1397 // Added in `glibc` 2.25 1398 pub fn explicit_bzero(s: *mut ::c_void, len: ::size_t); 1399 // Added in `glibc` 2.29 1400 pub fn reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void; 1401 1402 pub fn ctermid(s: *mut ::c_char) -> *mut ::c_char; 1403 pub fn backtrace(buf: *mut *mut ::c_void, sz: ::c_int) -> ::c_int; 1404 pub fn glob64( 1405 pattern: *const ::c_char, 1406 flags: ::c_int, 1407 errfunc: ::Option<extern "C" fn(epath: *const ::c_char, errno: ::c_int) -> ::c_int>, 1408 pglob: *mut glob64_t, 1409 ) -> ::c_int; 1410 pub fn globfree64(pglob: *mut glob64_t); 1411 pub fn ptrace(request: ::c_uint, ...) -> ::c_long; 1412 pub fn pthread_attr_getaffinity_np( 1413 attr: *const ::pthread_attr_t, 1414 cpusetsize: ::size_t, 1415 cpuset: *mut ::cpu_set_t, 1416 ) -> ::c_int; 1417 pub fn pthread_attr_setaffinity_np( 1418 attr: *mut ::pthread_attr_t, 1419 cpusetsize: ::size_t, 1420 cpuset: *const ::cpu_set_t, 1421 ) -> ::c_int; 1422 pub fn getpriority(which: ::__priority_which_t, who: ::id_t) -> ::c_int; 1423 pub fn setpriority(which: ::__priority_which_t, who: ::id_t, prio: ::c_int) -> ::c_int; 1424 pub fn pthread_rwlockattr_getkind_np( 1425 attr: *const ::pthread_rwlockattr_t, 1426 val: *mut ::c_int, 1427 ) -> ::c_int; 1428 pub fn pthread_rwlockattr_setkind_np( 1429 attr: *mut ::pthread_rwlockattr_t, 1430 val: ::c_int, 1431 ) -> ::c_int; 1432 pub fn pthread_sigqueue(thread: ::pthread_t, sig: ::c_int, value: ::sigval) -> ::c_int; 1433 pub fn mallinfo() -> ::mallinfo; 1434 pub fn mallinfo2() -> ::mallinfo2; 1435 pub fn malloc_stats(); 1436 pub fn malloc_info(options: ::c_int, stream: *mut ::FILE) -> ::c_int; 1437 pub fn malloc_usable_size(ptr: *mut ::c_void) -> ::size_t; 1438 pub fn getpwent_r( 1439 pwd: *mut ::passwd, 1440 buf: *mut ::c_char, 1441 buflen: ::size_t, 1442 result: *mut *mut ::passwd, 1443 ) -> ::c_int; 1444 pub fn getgrent_r( 1445 grp: *mut ::group, 1446 buf: *mut ::c_char, 1447 buflen: ::size_t, 1448 result: *mut *mut ::group, 1449 ) -> ::c_int; 1450 pub fn fgetpwent_r( 1451 stream: *mut ::FILE, 1452 pwd: *mut ::passwd, 1453 buf: *mut ::c_char, 1454 buflen: ::size_t, 1455 result: *mut *mut ::passwd, 1456 ) -> ::c_int; 1457 pub fn fgetgrent_r( 1458 stream: *mut ::FILE, 1459 grp: *mut ::group, 1460 buf: *mut ::c_char, 1461 buflen: ::size_t, 1462 result: *mut *mut ::group, 1463 ) -> ::c_int; 1464 1465 pub fn putpwent(p: *const ::passwd, stream: *mut ::FILE) -> ::c_int; 1466 pub fn putgrent(grp: *const ::group, stream: *mut ::FILE) -> ::c_int; 1467 1468 pub fn sethostid(hostid: ::c_long) -> ::c_int; 1469 1470 pub fn memfd_create(name: *const ::c_char, flags: ::c_uint) -> ::c_int; 1471 pub fn mlock2(addr: *const ::c_void, len: ::size_t, flags: ::c_uint) -> ::c_int; 1472 1473 pub fn euidaccess(pathname: *const ::c_char, mode: ::c_int) -> ::c_int; 1474 pub fn eaccess(pathname: *const ::c_char, mode: ::c_int) -> ::c_int; 1475 1476 pub fn asctime_r(tm: *const ::tm, buf: *mut ::c_char) -> *mut ::c_char; 1477 pub fn ctime_r(timep: *const time_t, buf: *mut ::c_char) -> *mut ::c_char; 1478 1479 pub fn dirname(path: *mut ::c_char) -> *mut ::c_char; 1480 /// POSIX version of `basename(3)`, defined in `libgen.h`. 1481 #[link_name = "__xpg_basename"] 1482 pub fn posix_basename(path: *mut ::c_char) -> *mut ::c_char; 1483 /// GNU version of `basename(3)`, defined in `string.h`. 1484 #[link_name = "basename"] 1485 pub fn gnu_basename(path: *const ::c_char) -> *mut ::c_char; 1486 pub fn dlmopen(lmid: Lmid_t, filename: *const ::c_char, flag: ::c_int) -> *mut ::c_void; 1487 pub fn dlinfo(handle: *mut ::c_void, request: ::c_int, info: *mut ::c_void) -> ::c_int; 1488 pub fn dladdr1( 1489 addr: *const ::c_void, 1490 info: *mut ::Dl_info, 1491 extra_info: *mut *mut ::c_void, 1492 flags: ::c_int, 1493 ) -> ::c_int; 1494 pub fn malloc_trim(__pad: ::size_t) -> ::c_int; 1495 pub fn gnu_get_libc_release() -> *const ::c_char; 1496 pub fn gnu_get_libc_version() -> *const ::c_char; 1497 1498 // posix/spawn.h 1499 // Added in `glibc` 2.29 1500 pub fn posix_spawn_file_actions_addchdir_np( 1501 actions: *mut ::posix_spawn_file_actions_t, 1502 path: *const ::c_char, 1503 ) -> ::c_int; 1504 // Added in `glibc` 2.29 1505 pub fn posix_spawn_file_actions_addfchdir_np( 1506 actions: *mut ::posix_spawn_file_actions_t, 1507 fd: ::c_int, 1508 ) -> ::c_int; 1509 // Added in `glibc` 2.34 1510 pub fn posix_spawn_file_actions_addclosefrom_np( 1511 actions: *mut ::posix_spawn_file_actions_t, 1512 from: ::c_int, 1513 ) -> ::c_int; 1514 // Added in `glibc` 2.35 1515 pub fn posix_spawn_file_actions_addtcsetpgrp_np( 1516 actions: *mut ::posix_spawn_file_actions_t, 1517 tcfd: ::c_int, 1518 ) -> ::c_int; 1519 1520 // mntent.h 1521 pub fn getmntent_r( 1522 stream: *mut ::FILE, 1523 mntbuf: *mut ::mntent, 1524 buf: *mut ::c_char, 1525 buflen: ::c_int, 1526 ) -> *mut ::mntent; 1527 1528 pub fn execveat( 1529 dirfd: ::c_int, 1530 pathname: *const ::c_char, 1531 argv: *const *mut c_char, 1532 envp: *const *mut c_char, 1533 flags: ::c_int, 1534 ) -> ::c_int; 1535 1536 // Added in `glibc` 2.34 1537 pub fn close_range(first: ::c_uint, last: ::c_uint, flags: ::c_int) -> ::c_int; 1538 1539 pub fn mq_notify(mqdes: ::mqd_t, sevp: *const ::sigevent) -> ::c_int; 1540 1541 pub fn epoll_pwait2( 1542 epfd: ::c_int, 1543 events: *mut ::epoll_event, 1544 maxevents: ::c_int, 1545 timeout: *const ::timespec, 1546 sigmask: *const ::sigset_t, 1547 ) -> ::c_int; 1548 } 1549 1550 cfg_if! { 1551 if #[cfg(any( 1552 target_arch = "x86", 1553 target_arch = "arm", 1554 target_arch = "m68k", 1555 target_arch = "csky", 1556 target_arch = "mips", 1557 target_arch = "mips32r6", 1558 target_arch = "powerpc", 1559 target_arch = "sparc", 1560 target_arch = "riscv32" 1561 ))] { 1562 mod b32; 1563 pub use self::b32::*; 1564 } else if #[cfg(any( 1565 target_arch = "x86_64", 1566 target_arch = "aarch64", 1567 target_arch = "powerpc64", 1568 target_arch = "mips64", 1569 target_arch = "mips64r6", 1570 target_arch = "s390x", 1571 target_arch = "sparc64", 1572 target_arch = "riscv64", 1573 target_arch = "loongarch64" 1574 ))] { 1575 mod b64; 1576 pub use self::b64::*; 1577 } else { 1578 // Unknown target_arch 1579 } 1580 } 1581