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