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 s! { 8 pub struct statx { 9 pub stx_mask: u32, 10 pub stx_blksize: u32, 11 pub stx_attributes: u64, 12 pub stx_nlink: u32, 13 pub stx_uid: u32, 14 pub stx_gid: u32, 15 pub stx_mode: u16, 16 __statx_pad1: [u16; 1], 17 pub stx_ino: u64, 18 pub stx_size: u64, 19 pub stx_blocks: u64, 20 pub stx_attributes_mask: u64, 21 pub stx_atime: ::statx_timestamp, 22 pub stx_btime: ::statx_timestamp, 23 pub stx_ctime: ::statx_timestamp, 24 pub stx_mtime: ::statx_timestamp, 25 pub stx_rdev_major: u32, 26 pub stx_rdev_minor: u32, 27 pub stx_dev_major: u32, 28 pub stx_dev_minor: u32, 29 pub stx_mnt_id: u64, 30 __statx_pad2: u64, 31 __statx_pad3: [u64; 12], 32 } 33 34 pub struct statx_timestamp { 35 pub tv_sec: i64, 36 pub tv_nsec: u32, 37 pub __statx_timestamp_pad1: [i32; 1], 38 } 39 40 pub struct aiocb { 41 pub aio_fildes: ::c_int, 42 pub aio_lio_opcode: ::c_int, 43 pub aio_reqprio: ::c_int, 44 pub aio_buf: *mut ::c_void, 45 pub aio_nbytes: ::size_t, 46 pub aio_sigevent: ::sigevent, 47 __next_prio: *mut aiocb, 48 __abs_prio: ::c_int, 49 __policy: ::c_int, 50 __error_code: ::c_int, 51 __return_value: ::ssize_t, 52 pub aio_offset: off_t, 53 #[cfg(all(not(target_arch = "x86_64"), target_pointer_width = "32"))] 54 __unused1: [::c_char; 4], 55 __glibc_reserved: [::c_char; 32] 56 } 57 58 pub struct __exit_status { 59 pub e_termination: ::c_short, 60 pub e_exit: ::c_short, 61 } 62 63 pub struct __timeval { 64 pub tv_sec: i32, 65 pub tv_usec: i32, 66 } 67 68 pub struct glob64_t { 69 pub gl_pathc: ::size_t, 70 pub gl_pathv: *mut *mut ::c_char, 71 pub gl_offs: ::size_t, 72 pub gl_flags: ::c_int, 73 74 __unused1: *mut ::c_void, 75 __unused2: *mut ::c_void, 76 __unused3: *mut ::c_void, 77 __unused4: *mut ::c_void, 78 __unused5: *mut ::c_void, 79 } 80 81 pub struct msghdr { 82 pub msg_name: *mut ::c_void, 83 pub msg_namelen: ::socklen_t, 84 pub msg_iov: *mut ::iovec, 85 pub msg_iovlen: ::size_t, 86 pub msg_control: *mut ::c_void, 87 pub msg_controllen: ::size_t, 88 pub msg_flags: ::c_int, 89 } 90 91 pub struct cmsghdr { 92 pub cmsg_len: ::size_t, 93 pub cmsg_level: ::c_int, 94 pub cmsg_type: ::c_int, 95 } 96 97 pub struct termios { 98 pub c_iflag: ::tcflag_t, 99 pub c_oflag: ::tcflag_t, 100 pub c_cflag: ::tcflag_t, 101 pub c_lflag: ::tcflag_t, 102 pub c_line: ::cc_t, 103 pub c_cc: [::cc_t; ::NCCS], 104 #[cfg(not(any( 105 target_arch = "sparc", 106 target_arch = "sparc64", 107 target_arch = "mips", 108 target_arch = "mips64")))] 109 pub c_ispeed: ::speed_t, 110 #[cfg(not(any( 111 target_arch = "sparc", 112 target_arch = "sparc64", 113 target_arch = "mips", 114 target_arch = "mips64")))] 115 pub c_ospeed: ::speed_t, 116 } 117 118 pub struct mallinfo { 119 pub arena: ::c_int, 120 pub ordblks: ::c_int, 121 pub smblks: ::c_int, 122 pub hblks: ::c_int, 123 pub hblkhd: ::c_int, 124 pub usmblks: ::c_int, 125 pub fsmblks: ::c_int, 126 pub uordblks: ::c_int, 127 pub fordblks: ::c_int, 128 pub keepcost: ::c_int, 129 } 130 131 pub struct nlmsghdr { 132 pub nlmsg_len: u32, 133 pub nlmsg_type: u16, 134 pub nlmsg_flags: u16, 135 pub nlmsg_seq: u32, 136 pub nlmsg_pid: u32, 137 } 138 139 pub struct nlmsgerr { 140 pub error: ::c_int, 141 pub msg: nlmsghdr, 142 } 143 144 pub struct nl_pktinfo { 145 pub group: u32, 146 } 147 148 pub struct nl_mmap_req { 149 pub nm_block_size: ::c_uint, 150 pub nm_block_nr: ::c_uint, 151 pub nm_frame_size: ::c_uint, 152 pub nm_frame_nr: ::c_uint, 153 } 154 155 pub struct nl_mmap_hdr { 156 pub nm_status: ::c_uint, 157 pub nm_len: ::c_uint, 158 pub nm_group: u32, 159 pub nm_pid: u32, 160 pub nm_uid: u32, 161 pub nm_gid: u32, 162 } 163 164 pub struct nlattr { 165 pub nla_len: u16, 166 pub nla_type: u16, 167 } 168 169 pub struct rtentry { 170 pub rt_pad1: ::c_ulong, 171 pub rt_dst: ::sockaddr, 172 pub rt_gateway: ::sockaddr, 173 pub rt_genmask: ::sockaddr, 174 pub rt_flags: ::c_ushort, 175 pub rt_pad2: ::c_short, 176 pub rt_pad3: ::c_ulong, 177 pub rt_tos: ::c_uchar, 178 pub rt_class: ::c_uchar, 179 #[cfg(target_pointer_width = "64")] 180 pub rt_pad4: [::c_short; 3usize], 181 #[cfg(not(target_pointer_width = "64"))] 182 pub rt_pad4: ::c_short, 183 pub rt_metric: ::c_short, 184 pub rt_dev: *mut ::c_char, 185 pub rt_mtu: ::c_ulong, 186 pub rt_window: ::c_ulong, 187 pub rt_irtt: ::c_ushort, 188 } 189 190 pub struct timex { 191 pub modes: ::c_uint, 192 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] 193 pub offset: i64, 194 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] 195 pub offset: ::c_long, 196 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] 197 pub freq: i64, 198 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] 199 pub freq: ::c_long, 200 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] 201 pub maxerror: i64, 202 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] 203 pub maxerror: ::c_long, 204 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] 205 pub esterror: i64, 206 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] 207 pub esterror: ::c_long, 208 pub status: ::c_int, 209 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] 210 pub constant: i64, 211 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] 212 pub constant: ::c_long, 213 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] 214 pub precision: i64, 215 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] 216 pub precision: ::c_long, 217 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] 218 pub tolerance: i64, 219 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] 220 pub tolerance: ::c_long, 221 pub time: ::timeval, 222 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] 223 pub tick: i64, 224 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] 225 pub tick: ::c_long, 226 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] 227 pub ppsfreq: i64, 228 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] 229 pub ppsfreq: ::c_long, 230 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] 231 pub jitter: i64, 232 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] 233 pub jitter: ::c_long, 234 pub shift: ::c_int, 235 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] 236 pub stabil: i64, 237 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] 238 pub stabil: ::c_long, 239 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] 240 pub jitcnt: i64, 241 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] 242 pub jitcnt: ::c_long, 243 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] 244 pub calcnt: i64, 245 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] 246 pub calcnt: ::c_long, 247 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] 248 pub errcnt: i64, 249 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] 250 pub errcnt: ::c_long, 251 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] 252 pub stbcnt: i64, 253 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] 254 pub stbcnt: ::c_long, 255 pub tai: ::c_int, 256 pub __unused1: i32, 257 pub __unused2: i32, 258 pub __unused3: i32, 259 pub __unused4: i32, 260 pub __unused5: i32, 261 pub __unused6: i32, 262 pub __unused7: i32, 263 pub __unused8: i32, 264 pub __unused9: i32, 265 pub __unused10: i32, 266 pub __unused11: i32, 267 } 268 269 pub struct ntptimeval { 270 pub time: ::timeval, 271 pub maxerror: ::c_long, 272 pub esterror: ::c_long, 273 pub tai: ::c_long, 274 pub __glibc_reserved1: ::c_long, 275 pub __glibc_reserved2: ::c_long, 276 pub __glibc_reserved3: ::c_long, 277 pub __glibc_reserved4: ::c_long, 278 } 279 280 pub struct regex_t { 281 __buffer: *mut ::c_void, 282 __allocated: ::size_t, 283 __used: ::size_t, 284 __syntax: ::c_ulong, 285 __fastmap: *mut ::c_char, 286 __translate: *mut ::c_char, 287 __re_nsub: ::size_t, 288 __bitfield: u8, 289 } 290 } 291 292 impl siginfo_t { 293 pub unsafe fn si_addr(&self) -> *mut ::c_void { 294 #[repr(C)] 295 struct siginfo_sigfault { 296 _si_signo: ::c_int, 297 _si_errno: ::c_int, 298 _si_code: ::c_int, 299 si_addr: *mut ::c_void, 300 } 301 (*(self as *const siginfo_t as *const siginfo_sigfault)).si_addr 302 } 303 304 pub unsafe fn si_value(&self) -> ::sigval { 305 #[repr(C)] 306 struct siginfo_timer { 307 _si_signo: ::c_int, 308 _si_errno: ::c_int, 309 _si_code: ::c_int, 310 _si_tid: ::c_int, 311 _si_overrun: ::c_int, 312 si_sigval: ::sigval, 313 } 314 (*(self as *const siginfo_t as *const siginfo_timer)).si_sigval 315 } 316 } 317 318 cfg_if! { 319 if #[cfg(libc_union)] { 320 // Internal, for casts to access union fields 321 #[repr(C)] 322 struct sifields_sigchld { 323 si_pid: ::pid_t, 324 si_uid: ::uid_t, 325 si_status: ::c_int, 326 si_utime: ::c_long, 327 si_stime: ::c_long, 328 } 329 impl ::Copy for sifields_sigchld {} 330 impl ::Clone for sifields_sigchld { 331 fn clone(&self) -> sifields_sigchld { 332 *self 333 } 334 } 335 336 // Internal, for casts to access union fields 337 #[repr(C)] 338 union sifields { 339 _align_pointer: *mut ::c_void, 340 sigchld: sifields_sigchld, 341 } 342 343 // Internal, for casts to access union fields. Note that some variants 344 // of sifields start with a pointer, which makes the alignment of 345 // sifields vary on 32-bit and 64-bit architectures. 346 #[repr(C)] 347 struct siginfo_f { 348 _siginfo_base: [::c_int; 3], 349 sifields: sifields, 350 } 351 352 impl siginfo_t { 353 unsafe fn sifields(&self) -> &sifields { 354 &(*(self as *const siginfo_t as *const siginfo_f)).sifields 355 } 356 357 pub unsafe fn si_pid(&self) -> ::pid_t { 358 self.sifields().sigchld.si_pid 359 } 360 361 pub unsafe fn si_uid(&self) -> ::uid_t { 362 self.sifields().sigchld.si_uid 363 } 364 365 pub unsafe fn si_status(&self) -> ::c_int { 366 self.sifields().sigchld.si_status 367 } 368 369 pub unsafe fn si_utime(&self) -> ::c_long { 370 self.sifields().sigchld.si_utime 371 } 372 373 pub unsafe fn si_stime(&self) -> ::c_long { 374 self.sifields().sigchld.si_stime 375 } 376 } 377 } 378 } 379 380 s_no_extra_traits! { 381 pub struct utmpx { 382 pub ut_type: ::c_short, 383 pub ut_pid: ::pid_t, 384 pub ut_line: [::c_char; __UT_LINESIZE], 385 pub ut_id: [::c_char; 4], 386 387 pub ut_user: [::c_char; __UT_NAMESIZE], 388 pub ut_host: [::c_char; __UT_HOSTSIZE], 389 pub ut_exit: __exit_status, 390 391 #[cfg(any(target_arch = "aarch64", 392 target_arch = "s390x", 393 all(target_pointer_width = "32", 394 not(target_arch = "x86_64"))))] 395 pub ut_session: ::c_long, 396 #[cfg(any(target_arch = "aarch64", 397 target_arch = "s390x", 398 all(target_pointer_width = "32", 399 not(target_arch = "x86_64"))))] 400 pub ut_tv: ::timeval, 401 402 #[cfg(not(any(target_arch = "aarch64", 403 target_arch = "s390x", 404 all(target_pointer_width = "32", 405 not(target_arch = "x86_64")))))] 406 pub ut_session: i32, 407 #[cfg(not(any(target_arch = "aarch64", 408 target_arch = "s390x", 409 all(target_pointer_width = "32", 410 not(target_arch = "x86_64")))))] 411 pub ut_tv: __timeval, 412 413 pub ut_addr_v6: [i32; 4], 414 __glibc_reserved: [::c_char; 20], 415 } 416 } 417 418 cfg_if! { 419 if #[cfg(feature = "extra_traits")] { 420 impl PartialEq for utmpx { 421 fn eq(&self, other: &utmpx) -> bool { 422 self.ut_type == other.ut_type 423 && self.ut_pid == other.ut_pid 424 && self.ut_line == other.ut_line 425 && self.ut_id == other.ut_id 426 && self.ut_user == other.ut_user 427 && self 428 .ut_host 429 .iter() 430 .zip(other.ut_host.iter()) 431 .all(|(a,b)| a == b) 432 && self.ut_exit == other.ut_exit 433 && self.ut_session == other.ut_session 434 && self.ut_tv == other.ut_tv 435 && self.ut_addr_v6 == other.ut_addr_v6 436 && self.__glibc_reserved == other.__glibc_reserved 437 } 438 } 439 440 impl Eq for utmpx {} 441 442 impl ::fmt::Debug for utmpx { 443 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 444 f.debug_struct("utmpx") 445 .field("ut_type", &self.ut_type) 446 .field("ut_pid", &self.ut_pid) 447 .field("ut_line", &self.ut_line) 448 .field("ut_id", &self.ut_id) 449 .field("ut_user", &self.ut_user) 450 // FIXME: .field("ut_host", &self.ut_host) 451 .field("ut_exit", &self.ut_exit) 452 .field("ut_session", &self.ut_session) 453 .field("ut_tv", &self.ut_tv) 454 .field("ut_addr_v6", &self.ut_addr_v6) 455 .field("__glibc_reserved", &self.__glibc_reserved) 456 .finish() 457 } 458 } 459 460 impl ::hash::Hash for utmpx { 461 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 462 self.ut_type.hash(state); 463 self.ut_pid.hash(state); 464 self.ut_line.hash(state); 465 self.ut_id.hash(state); 466 self.ut_user.hash(state); 467 self.ut_host.hash(state); 468 self.ut_exit.hash(state); 469 self.ut_session.hash(state); 470 self.ut_tv.hash(state); 471 self.ut_addr_v6.hash(state); 472 self.__glibc_reserved.hash(state); 473 } 474 } 475 } 476 } 477 478 // include/uapi/asm-generic/hugetlb_encode.h 479 pub const HUGETLB_FLAG_ENCODE_SHIFT: ::c_int = 26; 480 pub const HUGETLB_FLAG_ENCODE_MASK: ::c_int = 0x3f; 481 482 pub const HUGETLB_FLAG_ENCODE_64KB: ::c_int = 16 << HUGETLB_FLAG_ENCODE_SHIFT; 483 pub const HUGETLB_FLAG_ENCODE_512KB: ::c_int = 19 << HUGETLB_FLAG_ENCODE_SHIFT; 484 pub const HUGETLB_FLAG_ENCODE_1MB: ::c_int = 20 << HUGETLB_FLAG_ENCODE_SHIFT; 485 pub const HUGETLB_FLAG_ENCODE_2MB: ::c_int = 21 << HUGETLB_FLAG_ENCODE_SHIFT; 486 pub const HUGETLB_FLAG_ENCODE_8MB: ::c_int = 23 << HUGETLB_FLAG_ENCODE_SHIFT; 487 pub const HUGETLB_FLAG_ENCODE_16MB: ::c_int = 24 << HUGETLB_FLAG_ENCODE_SHIFT; 488 pub const HUGETLB_FLAG_ENCODE_32MB: ::c_int = 25 << HUGETLB_FLAG_ENCODE_SHIFT; 489 pub const HUGETLB_FLAG_ENCODE_256MB: ::c_int = 28 << HUGETLB_FLAG_ENCODE_SHIFT; 490 pub const HUGETLB_FLAG_ENCODE_512MB: ::c_int = 29 << HUGETLB_FLAG_ENCODE_SHIFT; 491 pub const HUGETLB_FLAG_ENCODE_1GB: ::c_int = 30 << HUGETLB_FLAG_ENCODE_SHIFT; 492 pub const HUGETLB_FLAG_ENCODE_2GB: ::c_int = 31 << HUGETLB_FLAG_ENCODE_SHIFT; 493 pub const HUGETLB_FLAG_ENCODE_16GB: ::c_int = 34 << HUGETLB_FLAG_ENCODE_SHIFT; 494 495 // include/uapi/linux/mman.h 496 /* 497 * Huge page size encoding when MAP_HUGETLB is specified, and a huge page 498 * size other than the default is desired. See hugetlb_encode.h. 499 * All known huge page size encodings are provided here. It is the 500 * responsibility of the application to know which sizes are supported on 501 * the running system. See mmap(2) man page for details. 502 */ 503 pub const MAP_HUGE_SHIFT: ::c_int = HUGETLB_FLAG_ENCODE_SHIFT; 504 pub const MAP_HUGE_MASK: ::c_int = HUGETLB_FLAG_ENCODE_MASK; 505 506 pub const MAP_HUGE_64KB: ::c_int = HUGETLB_FLAG_ENCODE_64KB; 507 pub const MAP_HUGE_512KB: ::c_int = HUGETLB_FLAG_ENCODE_512KB; 508 pub const MAP_HUGE_1MB: ::c_int = HUGETLB_FLAG_ENCODE_1MB; 509 pub const MAP_HUGE_2MB: ::c_int = HUGETLB_FLAG_ENCODE_2MB; 510 pub const MAP_HUGE_8MB: ::c_int = HUGETLB_FLAG_ENCODE_8MB; 511 pub const MAP_HUGE_16MB: ::c_int = HUGETLB_FLAG_ENCODE_16MB; 512 pub const MAP_HUGE_32MB: ::c_int = HUGETLB_FLAG_ENCODE_32MB; 513 pub const MAP_HUGE_256MB: ::c_int = HUGETLB_FLAG_ENCODE_256MB; 514 pub const MAP_HUGE_512MB: ::c_int = HUGETLB_FLAG_ENCODE_512MB; 515 pub const MAP_HUGE_1GB: ::c_int = HUGETLB_FLAG_ENCODE_1GB; 516 pub const MAP_HUGE_2GB: ::c_int = HUGETLB_FLAG_ENCODE_2GB; 517 pub const MAP_HUGE_16GB: ::c_int = HUGETLB_FLAG_ENCODE_16GB; 518 519 pub const RLIMIT_CPU: ::__rlimit_resource_t = 0; 520 pub const RLIMIT_FSIZE: ::__rlimit_resource_t = 1; 521 pub const RLIMIT_DATA: ::__rlimit_resource_t = 2; 522 pub const RLIMIT_STACK: ::__rlimit_resource_t = 3; 523 pub const RLIMIT_CORE: ::__rlimit_resource_t = 4; 524 pub const RLIMIT_LOCKS: ::__rlimit_resource_t = 10; 525 pub const RLIMIT_SIGPENDING: ::__rlimit_resource_t = 11; 526 pub const RLIMIT_MSGQUEUE: ::__rlimit_resource_t = 12; 527 pub const RLIMIT_NICE: ::__rlimit_resource_t = 13; 528 pub const RLIMIT_RTPRIO: ::__rlimit_resource_t = 14; 529 pub const RLIMIT_RTTIME: ::__rlimit_resource_t = 15; 530 pub const RLIMIT_NLIMITS: ::__rlimit_resource_t = 16; 531 532 pub const PRIO_PROCESS: ::__priority_which_t = 0; 533 pub const PRIO_PGRP: ::__priority_which_t = 1; 534 pub const PRIO_USER: ::__priority_which_t = 2; 535 536 pub const MS_RMT_MASK: ::c_ulong = 0x02800051; 537 538 pub const __UT_LINESIZE: usize = 32; 539 pub const __UT_NAMESIZE: usize = 32; 540 pub const __UT_HOSTSIZE: usize = 256; 541 pub const EMPTY: ::c_short = 0; 542 pub const RUN_LVL: ::c_short = 1; 543 pub const BOOT_TIME: ::c_short = 2; 544 pub const NEW_TIME: ::c_short = 3; 545 pub const OLD_TIME: ::c_short = 4; 546 pub const INIT_PROCESS: ::c_short = 5; 547 pub const LOGIN_PROCESS: ::c_short = 6; 548 pub const USER_PROCESS: ::c_short = 7; 549 pub const DEAD_PROCESS: ::c_short = 8; 550 pub const ACCOUNTING: ::c_short = 9; 551 552 // dlfcn.h 553 pub const LM_ID_BASE: ::c_long = 0; 554 pub const LM_ID_NEWLM: ::c_long = -1; 555 556 pub const RTLD_DI_LMID: ::c_int = 1; 557 pub const RTLD_DI_LINKMAP: ::c_int = 2; 558 pub const RTLD_DI_CONFIGADDR: ::c_int = 3; 559 pub const RTLD_DI_SERINFO: ::c_int = 4; 560 pub const RTLD_DI_SERINFOSIZE: ::c_int = 5; 561 pub const RTLD_DI_ORIGIN: ::c_int = 6; 562 pub const RTLD_DI_PROFILENAME: ::c_int = 7; 563 pub const RTLD_DI_PROFILEOUT: ::c_int = 8; 564 pub const RTLD_DI_TLS_MODID: ::c_int = 9; 565 pub const RTLD_DI_TLS_DATA: ::c_int = 10; 566 567 pub const SOCK_NONBLOCK: ::c_int = O_NONBLOCK; 568 569 pub const SOL_RXRPC: ::c_int = 272; 570 pub const SOL_PPPOL2TP: ::c_int = 273; 571 pub const SOL_PNPIPE: ::c_int = 275; 572 pub const SOL_RDS: ::c_int = 276; 573 pub const SOL_IUCV: ::c_int = 277; 574 pub const SOL_CAIF: ::c_int = 278; 575 pub const SOL_NFC: ::c_int = 280; 576 pub const SOL_XDP: ::c_int = 283; 577 578 pub const MSG_TRYHARD: ::c_int = 4; 579 580 pub const LC_PAPER: ::c_int = 7; 581 pub const LC_NAME: ::c_int = 8; 582 pub const LC_ADDRESS: ::c_int = 9; 583 pub const LC_TELEPHONE: ::c_int = 10; 584 pub const LC_MEASUREMENT: ::c_int = 11; 585 pub const LC_IDENTIFICATION: ::c_int = 12; 586 pub const LC_PAPER_MASK: ::c_int = 1 << LC_PAPER; 587 pub const LC_NAME_MASK: ::c_int = 1 << LC_NAME; 588 pub const LC_ADDRESS_MASK: ::c_int = 1 << LC_ADDRESS; 589 pub const LC_TELEPHONE_MASK: ::c_int = 1 << LC_TELEPHONE; 590 pub const LC_MEASUREMENT_MASK: ::c_int = 1 << LC_MEASUREMENT; 591 pub const LC_IDENTIFICATION_MASK: ::c_int = 1 << LC_IDENTIFICATION; 592 pub const LC_ALL_MASK: ::c_int = ::LC_CTYPE_MASK 593 | ::LC_NUMERIC_MASK 594 | ::LC_TIME_MASK 595 | ::LC_COLLATE_MASK 596 | ::LC_MONETARY_MASK 597 | ::LC_MESSAGES_MASK 598 | LC_PAPER_MASK 599 | LC_NAME_MASK 600 | LC_ADDRESS_MASK 601 | LC_TELEPHONE_MASK 602 | LC_MEASUREMENT_MASK 603 | LC_IDENTIFICATION_MASK; 604 605 pub const ENOTSUP: ::c_int = EOPNOTSUPP; 606 607 pub const SOCK_SEQPACKET: ::c_int = 5; 608 pub const SOCK_DCCP: ::c_int = 6; 609 pub const SOCK_PACKET: ::c_int = 10; 610 611 pub const TCP_COOKIE_TRANSACTIONS: ::c_int = 15; 612 pub const TCP_THIN_LINEAR_TIMEOUTS: ::c_int = 16; 613 pub const TCP_THIN_DUPACK: ::c_int = 17; 614 pub const TCP_USER_TIMEOUT: ::c_int = 18; 615 pub const TCP_REPAIR: ::c_int = 19; 616 pub const TCP_REPAIR_QUEUE: ::c_int = 20; 617 pub const TCP_QUEUE_SEQ: ::c_int = 21; 618 pub const TCP_REPAIR_OPTIONS: ::c_int = 22; 619 pub const TCP_FASTOPEN: ::c_int = 23; 620 pub const TCP_TIMESTAMP: ::c_int = 24; 621 pub const TCP_FASTOPEN_CONNECT: ::c_int = 30; 622 623 pub const FAN_MARK_INODE: ::c_uint = 0x0000_0000; 624 pub const FAN_MARK_MOUNT: ::c_uint = 0x0000_0010; 625 // NOTE: FAN_MARK_FILESYSTEM requires Linux Kernel >= 4.20.0 626 pub const FAN_MARK_FILESYSTEM: ::c_uint = 0x0000_0100; 627 628 pub const AF_IB: ::c_int = 27; 629 pub const AF_MPLS: ::c_int = 28; 630 pub const AF_NFC: ::c_int = 39; 631 pub const AF_VSOCK: ::c_int = 40; 632 pub const AF_XDP: ::c_int = 44; 633 pub const PF_IB: ::c_int = AF_IB; 634 pub const PF_MPLS: ::c_int = AF_MPLS; 635 pub const PF_NFC: ::c_int = AF_NFC; 636 pub const PF_VSOCK: ::c_int = AF_VSOCK; 637 pub const PF_XDP: ::c_int = AF_XDP; 638 639 /* DCCP socket options */ 640 pub const DCCP_SOCKOPT_PACKET_SIZE: ::c_int = 1; 641 pub const DCCP_SOCKOPT_SERVICE: ::c_int = 2; 642 pub const DCCP_SOCKOPT_CHANGE_L: ::c_int = 3; 643 pub const DCCP_SOCKOPT_CHANGE_R: ::c_int = 4; 644 pub const DCCP_SOCKOPT_GET_CUR_MPS: ::c_int = 5; 645 pub const DCCP_SOCKOPT_SERVER_TIMEWAIT: ::c_int = 6; 646 pub const DCCP_SOCKOPT_SEND_CSCOV: ::c_int = 10; 647 pub const DCCP_SOCKOPT_RECV_CSCOV: ::c_int = 11; 648 pub const DCCP_SOCKOPT_AVAILABLE_CCIDS: ::c_int = 12; 649 pub const DCCP_SOCKOPT_CCID: ::c_int = 13; 650 pub const DCCP_SOCKOPT_TX_CCID: ::c_int = 14; 651 pub const DCCP_SOCKOPT_RX_CCID: ::c_int = 15; 652 pub const DCCP_SOCKOPT_QPOLICY_ID: ::c_int = 16; 653 pub const DCCP_SOCKOPT_QPOLICY_TXQLEN: ::c_int = 17; 654 pub const DCCP_SOCKOPT_CCID_RX_INFO: ::c_int = 128; 655 pub const DCCP_SOCKOPT_CCID_TX_INFO: ::c_int = 192; 656 657 /// maximum number of services provided on the same listening port 658 pub const DCCP_SERVICE_LIST_MAX_LEN: ::c_int = 32; 659 660 pub const SIGEV_THREAD_ID: ::c_int = 4; 661 662 pub const BUFSIZ: ::c_uint = 8192; 663 pub const TMP_MAX: ::c_uint = 238328; 664 pub const FOPEN_MAX: ::c_uint = 16; 665 pub const FILENAME_MAX: ::c_uint = 4096; 666 pub const POSIX_MADV_DONTNEED: ::c_int = 4; 667 pub const _SC_EQUIV_CLASS_MAX: ::c_int = 41; 668 pub const _SC_CHARCLASS_NAME_MAX: ::c_int = 45; 669 pub const _SC_PII: ::c_int = 53; 670 pub const _SC_PII_XTI: ::c_int = 54; 671 pub const _SC_PII_SOCKET: ::c_int = 55; 672 pub const _SC_PII_INTERNET: ::c_int = 56; 673 pub const _SC_PII_OSI: ::c_int = 57; 674 pub const _SC_POLL: ::c_int = 58; 675 pub const _SC_SELECT: ::c_int = 59; 676 pub const _SC_PII_INTERNET_STREAM: ::c_int = 61; 677 pub const _SC_PII_INTERNET_DGRAM: ::c_int = 62; 678 pub const _SC_PII_OSI_COTS: ::c_int = 63; 679 pub const _SC_PII_OSI_CLTS: ::c_int = 64; 680 pub const _SC_PII_OSI_M: ::c_int = 65; 681 pub const _SC_T_IOV_MAX: ::c_int = 66; 682 pub const _SC_2_C_VERSION: ::c_int = 96; 683 pub const _SC_CHAR_BIT: ::c_int = 101; 684 pub const _SC_CHAR_MAX: ::c_int = 102; 685 pub const _SC_CHAR_MIN: ::c_int = 103; 686 pub const _SC_INT_MAX: ::c_int = 104; 687 pub const _SC_INT_MIN: ::c_int = 105; 688 pub const _SC_LONG_BIT: ::c_int = 106; 689 pub const _SC_WORD_BIT: ::c_int = 107; 690 pub const _SC_MB_LEN_MAX: ::c_int = 108; 691 pub const _SC_SSIZE_MAX: ::c_int = 110; 692 pub const _SC_SCHAR_MAX: ::c_int = 111; 693 pub const _SC_SCHAR_MIN: ::c_int = 112; 694 pub const _SC_SHRT_MAX: ::c_int = 113; 695 pub const _SC_SHRT_MIN: ::c_int = 114; 696 pub const _SC_UCHAR_MAX: ::c_int = 115; 697 pub const _SC_UINT_MAX: ::c_int = 116; 698 pub const _SC_ULONG_MAX: ::c_int = 117; 699 pub const _SC_USHRT_MAX: ::c_int = 118; 700 pub const _SC_NL_ARGMAX: ::c_int = 119; 701 pub const _SC_NL_LANGMAX: ::c_int = 120; 702 pub const _SC_NL_MSGMAX: ::c_int = 121; 703 pub const _SC_NL_NMAX: ::c_int = 122; 704 pub const _SC_NL_SETMAX: ::c_int = 123; 705 pub const _SC_NL_TEXTMAX: ::c_int = 124; 706 pub const _SC_BASE: ::c_int = 134; 707 pub const _SC_C_LANG_SUPPORT: ::c_int = 135; 708 pub const _SC_C_LANG_SUPPORT_R: ::c_int = 136; 709 pub const _SC_DEVICE_IO: ::c_int = 140; 710 pub const _SC_DEVICE_SPECIFIC: ::c_int = 141; 711 pub const _SC_DEVICE_SPECIFIC_R: ::c_int = 142; 712 pub const _SC_FD_MGMT: ::c_int = 143; 713 pub const _SC_FIFO: ::c_int = 144; 714 pub const _SC_PIPE: ::c_int = 145; 715 pub const _SC_FILE_ATTRIBUTES: ::c_int = 146; 716 pub const _SC_FILE_LOCKING: ::c_int = 147; 717 pub const _SC_FILE_SYSTEM: ::c_int = 148; 718 pub const _SC_MULTI_PROCESS: ::c_int = 150; 719 pub const _SC_SINGLE_PROCESS: ::c_int = 151; 720 pub const _SC_NETWORKING: ::c_int = 152; 721 pub const _SC_REGEX_VERSION: ::c_int = 156; 722 pub const _SC_SIGNALS: ::c_int = 158; 723 pub const _SC_SYSTEM_DATABASE: ::c_int = 162; 724 pub const _SC_SYSTEM_DATABASE_R: ::c_int = 163; 725 pub const _SC_USER_GROUPS: ::c_int = 166; 726 pub const _SC_USER_GROUPS_R: ::c_int = 167; 727 pub const _SC_LEVEL1_ICACHE_SIZE: ::c_int = 185; 728 pub const _SC_LEVEL1_ICACHE_ASSOC: ::c_int = 186; 729 pub const _SC_LEVEL1_ICACHE_LINESIZE: ::c_int = 187; 730 pub const _SC_LEVEL1_DCACHE_SIZE: ::c_int = 188; 731 pub const _SC_LEVEL1_DCACHE_ASSOC: ::c_int = 189; 732 pub const _SC_LEVEL1_DCACHE_LINESIZE: ::c_int = 190; 733 pub const _SC_LEVEL2_CACHE_SIZE: ::c_int = 191; 734 pub const _SC_LEVEL2_CACHE_ASSOC: ::c_int = 192; 735 pub const _SC_LEVEL2_CACHE_LINESIZE: ::c_int = 193; 736 pub const _SC_LEVEL3_CACHE_SIZE: ::c_int = 194; 737 pub const _SC_LEVEL3_CACHE_ASSOC: ::c_int = 195; 738 pub const _SC_LEVEL3_CACHE_LINESIZE: ::c_int = 196; 739 pub const _SC_LEVEL4_CACHE_SIZE: ::c_int = 197; 740 pub const _SC_LEVEL4_CACHE_ASSOC: ::c_int = 198; 741 pub const _SC_LEVEL4_CACHE_LINESIZE: ::c_int = 199; 742 pub const O_ACCMODE: ::c_int = 3; 743 pub const ST_RELATIME: ::c_ulong = 4096; 744 pub const NI_MAXHOST: ::socklen_t = 1025; 745 746 cfg_if! { 747 if #[cfg(not(target_arch = "s390x"))] { 748 pub const ADFS_SUPER_MAGIC: ::c_long = 0x0000adf5; 749 pub const AFFS_SUPER_MAGIC: ::c_long = 0x0000adff; 750 pub const AFS_SUPER_MAGIC: ::c_long = 0x5346414f; 751 pub const AUTOFS_SUPER_MAGIC: ::c_long = 0x0187; 752 pub const BINDERFS_SUPER_MAGIC: ::c_long = 0x6c6f6f70; 753 pub const BPF_FS_MAGIC: ::c_long = 0xcafe4a11; 754 pub const BTRFS_SUPER_MAGIC: ::c_long = 0x9123683e; 755 pub const CGROUP2_SUPER_MAGIC: ::c_long = 0x63677270; 756 pub const CGROUP_SUPER_MAGIC: ::c_long = 0x27e0eb; 757 pub const CODA_SUPER_MAGIC: ::c_long = 0x73757245; 758 pub const CRAMFS_MAGIC: ::c_long = 0x28cd3d45; 759 pub const DEBUGFS_MAGIC: ::c_long = 0x64626720; 760 pub const DEVPTS_SUPER_MAGIC: ::c_long = 0x1cd1; 761 pub const ECRYPTFS_SUPER_MAGIC: ::c_long = 0xf15f; 762 pub const EFS_SUPER_MAGIC: ::c_long = 0x00414a53; 763 pub const EXT2_SUPER_MAGIC: ::c_long = 0x0000ef53; 764 pub const EXT3_SUPER_MAGIC: ::c_long = 0x0000ef53; 765 pub const EXT4_SUPER_MAGIC: ::c_long = 0x0000ef53; 766 pub const F2FS_SUPER_MAGIC: ::c_long = 0xf2f52010; 767 pub const FUTEXFS_SUPER_MAGIC: ::c_long = 0xbad1dea; 768 pub const HOSTFS_SUPER_MAGIC: ::c_long = 0x00c0ffee; 769 pub const HPFS_SUPER_MAGIC: ::c_long = 0xf995e849; 770 pub const HUGETLBFS_MAGIC: ::c_long = 0x958458f6; 771 pub const ISOFS_SUPER_MAGIC: ::c_long = 0x00009660; 772 pub const JFFS2_SUPER_MAGIC: ::c_long = 0x000072b6; 773 pub const MINIX2_SUPER_MAGIC2: ::c_long = 0x00002478; 774 pub const MINIX2_SUPER_MAGIC: ::c_long = 0x00002468; 775 pub const MINIX3_SUPER_MAGIC: ::c_long = 0x4d5a; 776 pub const MINIX_SUPER_MAGIC2: ::c_long = 0x0000138f; 777 pub const MINIX_SUPER_MAGIC: ::c_long = 0x0000137f; 778 pub const MSDOS_SUPER_MAGIC: ::c_long = 0x00004d44; 779 pub const NCP_SUPER_MAGIC: ::c_long = 0x0000564c; 780 pub const NFS_SUPER_MAGIC: ::c_long = 0x00006969; 781 pub const NILFS_SUPER_MAGIC: ::c_long = 0x3434; 782 pub const OCFS2_SUPER_MAGIC: ::c_long = 0x7461636f; 783 pub const OPENPROM_SUPER_MAGIC: ::c_long = 0x00009fa1; 784 pub const OVERLAYFS_SUPER_MAGIC: ::c_long = 0x794c7630; 785 pub const PROC_SUPER_MAGIC: ::c_long = 0x00009fa0; 786 pub const QNX4_SUPER_MAGIC: ::c_long = 0x0000002f; 787 pub const QNX6_SUPER_MAGIC: ::c_long = 0x68191122; 788 pub const RDTGROUP_SUPER_MAGIC: ::c_long = 0x7655821; 789 pub const REISERFS_SUPER_MAGIC: ::c_long = 0x52654973; 790 pub const SMB_SUPER_MAGIC: ::c_long = 0x0000517b; 791 pub const SYSFS_MAGIC: ::c_long = 0x62656572; 792 pub const TMPFS_MAGIC: ::c_long = 0x01021994; 793 pub const TRACEFS_MAGIC: ::c_long = 0x74726163; 794 pub const UDF_SUPER_MAGIC: ::c_long = 0x15013346; 795 pub const USBDEVICE_SUPER_MAGIC: ::c_long = 0x00009fa2; 796 pub const XENFS_SUPER_MAGIC: ::c_long = 0xabba1974; 797 pub const XFS_SUPER_MAGIC: ::c_long = 0x58465342; 798 } else if #[cfg(target_arch = "s390x")] { 799 pub const ADFS_SUPER_MAGIC: ::c_uint = 0x0000adf5; 800 pub const AFFS_SUPER_MAGIC: ::c_uint = 0x0000adff; 801 pub const AFS_SUPER_MAGIC: ::c_uint = 0x5346414f; 802 pub const AUTOFS_SUPER_MAGIC: ::c_uint = 0x0187; 803 pub const BINDERFS_SUPER_MAGIC: ::c_uint = 0x6c6f6f70; 804 pub const BPF_FS_MAGIC: ::c_uint = 0xcafe4a11; 805 pub const BTRFS_SUPER_MAGIC: ::c_uint = 0x9123683e; 806 pub const CGROUP2_SUPER_MAGIC: ::c_uint = 0x63677270; 807 pub const CGROUP_SUPER_MAGIC: ::c_uint = 0x27e0eb; 808 pub const CODA_SUPER_MAGIC: ::c_uint = 0x73757245; 809 pub const CRAMFS_MAGIC: ::c_uint = 0x28cd3d45; 810 pub const DEBUGFS_MAGIC: ::c_uint = 0x64626720; 811 pub const DEVPTS_SUPER_MAGIC: ::c_uint = 0x1cd1; 812 pub const ECRYPTFS_SUPER_MAGIC: ::c_uint = 0xf15f; 813 pub const EFS_SUPER_MAGIC: ::c_uint = 0x00414a53; 814 pub const EXT2_SUPER_MAGIC: ::c_uint = 0x0000ef53; 815 pub const EXT3_SUPER_MAGIC: ::c_uint = 0x0000ef53; 816 pub const EXT4_SUPER_MAGIC: ::c_uint = 0x0000ef53; 817 pub const F2FS_SUPER_MAGIC: ::c_uint = 0xf2f52010; 818 pub const FUTEXFS_SUPER_MAGIC: ::c_uint = 0xbad1dea; 819 pub const HOSTFS_SUPER_MAGIC: ::c_uint = 0x00c0ffee; 820 pub const HPFS_SUPER_MAGIC: ::c_uint = 0xf995e849; 821 pub const HUGETLBFS_MAGIC: ::c_uint = 0x958458f6; 822 pub const ISOFS_SUPER_MAGIC: ::c_uint = 0x00009660; 823 pub const JFFS2_SUPER_MAGIC: ::c_uint = 0x000072b6; 824 pub const MINIX2_SUPER_MAGIC2: ::c_uint = 0x00002478; 825 pub const MINIX2_SUPER_MAGIC: ::c_uint = 0x00002468; 826 pub const MINIX3_SUPER_MAGIC: ::c_uint = 0x4d5a; 827 pub const MINIX_SUPER_MAGIC2: ::c_uint = 0x0000138f; 828 pub const MINIX_SUPER_MAGIC: ::c_uint = 0x0000137f; 829 pub const MSDOS_SUPER_MAGIC: ::c_uint = 0x00004d44; 830 pub const NCP_SUPER_MAGIC: ::c_uint = 0x0000564c; 831 pub const NFS_SUPER_MAGIC: ::c_uint = 0x00006969; 832 pub const NILFS_SUPER_MAGIC: ::c_uint = 0x3434; 833 pub const OCFS2_SUPER_MAGIC: ::c_uint = 0x7461636f; 834 pub const OPENPROM_SUPER_MAGIC: ::c_uint = 0x00009fa1; 835 pub const OVERLAYFS_SUPER_MAGIC: ::c_uint = 0x794c7630; 836 pub const PROC_SUPER_MAGIC: ::c_uint = 0x00009fa0; 837 pub const QNX4_SUPER_MAGIC: ::c_uint = 0x0000002f; 838 pub const QNX6_SUPER_MAGIC: ::c_uint = 0x68191122; 839 pub const RDTGROUP_SUPER_MAGIC: ::c_uint = 0x7655821; 840 pub const REISERFS_SUPER_MAGIC: ::c_uint = 0x52654973; 841 pub const SMB_SUPER_MAGIC: ::c_uint = 0x0000517b; 842 pub const SYSFS_MAGIC: ::c_uint = 0x62656572; 843 pub const TMPFS_MAGIC: ::c_uint = 0x01021994; 844 pub const TRACEFS_MAGIC: ::c_uint = 0x74726163; 845 pub const UDF_SUPER_MAGIC: ::c_uint = 0x15013346; 846 pub const USBDEVICE_SUPER_MAGIC: ::c_uint = 0x00009fa2; 847 pub const XENFS_SUPER_MAGIC: ::c_uint = 0xabba1974; 848 pub const XFS_SUPER_MAGIC: ::c_uint = 0x58465342; 849 } 850 } 851 852 pub const CPU_SETSIZE: ::c_int = 0x400; 853 854 pub const PTRACE_TRACEME: ::c_uint = 0; 855 pub const PTRACE_PEEKTEXT: ::c_uint = 1; 856 pub const PTRACE_PEEKDATA: ::c_uint = 2; 857 pub const PTRACE_PEEKUSER: ::c_uint = 3; 858 pub const PTRACE_POKETEXT: ::c_uint = 4; 859 pub const PTRACE_POKEDATA: ::c_uint = 5; 860 pub const PTRACE_POKEUSER: ::c_uint = 6; 861 pub const PTRACE_CONT: ::c_uint = 7; 862 pub const PTRACE_KILL: ::c_uint = 8; 863 pub const PTRACE_SINGLESTEP: ::c_uint = 9; 864 pub const PTRACE_ATTACH: ::c_uint = 16; 865 pub const PTRACE_SYSCALL: ::c_uint = 24; 866 pub const PTRACE_SETOPTIONS: ::c_uint = 0x4200; 867 pub const PTRACE_GETEVENTMSG: ::c_uint = 0x4201; 868 pub const PTRACE_GETSIGINFO: ::c_uint = 0x4202; 869 pub const PTRACE_SETSIGINFO: ::c_uint = 0x4203; 870 pub const PTRACE_GETREGSET: ::c_uint = 0x4204; 871 pub const PTRACE_SETREGSET: ::c_uint = 0x4205; 872 pub const PTRACE_SEIZE: ::c_uint = 0x4206; 873 pub const PTRACE_INTERRUPT: ::c_uint = 0x4207; 874 pub const PTRACE_LISTEN: ::c_uint = 0x4208; 875 pub const PTRACE_PEEKSIGINFO: ::c_uint = 0x4209; 876 877 pub const EPOLLWAKEUP: ::c_int = 0x20000000; 878 879 // linux/fs.h 880 881 // Flags for preadv2/pwritev2 882 pub const RWF_HIPRI: ::c_int = 0x00000001; 883 pub const RWF_DSYNC: ::c_int = 0x00000002; 884 pub const RWF_SYNC: ::c_int = 0x00000004; 885 pub const RWF_NOWAIT: ::c_int = 0x00000008; 886 pub const RWF_APPEND: ::c_int = 0x00000010; 887 888 // linux/rtnetlink.h 889 pub const TCA_PAD: ::c_ushort = 9; 890 pub const TCA_DUMP_INVISIBLE: ::c_ushort = 10; 891 pub const TCA_CHAIN: ::c_ushort = 11; 892 pub const TCA_HW_OFFLOAD: ::c_ushort = 12; 893 894 pub const RTM_DELNETCONF: u16 = 81; 895 pub const RTM_NEWSTATS: u16 = 92; 896 pub const RTM_GETSTATS: u16 = 94; 897 pub const RTM_NEWCACHEREPORT: u16 = 96; 898 899 pub const RTM_F_LOOKUP_TABLE: ::c_uint = 0x1000; 900 pub const RTM_F_FIB_MATCH: ::c_uint = 0x2000; 901 902 pub const RTA_VIA: ::c_ushort = 18; 903 pub const RTA_NEWDST: ::c_ushort = 19; 904 pub const RTA_PREF: ::c_ushort = 20; 905 pub const RTA_ENCAP_TYPE: ::c_ushort = 21; 906 pub const RTA_ENCAP: ::c_ushort = 22; 907 pub const RTA_EXPIRES: ::c_ushort = 23; 908 pub const RTA_PAD: ::c_ushort = 24; 909 pub const RTA_UID: ::c_ushort = 25; 910 pub const RTA_TTL_PROPAGATE: ::c_ushort = 26; 911 912 // linux/neighbor.h 913 pub const NTF_EXT_LEARNED: u8 = 0x10; 914 pub const NTF_OFFLOADED: u8 = 0x20; 915 916 pub const NDA_MASTER: ::c_ushort = 9; 917 pub const NDA_LINK_NETNSID: ::c_ushort = 10; 918 pub const NDA_SRC_VNI: ::c_ushort = 11; 919 920 // linux/personality.h 921 pub const UNAME26: ::c_int = 0x0020000; 922 pub const FDPIC_FUNCPTRS: ::c_int = 0x0080000; 923 924 // linux/if_addr.h 925 pub const IFA_FLAGS: ::c_ushort = 8; 926 927 pub const IFA_F_MANAGETEMPADDR: u32 = 0x100; 928 pub const IFA_F_NOPREFIXROUTE: u32 = 0x200; 929 pub const IFA_F_MCAUTOJOIN: u32 = 0x400; 930 pub const IFA_F_STABLE_PRIVACY: u32 = 0x800; 931 932 pub const MAX_LINKS: ::c_int = 32; 933 934 pub const GENL_UNS_ADMIN_PERM: ::c_int = 0x10; 935 936 pub const GENL_ID_VFS_DQUOT: ::c_int = ::NLMSG_MIN_TYPE + 1; 937 pub const GENL_ID_PMCRAID: ::c_int = ::NLMSG_MIN_TYPE + 2; 938 939 pub const TIOCM_LE: ::c_int = 0x001; 940 pub const TIOCM_DTR: ::c_int = 0x002; 941 pub const TIOCM_RTS: ::c_int = 0x004; 942 pub const TIOCM_CD: ::c_int = TIOCM_CAR; 943 pub const TIOCM_RI: ::c_int = TIOCM_RNG; 944 945 pub const NF_NETDEV_INGRESS: ::c_int = 0; 946 pub const NF_NETDEV_NUMHOOKS: ::c_int = 1; 947 948 pub const NFPROTO_INET: ::c_int = 1; 949 pub const NFPROTO_NETDEV: ::c_int = 5; 950 951 // linux/keyctl.h 952 pub const KEYCTL_DH_COMPUTE: u32 = 23; 953 pub const KEYCTL_PKEY_QUERY: u32 = 24; 954 pub const KEYCTL_PKEY_ENCRYPT: u32 = 25; 955 pub const KEYCTL_PKEY_DECRYPT: u32 = 26; 956 pub const KEYCTL_PKEY_SIGN: u32 = 27; 957 pub const KEYCTL_PKEY_VERIFY: u32 = 28; 958 pub const KEYCTL_RESTRICT_KEYRING: u32 = 29; 959 960 pub const KEYCTL_SUPPORTS_ENCRYPT: u32 = 0x01; 961 pub const KEYCTL_SUPPORTS_DECRYPT: u32 = 0x02; 962 pub const KEYCTL_SUPPORTS_SIGN: u32 = 0x04; 963 pub const KEYCTL_SUPPORTS_VERIFY: u32 = 0x08; 964 cfg_if! { 965 if #[cfg(not(any(target_arch="mips", target_arch="mips64")))] { 966 pub const KEYCTL_MOVE: u32 = 30; 967 pub const KEYCTL_CAPABILITIES: u32 = 31; 968 969 pub const KEYCTL_CAPS0_CAPABILITIES: u32 = 0x01; 970 pub const KEYCTL_CAPS0_PERSISTENT_KEYRINGS: u32 = 0x02; 971 pub const KEYCTL_CAPS0_DIFFIE_HELLMAN: u32 = 0x04; 972 pub const KEYCTL_CAPS0_PUBLIC_KEY: u32 = 0x08; 973 pub const KEYCTL_CAPS0_BIG_KEY: u32 = 0x10; 974 pub const KEYCTL_CAPS0_INVALIDATE: u32 = 0x20; 975 pub const KEYCTL_CAPS0_RESTRICT_KEYRING: u32 = 0x40; 976 pub const KEYCTL_CAPS0_MOVE: u32 = 0x80; 977 pub const KEYCTL_CAPS1_NS_KEYRING_NAME: u32 = 0x01; 978 pub const KEYCTL_CAPS1_NS_KEY_TAG: u32 = 0x02; 979 } 980 } 981 982 // linux/netfilter/nf_tables.h 983 pub const NFT_TABLE_MAXNAMELEN: ::c_int = 256; 984 pub const NFT_CHAIN_MAXNAMELEN: ::c_int = 256; 985 pub const NFT_SET_MAXNAMELEN: ::c_int = 256; 986 pub const NFT_OBJ_MAXNAMELEN: ::c_int = 256; 987 pub const NFT_USERDATA_MAXLEN: ::c_int = 256; 988 989 pub const NFT_REG_VERDICT: ::c_int = 0; 990 pub const NFT_REG_1: ::c_int = 1; 991 pub const NFT_REG_2: ::c_int = 2; 992 pub const NFT_REG_3: ::c_int = 3; 993 pub const NFT_REG_4: ::c_int = 4; 994 pub const __NFT_REG_MAX: ::c_int = 5; 995 pub const NFT_REG32_00: ::c_int = 8; 996 pub const NFT_REG32_01: ::c_int = 9; 997 pub const NFT_REG32_02: ::c_int = 10; 998 pub const NFT_REG32_03: ::c_int = 11; 999 pub const NFT_REG32_04: ::c_int = 12; 1000 pub const NFT_REG32_05: ::c_int = 13; 1001 pub const NFT_REG32_06: ::c_int = 14; 1002 pub const NFT_REG32_07: ::c_int = 15; 1003 pub const NFT_REG32_08: ::c_int = 16; 1004 pub const NFT_REG32_09: ::c_int = 17; 1005 pub const NFT_REG32_10: ::c_int = 18; 1006 pub const NFT_REG32_11: ::c_int = 19; 1007 pub const NFT_REG32_12: ::c_int = 20; 1008 pub const NFT_REG32_13: ::c_int = 21; 1009 pub const NFT_REG32_14: ::c_int = 22; 1010 pub const NFT_REG32_15: ::c_int = 23; 1011 1012 pub const NFT_REG_SIZE: ::c_int = 16; 1013 pub const NFT_REG32_SIZE: ::c_int = 4; 1014 1015 pub const NFT_CONTINUE: ::c_int = -1; 1016 pub const NFT_BREAK: ::c_int = -2; 1017 pub const NFT_JUMP: ::c_int = -3; 1018 pub const NFT_GOTO: ::c_int = -4; 1019 pub const NFT_RETURN: ::c_int = -5; 1020 1021 pub const NFT_MSG_NEWTABLE: ::c_int = 0; 1022 pub const NFT_MSG_GETTABLE: ::c_int = 1; 1023 pub const NFT_MSG_DELTABLE: ::c_int = 2; 1024 pub const NFT_MSG_NEWCHAIN: ::c_int = 3; 1025 pub const NFT_MSG_GETCHAIN: ::c_int = 4; 1026 pub const NFT_MSG_DELCHAIN: ::c_int = 5; 1027 pub const NFT_MSG_NEWRULE: ::c_int = 6; 1028 pub const NFT_MSG_GETRULE: ::c_int = 7; 1029 pub const NFT_MSG_DELRULE: ::c_int = 8; 1030 pub const NFT_MSG_NEWSET: ::c_int = 9; 1031 pub const NFT_MSG_GETSET: ::c_int = 10; 1032 pub const NFT_MSG_DELSET: ::c_int = 11; 1033 pub const NFT_MSG_NEWSETELEM: ::c_int = 12; 1034 pub const NFT_MSG_GETSETELEM: ::c_int = 13; 1035 pub const NFT_MSG_DELSETELEM: ::c_int = 14; 1036 pub const NFT_MSG_NEWGEN: ::c_int = 15; 1037 pub const NFT_MSG_GETGEN: ::c_int = 16; 1038 pub const NFT_MSG_TRACE: ::c_int = 17; 1039 cfg_if! { 1040 if #[cfg(not(target_arch = "sparc64"))] { 1041 pub const NFT_MSG_NEWOBJ: ::c_int = 18; 1042 pub const NFT_MSG_GETOBJ: ::c_int = 19; 1043 pub const NFT_MSG_DELOBJ: ::c_int = 20; 1044 pub const NFT_MSG_GETOBJ_RESET: ::c_int = 21; 1045 } 1046 } 1047 pub const NFT_MSG_MAX: ::c_int = 25; 1048 1049 pub const NFT_SET_ANONYMOUS: ::c_int = 0x1; 1050 pub const NFT_SET_CONSTANT: ::c_int = 0x2; 1051 pub const NFT_SET_INTERVAL: ::c_int = 0x4; 1052 pub const NFT_SET_MAP: ::c_int = 0x8; 1053 pub const NFT_SET_TIMEOUT: ::c_int = 0x10; 1054 pub const NFT_SET_EVAL: ::c_int = 0x20; 1055 1056 pub const NFT_SET_POL_PERFORMANCE: ::c_int = 0; 1057 pub const NFT_SET_POL_MEMORY: ::c_int = 1; 1058 1059 pub const NFT_SET_ELEM_INTERVAL_END: ::c_int = 0x1; 1060 1061 pub const NFT_DATA_VALUE: ::c_uint = 0; 1062 pub const NFT_DATA_VERDICT: ::c_uint = 0xffffff00; 1063 1064 pub const NFT_DATA_RESERVED_MASK: ::c_uint = 0xffffff00; 1065 1066 pub const NFT_DATA_VALUE_MAXLEN: ::c_int = 64; 1067 1068 pub const NFT_BYTEORDER_NTOH: ::c_int = 0; 1069 pub const NFT_BYTEORDER_HTON: ::c_int = 1; 1070 1071 pub const NFT_CMP_EQ: ::c_int = 0; 1072 pub const NFT_CMP_NEQ: ::c_int = 1; 1073 pub const NFT_CMP_LT: ::c_int = 2; 1074 pub const NFT_CMP_LTE: ::c_int = 3; 1075 pub const NFT_CMP_GT: ::c_int = 4; 1076 pub const NFT_CMP_GTE: ::c_int = 5; 1077 1078 pub const NFT_RANGE_EQ: ::c_int = 0; 1079 pub const NFT_RANGE_NEQ: ::c_int = 1; 1080 1081 pub const NFT_LOOKUP_F_INV: ::c_int = 1 << 0; 1082 1083 pub const NFT_DYNSET_OP_ADD: ::c_int = 0; 1084 pub const NFT_DYNSET_OP_UPDATE: ::c_int = 1; 1085 1086 pub const NFT_DYNSET_F_INV: ::c_int = 1 << 0; 1087 1088 pub const NFT_PAYLOAD_LL_HEADER: ::c_int = 0; 1089 pub const NFT_PAYLOAD_NETWORK_HEADER: ::c_int = 1; 1090 pub const NFT_PAYLOAD_TRANSPORT_HEADER: ::c_int = 2; 1091 1092 pub const NFT_PAYLOAD_CSUM_NONE: ::c_int = 0; 1093 pub const NFT_PAYLOAD_CSUM_INET: ::c_int = 1; 1094 1095 pub const NFT_META_LEN: ::c_int = 0; 1096 pub const NFT_META_PROTOCOL: ::c_int = 1; 1097 pub const NFT_META_PRIORITY: ::c_int = 2; 1098 pub const NFT_META_MARK: ::c_int = 3; 1099 pub const NFT_META_IIF: ::c_int = 4; 1100 pub const NFT_META_OIF: ::c_int = 5; 1101 pub const NFT_META_IIFNAME: ::c_int = 6; 1102 pub const NFT_META_OIFNAME: ::c_int = 7; 1103 pub const NFT_META_IIFTYPE: ::c_int = 8; 1104 pub const NFT_META_OIFTYPE: ::c_int = 9; 1105 pub const NFT_META_SKUID: ::c_int = 10; 1106 pub const NFT_META_SKGID: ::c_int = 11; 1107 pub const NFT_META_NFTRACE: ::c_int = 12; 1108 pub const NFT_META_RTCLASSID: ::c_int = 13; 1109 pub const NFT_META_SECMARK: ::c_int = 14; 1110 pub const NFT_META_NFPROTO: ::c_int = 15; 1111 pub const NFT_META_L4PROTO: ::c_int = 16; 1112 pub const NFT_META_BRI_IIFNAME: ::c_int = 17; 1113 pub const NFT_META_BRI_OIFNAME: ::c_int = 18; 1114 pub const NFT_META_PKTTYPE: ::c_int = 19; 1115 pub const NFT_META_CPU: ::c_int = 20; 1116 pub const NFT_META_IIFGROUP: ::c_int = 21; 1117 pub const NFT_META_OIFGROUP: ::c_int = 22; 1118 pub const NFT_META_CGROUP: ::c_int = 23; 1119 pub const NFT_META_PRANDOM: ::c_int = 24; 1120 1121 pub const NFT_CT_STATE: ::c_int = 0; 1122 pub const NFT_CT_DIRECTION: ::c_int = 1; 1123 pub const NFT_CT_STATUS: ::c_int = 2; 1124 pub const NFT_CT_MARK: ::c_int = 3; 1125 pub const NFT_CT_SECMARK: ::c_int = 4; 1126 pub const NFT_CT_EXPIRATION: ::c_int = 5; 1127 pub const NFT_CT_HELPER: ::c_int = 6; 1128 pub const NFT_CT_L3PROTOCOL: ::c_int = 7; 1129 pub const NFT_CT_SRC: ::c_int = 8; 1130 pub const NFT_CT_DST: ::c_int = 9; 1131 pub const NFT_CT_PROTOCOL: ::c_int = 10; 1132 pub const NFT_CT_PROTO_SRC: ::c_int = 11; 1133 pub const NFT_CT_PROTO_DST: ::c_int = 12; 1134 pub const NFT_CT_LABELS: ::c_int = 13; 1135 pub const NFT_CT_PKTS: ::c_int = 14; 1136 pub const NFT_CT_BYTES: ::c_int = 15; 1137 1138 pub const NFT_LIMIT_PKTS: ::c_int = 0; 1139 pub const NFT_LIMIT_PKT_BYTES: ::c_int = 1; 1140 1141 pub const NFT_LIMIT_F_INV: ::c_int = 1 << 0; 1142 1143 pub const NFT_QUEUE_FLAG_BYPASS: ::c_int = 0x01; 1144 pub const NFT_QUEUE_FLAG_CPU_FANOUT: ::c_int = 0x02; 1145 pub const NFT_QUEUE_FLAG_MASK: ::c_int = 0x03; 1146 1147 pub const NFT_QUOTA_F_INV: ::c_int = 1 << 0; 1148 1149 pub const NFT_REJECT_ICMP_UNREACH: ::c_int = 0; 1150 pub const NFT_REJECT_TCP_RST: ::c_int = 1; 1151 pub const NFT_REJECT_ICMPX_UNREACH: ::c_int = 2; 1152 1153 pub const NFT_REJECT_ICMPX_NO_ROUTE: ::c_int = 0; 1154 pub const NFT_REJECT_ICMPX_PORT_UNREACH: ::c_int = 1; 1155 pub const NFT_REJECT_ICMPX_HOST_UNREACH: ::c_int = 2; 1156 pub const NFT_REJECT_ICMPX_ADMIN_PROHIBITED: ::c_int = 3; 1157 1158 pub const NFT_NAT_SNAT: ::c_int = 0; 1159 pub const NFT_NAT_DNAT: ::c_int = 1; 1160 1161 pub const NFT_TRACETYPE_UNSPEC: ::c_int = 0; 1162 pub const NFT_TRACETYPE_POLICY: ::c_int = 1; 1163 pub const NFT_TRACETYPE_RETURN: ::c_int = 2; 1164 pub const NFT_TRACETYPE_RULE: ::c_int = 3; 1165 1166 pub const NFT_NG_INCREMENTAL: ::c_int = 0; 1167 pub const NFT_NG_RANDOM: ::c_int = 1; 1168 1169 pub const M_MXFAST: ::c_int = 1; 1170 pub const M_NLBLKS: ::c_int = 2; 1171 pub const M_GRAIN: ::c_int = 3; 1172 pub const M_KEEP: ::c_int = 4; 1173 pub const M_TRIM_THRESHOLD: ::c_int = -1; 1174 pub const M_TOP_PAD: ::c_int = -2; 1175 pub const M_MMAP_THRESHOLD: ::c_int = -3; 1176 pub const M_MMAP_MAX: ::c_int = -4; 1177 pub const M_CHECK_ACTION: ::c_int = -5; 1178 pub const M_PERTURB: ::c_int = -6; 1179 pub const M_ARENA_TEST: ::c_int = -7; 1180 pub const M_ARENA_MAX: ::c_int = -8; 1181 1182 pub const AT_STATX_SYNC_TYPE: ::c_int = 0x6000; 1183 pub const AT_STATX_SYNC_AS_STAT: ::c_int = 0x0000; 1184 pub const AT_STATX_FORCE_SYNC: ::c_int = 0x2000; 1185 pub const AT_STATX_DONT_SYNC: ::c_int = 0x4000; 1186 pub const STATX_TYPE: ::c_uint = 0x0001; 1187 pub const STATX_MODE: ::c_uint = 0x0002; 1188 pub const STATX_NLINK: ::c_uint = 0x0004; 1189 pub const STATX_UID: ::c_uint = 0x0008; 1190 pub const STATX_GID: ::c_uint = 0x0010; 1191 pub const STATX_ATIME: ::c_uint = 0x0020; 1192 pub const STATX_MTIME: ::c_uint = 0x0040; 1193 pub const STATX_CTIME: ::c_uint = 0x0080; 1194 pub const STATX_INO: ::c_uint = 0x0100; 1195 pub const STATX_SIZE: ::c_uint = 0x0200; 1196 pub const STATX_BLOCKS: ::c_uint = 0x0400; 1197 pub const STATX_BASIC_STATS: ::c_uint = 0x07ff; 1198 pub const STATX_BTIME: ::c_uint = 0x0800; 1199 pub const STATX_MNT_ID: ::c_uint = 0x1000; 1200 pub const STATX_ALL: ::c_uint = 0x0fff; 1201 pub const STATX__RESERVED: ::c_int = 0x80000000; 1202 pub const STATX_ATTR_COMPRESSED: ::c_int = 0x0004; 1203 pub const STATX_ATTR_IMMUTABLE: ::c_int = 0x0010; 1204 pub const STATX_ATTR_APPEND: ::c_int = 0x0020; 1205 pub const STATX_ATTR_NODUMP: ::c_int = 0x0040; 1206 pub const STATX_ATTR_ENCRYPTED: ::c_int = 0x0800; 1207 pub const STATX_ATTR_AUTOMOUNT: ::c_int = 0x1000; 1208 1209 // sys/auxv.h 1210 pub const AT_NULL: ::c_ulong = 0; 1211 pub const AT_IGNORE: ::c_ulong = 1; 1212 pub const AT_EXECFD: ::c_ulong = 2; 1213 pub const AT_PHDR: ::c_ulong = 3; 1214 pub const AT_PHENT: ::c_ulong = 4; 1215 pub const AT_PHNUM: ::c_ulong = 5; 1216 pub const AT_PAGESZ: ::c_ulong = 6; 1217 pub const AT_BASE: ::c_ulong = 7; 1218 pub const AT_FLAGS: ::c_ulong = 8; 1219 pub const AT_ENTRY: ::c_ulong = 9; 1220 pub const AT_NOTELF: ::c_ulong = 10; 1221 pub const AT_UID: ::c_ulong = 11; 1222 pub const AT_EUID: ::c_ulong = 12; 1223 pub const AT_GID: ::c_ulong = 13; 1224 pub const AT_EGID: ::c_ulong = 14; 1225 pub const AT_PLATFORM: ::c_ulong = 15; 1226 pub const AT_HWCAP: ::c_ulong = 16; 1227 pub const AT_CLKTCK: ::c_ulong = 17; 1228 // AT_* values 18 through 22 are reserved 1229 pub const AT_SECURE: ::c_ulong = 23; 1230 pub const AT_BASE_PLATFORM: ::c_ulong = 24; 1231 pub const AT_RANDOM: ::c_ulong = 25; 1232 pub const AT_HWCAP2: ::c_ulong = 26; 1233 1234 pub const AT_EXECFN: ::c_ulong = 31; 1235 1236 //sys/timex.h 1237 pub const ADJ_OFFSET: ::c_uint = 0x0001; 1238 pub const ADJ_FREQUENCY: ::c_uint = 0x0002; 1239 pub const ADJ_MAXERROR: ::c_uint = 0x0004; 1240 pub const ADJ_ESTERROR: ::c_uint = 0x0008; 1241 pub const ADJ_STATUS: ::c_uint = 0x0010; 1242 pub const ADJ_TIMECONST: ::c_uint = 0x0020; 1243 pub const ADJ_TAI: ::c_uint = 0x0080; 1244 pub const ADJ_SETOFFSET: ::c_uint = 0x0100; 1245 pub const ADJ_MICRO: ::c_uint = 0x1000; 1246 pub const ADJ_NANO: ::c_uint = 0x2000; 1247 pub const ADJ_TICK: ::c_uint = 0x4000; 1248 pub const ADJ_OFFSET_SINGLESHOT: ::c_uint = 0x8001; 1249 pub const ADJ_OFFSET_SS_READ: ::c_uint = 0xa001; 1250 pub const MOD_OFFSET: ::c_uint = ADJ_OFFSET; 1251 pub const MOD_FREQUENCY: ::c_uint = ADJ_FREQUENCY; 1252 pub const MOD_MAXERROR: ::c_uint = ADJ_MAXERROR; 1253 pub const MOD_ESTERROR: ::c_uint = ADJ_ESTERROR; 1254 pub const MOD_STATUS: ::c_uint = ADJ_STATUS; 1255 pub const MOD_TIMECONST: ::c_uint = ADJ_TIMECONST; 1256 pub const MOD_CLKB: ::c_uint = ADJ_TICK; 1257 pub const MOD_CLKA: ::c_uint = ADJ_OFFSET_SINGLESHOT; 1258 pub const MOD_TAI: ::c_uint = ADJ_TAI; 1259 pub const MOD_MICRO: ::c_uint = ADJ_MICRO; 1260 pub const MOD_NANO: ::c_uint = ADJ_NANO; 1261 pub const STA_PLL: ::c_int = 0x0001; 1262 pub const STA_PPSFREQ: ::c_int = 0x0002; 1263 pub const STA_PPSTIME: ::c_int = 0x0004; 1264 pub const STA_FLL: ::c_int = 0x0008; 1265 pub const STA_INS: ::c_int = 0x0010; 1266 pub const STA_DEL: ::c_int = 0x0020; 1267 pub const STA_UNSYNC: ::c_int = 0x0040; 1268 pub const STA_FREQHOLD: ::c_int = 0x0080; 1269 pub const STA_PPSSIGNAL: ::c_int = 0x0100; 1270 pub const STA_PPSJITTER: ::c_int = 0x0200; 1271 pub const STA_PPSWANDER: ::c_int = 0x0400; 1272 pub const STA_PPSERROR: ::c_int = 0x0800; 1273 pub const STA_CLOCKERR: ::c_int = 0x1000; 1274 pub const STA_NANO: ::c_int = 0x2000; 1275 pub const STA_MODE: ::c_int = 0x4000; 1276 pub const STA_CLK: ::c_int = 0x8000; 1277 pub const STA_RONLY: ::c_int = STA_PPSSIGNAL 1278 | STA_PPSJITTER 1279 | STA_PPSWANDER 1280 | STA_PPSERROR 1281 | STA_CLOCKERR 1282 | STA_NANO 1283 | STA_MODE 1284 | STA_CLK; 1285 pub const NTP_API: ::c_int = 4; 1286 pub const TIME_OK: ::c_int = 0; 1287 pub const TIME_INS: ::c_int = 1; 1288 pub const TIME_DEL: ::c_int = 2; 1289 pub const TIME_OOP: ::c_int = 3; 1290 pub const TIME_WAIT: ::c_int = 4; 1291 pub const TIME_ERROR: ::c_int = 5; 1292 pub const TIME_BAD: ::c_int = TIME_ERROR; 1293 pub const MAXTC: ::c_long = 6; 1294 1295 cfg_if! { 1296 if #[cfg(any( 1297 target_arch = "arm", 1298 target_arch = "x86", 1299 target_arch = "x86_64", 1300 target_arch = "s390x", 1301 target_arch = "riscv64", 1302 target_arch = "riscv32" 1303 ))] { 1304 pub const PTHREAD_STACK_MIN: ::size_t = 16384; 1305 } else if #[cfg(any( 1306 target_arch = "sparc", 1307 target_arch = "sparc64" 1308 ))] { 1309 pub const PTHREAD_STACK_MIN: ::size_t = 0x6000; 1310 } else { 1311 pub const PTHREAD_STACK_MIN: ::size_t = 131072; 1312 } 1313 } 1314 pub const PTHREAD_MUTEX_ADAPTIVE_NP: ::c_int = 3; 1315 1316 pub const REG_STARTEND: ::c_int = 4; 1317 1318 pub const REG_EEND: ::c_int = 14; 1319 pub const REG_ESIZE: ::c_int = 15; 1320 pub const REG_ERPAREN: ::c_int = 16; 1321 1322 extern "C" { 1323 pub fn fgetspent_r( 1324 fp: *mut ::FILE, 1325 spbuf: *mut ::spwd, 1326 buf: *mut ::c_char, 1327 buflen: ::size_t, 1328 spbufp: *mut *mut ::spwd, 1329 ) -> ::c_int; 1330 pub fn sgetspent_r( 1331 s: *const ::c_char, 1332 spbuf: *mut ::spwd, 1333 buf: *mut ::c_char, 1334 buflen: ::size_t, 1335 spbufp: *mut *mut ::spwd, 1336 ) -> ::c_int; 1337 pub fn getspent_r( 1338 spbuf: *mut ::spwd, 1339 buf: *mut ::c_char, 1340 buflen: ::size_t, 1341 spbufp: *mut *mut ::spwd, 1342 ) -> ::c_int; 1343 pub fn qsort_r( 1344 base: *mut ::c_void, 1345 num: ::size_t, 1346 size: ::size_t, 1347 compar: ::Option< 1348 unsafe extern "C" fn( 1349 *const ::c_void, 1350 *const ::c_void, 1351 *mut ::c_void, 1352 ) -> ::c_int, 1353 >, 1354 arg: *mut ::c_void, 1355 ); 1356 pub fn sendmmsg( 1357 sockfd: ::c_int, 1358 msgvec: *mut ::mmsghdr, 1359 vlen: ::c_uint, 1360 flags: ::c_int, 1361 ) -> ::c_int; 1362 pub fn recvmmsg( 1363 sockfd: ::c_int, 1364 msgvec: *mut ::mmsghdr, 1365 vlen: ::c_uint, 1366 flags: ::c_int, 1367 timeout: *mut ::timespec, 1368 ) -> ::c_int; 1369 1370 pub fn getrlimit64( 1371 resource: ::__rlimit_resource_t, 1372 rlim: *mut ::rlimit64, 1373 ) -> ::c_int; 1374 pub fn setrlimit64( 1375 resource: ::__rlimit_resource_t, 1376 rlim: *const ::rlimit64, 1377 ) -> ::c_int; 1378 pub fn getrlimit( 1379 resource: ::__rlimit_resource_t, 1380 rlim: *mut ::rlimit, 1381 ) -> ::c_int; 1382 pub fn setrlimit( 1383 resource: ::__rlimit_resource_t, 1384 rlim: *const ::rlimit, 1385 ) -> ::c_int; 1386 pub fn prlimit( 1387 pid: ::pid_t, 1388 resource: ::__rlimit_resource_t, 1389 new_limit: *const ::rlimit, 1390 old_limit: *mut ::rlimit, 1391 ) -> ::c_int; 1392 pub fn prlimit64( 1393 pid: ::pid_t, 1394 resource: ::__rlimit_resource_t, 1395 new_limit: *const ::rlimit64, 1396 old_limit: *mut ::rlimit64, 1397 ) -> ::c_int; 1398 pub fn utmpname(file: *const ::c_char) -> ::c_int; 1399 pub fn utmpxname(file: *const ::c_char) -> ::c_int; 1400 pub fn getutxent() -> *mut utmpx; 1401 pub fn getutxid(ut: *const utmpx) -> *mut utmpx; 1402 pub fn getutxline(ut: *const utmpx) -> *mut utmpx; 1403 pub fn pututxline(ut: *const utmpx) -> *mut utmpx; 1404 pub fn setutxent(); 1405 pub fn endutxent(); 1406 pub fn getpt() -> ::c_int; 1407 pub fn mallopt(param: ::c_int, value: ::c_int) -> ::c_int; 1408 pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int; 1409 pub fn statx( 1410 dirfd: ::c_int, 1411 pathname: *const c_char, 1412 flags: ::c_int, 1413 mask: ::c_uint, 1414 statxbuf: *mut statx, 1415 ) -> ::c_int; 1416 pub fn getrandom( 1417 buf: *mut ::c_void, 1418 buflen: ::size_t, 1419 flags: ::c_uint, 1420 ) -> ::ssize_t; 1421 1422 pub fn memmem( 1423 haystack: *const ::c_void, 1424 haystacklen: ::size_t, 1425 needle: *const ::c_void, 1426 needlelen: ::size_t, 1427 ) -> *mut ::c_void; 1428 pub fn getauxval(type_: ::c_ulong) -> ::c_ulong; 1429 1430 pub fn adjtimex(buf: *mut timex) -> ::c_int; 1431 pub fn ntp_adjtime(buf: *mut timex) -> ::c_int; 1432 #[link_name = "ntp_gettimex"] 1433 pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int; 1434 pub fn copy_file_range( 1435 fd_in: ::c_int, 1436 off_in: *mut ::off64_t, 1437 fd_out: ::c_int, 1438 off_out: *mut ::off64_t, 1439 len: ::size_t, 1440 flags: ::c_uint, 1441 ) -> ::ssize_t; 1442 pub fn fanotify_mark( 1443 fd: ::c_int, 1444 flags: ::c_uint, 1445 mask: u64, 1446 dirfd: ::c_int, 1447 path: *const ::c_char, 1448 ) -> ::c_int; 1449 pub fn preadv2( 1450 fd: ::c_int, 1451 iov: *const ::iovec, 1452 iovcnt: ::c_int, 1453 offset: ::off_t, 1454 flags: ::c_int, 1455 ) -> ::ssize_t; 1456 pub fn pwritev2( 1457 fd: ::c_int, 1458 iov: *const ::iovec, 1459 iovcnt: ::c_int, 1460 offset: ::off_t, 1461 flags: ::c_int, 1462 ) -> ::ssize_t; 1463 } 1464 1465 extern "C" { 1466 pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int; 1467 pub fn backtrace(buf: *mut *mut ::c_void, sz: ::c_int) -> ::c_int; 1468 pub fn glob64( 1469 pattern: *const ::c_char, 1470 flags: ::c_int, 1471 errfunc: ::Option< 1472 extern "C" fn(epath: *const ::c_char, errno: ::c_int) -> ::c_int, 1473 >, 1474 pglob: *mut glob64_t, 1475 ) -> ::c_int; 1476 pub fn globfree64(pglob: *mut glob64_t); 1477 pub fn ptrace(request: ::c_uint, ...) -> ::c_long; 1478 pub fn pthread_attr_getaffinity_np( 1479 attr: *const ::pthread_attr_t, 1480 cpusetsize: ::size_t, 1481 cpuset: *mut ::cpu_set_t, 1482 ) -> ::c_int; 1483 pub fn pthread_attr_setaffinity_np( 1484 attr: *mut ::pthread_attr_t, 1485 cpusetsize: ::size_t, 1486 cpuset: *const ::cpu_set_t, 1487 ) -> ::c_int; 1488 pub fn getpriority(which: ::__priority_which_t, who: ::id_t) -> ::c_int; 1489 pub fn setpriority( 1490 which: ::__priority_which_t, 1491 who: ::id_t, 1492 prio: ::c_int, 1493 ) -> ::c_int; 1494 pub fn pthread_getaffinity_np( 1495 thread: ::pthread_t, 1496 cpusetsize: ::size_t, 1497 cpuset: *mut ::cpu_set_t, 1498 ) -> ::c_int; 1499 pub fn pthread_setaffinity_np( 1500 thread: ::pthread_t, 1501 cpusetsize: ::size_t, 1502 cpuset: *const ::cpu_set_t, 1503 ) -> ::c_int; 1504 pub fn pthread_rwlockattr_getkind_np( 1505 attr: *const ::pthread_rwlockattr_t, 1506 val: *mut ::c_int, 1507 ) -> ::c_int; 1508 pub fn pthread_rwlockattr_setkind_np( 1509 attr: *mut ::pthread_rwlockattr_t, 1510 val: ::c_int, 1511 ) -> ::c_int; 1512 pub fn sched_getcpu() -> ::c_int; 1513 pub fn mallinfo() -> ::mallinfo; 1514 pub fn malloc_usable_size(ptr: *mut ::c_void) -> ::size_t; 1515 pub fn getpwent_r( 1516 pwd: *mut ::passwd, 1517 buf: *mut ::c_char, 1518 buflen: ::size_t, 1519 result: *mut *mut ::passwd, 1520 ) -> ::c_int; 1521 pub fn getgrent_r( 1522 grp: *mut ::group, 1523 buf: *mut ::c_char, 1524 buflen: ::size_t, 1525 result: *mut *mut ::group, 1526 ) -> ::c_int; 1527 pub fn pthread_getname_np( 1528 thread: ::pthread_t, 1529 name: *mut ::c_char, 1530 len: ::size_t, 1531 ) -> ::c_int; 1532 pub fn pthread_setname_np( 1533 thread: ::pthread_t, 1534 name: *const ::c_char, 1535 ) -> ::c_int; 1536 } 1537 1538 extern "C" { 1539 pub fn dlmopen( 1540 lmid: Lmid_t, 1541 filename: *const ::c_char, 1542 flag: ::c_int, 1543 ) -> *mut ::c_void; 1544 pub fn dlinfo( 1545 handle: *mut ::c_void, 1546 request: ::c_int, 1547 info: *mut ::c_void, 1548 ) -> ::c_int; 1549 } 1550 1551 cfg_if! { 1552 if #[cfg(any(target_arch = "x86", 1553 target_arch = "arm", 1554 target_arch = "mips", 1555 target_arch = "powerpc", 1556 target_arch = "sparc", 1557 target_arch = "riscv32"))] { 1558 mod b32; 1559 pub use self::b32::*; 1560 } else if #[cfg(any(target_arch = "x86_64", 1561 target_arch = "aarch64", 1562 target_arch = "powerpc64", 1563 target_arch = "mips64", 1564 target_arch = "s390x", 1565 target_arch = "sparc64", 1566 target_arch = "riscv64"))] { 1567 mod b64; 1568 pub use self::b64::*; 1569 } else { 1570 // Unknown target_arch 1571 } 1572 } 1573 1574 cfg_if! { 1575 if #[cfg(libc_align)] { 1576 mod align; 1577 pub use self::align::*; 1578 } else { 1579 mod no_align; 1580 pub use self::no_align::*; 1581 } 1582 } 1583