Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aienux/blob/main/vendor/libc/src/unix/nto/mod.rs # aienux Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aienux / vendor / libc / src / unix / nto / mod.rs` 3021 lines ยท 99630 bytes Raw Blame History 1 //! Definitions for QNX Software Development Platform 2 //! 3 //! This module applies to: 4 //! 5 //! * `aarch64-unknown-nto-qnx700` 6 //! * `aarch64-unknown-nto-qnx710` 7 //! * `aarch64-unknown-nto-qnx710_iosock` 8 //! * `aarch64-unknown-qnx` 9 //! * `i686-pc-nto-qnx700` 10 //! * `x86_64-pc-nto-qnx710` 11 //! * `x86_64-pc-nto-qnx710_iosock` 12 //! * `x86_64-pc-qnx` 13 //! 14 //! There are sub-modules for the target architecture, and sub-modules for the 15 //! kind of networking library used. QNX SDP 7.0 uses `io-pkt`, QNX SDP 8.0 16 //! uses `io-sock`, and QNX SDP 7.1 comes with both (so you can pick). 17 18 use crate::prelude::*; 19 20 // QNX definitions of common UNIX things 21 22 pub type clock_t = u32; 23 24 pub type sa_family_t = u8; 25 pub type speed_t = c_uint; 26 pub type tcflag_t = c_uint; 27 pub type clockid_t = c_int; 28 pub type timer_t = c_int; 29 pub type key_t = c_uint; 30 pub type id_t = c_int; 31 32 pub type useconds_t = u32; 33 pub type dev_t = u32; 34 pub type socklen_t = u32; 35 pub type mode_t = u32; 36 pub type rlim64_t = u64; 37 pub type mqd_t = c_int; 38 pub type nfds_t = c_uint; 39 pub type idtype_t = c_uint; 40 pub type errno_t = c_int; 41 pub type rsize_t = c_ulong; 42 43 pub type Elf32_Half = u16; 44 pub type Elf32_Word = u32; 45 pub type Elf32_Off = u32; 46 pub type Elf32_Addr = u32; 47 pub type Elf32_Lword = u64; 48 pub type Elf32_Sword = i32; 49 50 pub type Elf64_Half = u16; 51 pub type Elf64_Word = u32; 52 pub type Elf64_Off = u64; 53 pub type Elf64_Addr = u64; 54 pub type Elf64_Xword = u64; 55 pub type Elf64_Sxword = i64; 56 pub type Elf64_Lword = u64; 57 pub type Elf64_Sword = i32; 58 59 pub type Elf32_Section = u16; 60 pub type Elf64_Section = u16; 61 62 pub type _Time32t = u32; 63 64 pub type pthread_t = c_int; 65 pub type regoff_t = ssize_t; 66 67 pub type nlink_t = u32; 68 pub type blksize_t = u32; 69 pub type suseconds_t = i32; 70 71 pub type ino_t = u64; 72 pub type off_t = i64; 73 pub type blkcnt_t = u64; 74 pub type msgqnum_t = u64; 75 pub type msglen_t = u64; 76 pub type fsblkcnt_t = u64; 77 pub type fsfilcnt_t = u64; 78 pub type rlim_t = u64; 79 pub type posix_spawn_file_actions_t = *mut c_void; 80 pub type posix_spawnattr_t = crate::uintptr_t; 81 82 pub type pthread_mutex_t = crate::sync_t; 83 pub type pthread_mutexattr_t = crate::_sync_attr; 84 pub type pthread_cond_t = crate::sync_t; 85 pub type pthread_condattr_t = crate::_sync_attr; 86 pub type pthread_rwlockattr_t = crate::_sync_attr; 87 pub type pthread_key_t = c_int; 88 pub type pthread_spinlock_t = sync_t; 89 pub type pthread_barrierattr_t = _sync_attr; 90 pub type sem_t = sync_t; 91 92 pub type nl_item = c_int; 93 94 extern_ty! { 95 pub type timezone; 96 } 97 98 s! { 99 pub struct dirent_extra { 100 pub d_datalen: u16, 101 pub d_type: u16, 102 d_reserved: Padding, 103 } 104 105 pub struct stat { 106 pub st_ino: crate::ino_t, 107 pub st_size: off_t, 108 pub st_dev: crate::dev_t, 109 pub st_rdev: crate::dev_t, 110 pub st_uid: crate::uid_t, 111 pub st_gid: crate::gid_t, 112 pub __old_st_mtime: crate::_Time32t, 113 pub __old_st_atime: crate::_Time32t, 114 pub __old_st_ctime: crate::_Time32t, 115 pub st_mode: mode_t, 116 pub st_nlink: crate::nlink_t, 117 pub st_blocksize: crate::blksize_t, 118 pub st_nblocks: i32, 119 pub st_blksize: crate::blksize_t, 120 pub st_blocks: crate::blkcnt_t, 121 pub st_mtim: crate::timespec, 122 pub st_atim: crate::timespec, 123 pub st_ctim: crate::timespec, 124 } 125 126 pub struct ip_mreq { 127 pub imr_multiaddr: in_addr, 128 pub imr_interface: in_addr, 129 } 130 131 pub struct sockaddr { 132 pub sa_len: u8, 133 pub sa_family: sa_family_t, 134 pub sa_data: [c_char; 14], 135 } 136 137 pub struct sockaddr_in6 { 138 pub sin6_len: u8, 139 pub sin6_family: sa_family_t, 140 pub sin6_port: crate::in_port_t, 141 pub sin6_flowinfo: u32, 142 pub sin6_addr: crate::in6_addr, 143 pub sin6_scope_id: u32, 144 } 145 146 // The order of the `ai_addr` field in this struct is crucial 147 // for converting between the Rust and C types. 148 pub struct addrinfo { 149 pub ai_flags: c_int, 150 pub ai_family: c_int, 151 pub ai_socktype: c_int, 152 pub ai_protocol: c_int, 153 pub ai_addrlen: socklen_t, 154 pub ai_canonname: *mut c_char, 155 pub ai_addr: *mut crate::sockaddr, 156 pub ai_next: *mut addrinfo, 157 } 158 159 pub struct fd_set { 160 fds_bits: [c_uint; 2 * FD_SETSIZE as usize / ULONG_SIZE], 161 } 162 163 pub struct tm { 164 pub tm_sec: c_int, 165 pub tm_min: c_int, 166 pub tm_hour: c_int, 167 pub tm_mday: c_int, 168 pub tm_mon: c_int, 169 pub tm_year: c_int, 170 pub tm_wday: c_int, 171 pub tm_yday: c_int, 172 pub tm_isdst: c_int, 173 pub tm_gmtoff: c_long, 174 pub tm_zone: *const c_char, 175 } 176 177 #[repr(align(8))] 178 pub struct sched_param { 179 pub sched_priority: c_int, 180 pub sched_curpriority: c_int, 181 reserved: Padding<[c_int; 10]>, 182 } 183 184 #[repr(align(8))] 185 pub struct __sched_param { 186 pub __sched_priority: c_int, 187 pub __sched_curpriority: c_int, 188 reserved: Padding<[c_int; 10]>, 189 } 190 191 pub struct Dl_info { 192 pub dli_fname: *const c_char, 193 pub dli_fbase: *mut c_void, 194 pub dli_sname: *const c_char, 195 pub dli_saddr: *mut c_void, 196 } 197 198 pub struct lconv { 199 pub currency_symbol: *mut c_char, 200 pub int_curr_symbol: *mut c_char, 201 pub mon_decimal_point: *mut c_char, 202 pub mon_grouping: *mut c_char, 203 pub mon_thousands_sep: *mut c_char, 204 pub negative_sign: *mut c_char, 205 pub positive_sign: *mut c_char, 206 pub frac_digits: c_char, 207 pub int_frac_digits: c_char, 208 pub n_cs_precedes: c_char, 209 pub n_sep_by_space: c_char, 210 pub n_sign_posn: c_char, 211 pub p_cs_precedes: c_char, 212 pub p_sep_by_space: c_char, 213 pub p_sign_posn: c_char, 214 215 pub int_n_cs_precedes: c_char, 216 pub int_n_sep_by_space: c_char, 217 pub int_n_sign_posn: c_char, 218 pub int_p_cs_precedes: c_char, 219 pub int_p_sep_by_space: c_char, 220 pub int_p_sign_posn: c_char, 221 222 pub decimal_point: *mut c_char, 223 pub grouping: *mut c_char, 224 pub thousands_sep: *mut c_char, 225 226 pub _Frac_grouping: *mut c_char, 227 pub _Frac_sep: *mut c_char, 228 pub _False: *mut c_char, 229 pub _True: *mut c_char, 230 231 pub _No: *mut c_char, 232 pub _Yes: *mut c_char, 233 pub _Nostr: *mut c_char, 234 pub _Yesstr: *mut c_char, 235 _Reserved: Padding<[*mut c_char; 8]>, 236 } 237 238 pub struct ifaddrs { 239 pub ifa_next: *mut ifaddrs, 240 pub ifa_name: *mut c_char, 241 pub ifa_flags: c_uint, 242 pub ifa_addr: *mut crate::sockaddr, 243 pub ifa_netmask: *mut crate::sockaddr, 244 pub ifa_dstaddr: *mut crate::sockaddr, 245 pub ifa_data: *mut c_void, 246 } 247 248 pub struct arpreq { 249 pub arp_pa: crate::sockaddr, 250 pub arp_ha: crate::sockaddr, 251 pub arp_flags: c_int, 252 } 253 254 #[repr(align(8))] 255 pub struct siginfo_t { 256 pub si_signo: c_int, 257 pub si_code: c_int, 258 pub si_errno: c_int, 259 __data: [u8; 36], // union 260 } 261 262 pub struct sigaction { 263 pub sa_sigaction: crate::sighandler_t, 264 pub sa_flags: c_int, 265 pub sa_mask: crate::sigset_t, 266 } 267 268 pub struct _sync { 269 _union: c_uint, 270 __owner: c_uint, 271 } 272 pub struct rlimit64 { 273 pub rlim_cur: rlim64_t, 274 pub rlim_max: rlim64_t, 275 } 276 277 // FIXME(1.0): This should not implement `PartialEq` 278 #[allow(unpredictable_function_pointer_comparisons)] 279 pub struct glob_t { 280 pub gl_pathc: size_t, 281 pub gl_matchc: c_int, 282 pub gl_pathv: *mut *mut c_char, 283 pub gl_offs: size_t, 284 pub gl_flags: c_int, 285 pub gl_errfunc: extern "C" fn(*const c_char, c_int) -> c_int, 286 287 __unused1: Padding<*mut c_void>, 288 __unused2: Padding<*mut c_void>, 289 __unused3: Padding<*mut c_void>, 290 __unused4: Padding<*mut c_void>, 291 __unused5: Padding<*mut c_void>, 292 } 293 294 pub struct passwd { 295 pub pw_name: *mut c_char, 296 pub pw_passwd: *mut c_char, 297 pub pw_uid: crate::uid_t, 298 pub pw_gid: crate::gid_t, 299 pub pw_age: *mut c_char, 300 pub pw_comment: *mut c_char, 301 pub pw_gecos: *mut c_char, 302 pub pw_dir: *mut c_char, 303 pub pw_shell: *mut c_char, 304 } 305 306 pub struct if_nameindex { 307 pub if_index: c_uint, 308 pub if_name: *mut c_char, 309 } 310 311 pub struct sembuf { 312 pub sem_num: c_ushort, 313 pub sem_op: c_short, 314 pub sem_flg: c_short, 315 } 316 317 pub struct Elf32_Ehdr { 318 pub e_ident: [c_uchar; 16], 319 pub e_type: Elf32_Half, 320 pub e_machine: Elf32_Half, 321 pub e_version: Elf32_Word, 322 pub e_entry: Elf32_Addr, 323 pub e_phoff: Elf32_Off, 324 pub e_shoff: Elf32_Off, 325 pub e_flags: Elf32_Word, 326 pub e_ehsize: Elf32_Half, 327 pub e_phentsize: Elf32_Half, 328 pub e_phnum: Elf32_Half, 329 pub e_shentsize: Elf32_Half, 330 pub e_shnum: Elf32_Half, 331 pub e_shstrndx: Elf32_Half, 332 } 333 334 pub struct Elf64_Ehdr { 335 pub e_ident: [c_uchar; 16], 336 pub e_type: Elf64_Half, 337 pub e_machine: Elf64_Half, 338 pub e_version: Elf64_Word, 339 pub e_entry: Elf64_Addr, 340 pub e_phoff: Elf64_Off, 341 pub e_shoff: Elf64_Off, 342 pub e_flags: Elf64_Word, 343 pub e_ehsize: Elf64_Half, 344 pub e_phentsize: Elf64_Half, 345 pub e_phnum: Elf64_Half, 346 pub e_shentsize: Elf64_Half, 347 pub e_shnum: Elf64_Half, 348 pub e_shstrndx: Elf64_Half, 349 } 350 351 pub struct Elf32_Sym { 352 pub st_name: Elf32_Word, 353 pub st_value: Elf32_Addr, 354 pub st_size: Elf32_Word, 355 pub st_info: c_uchar, 356 pub st_other: c_uchar, 357 pub st_shndx: Elf32_Section, 358 } 359 360 pub struct Elf64_Sym { 361 pub st_name: Elf64_Word, 362 pub st_info: c_uchar, 363 pub st_other: c_uchar, 364 pub st_shndx: Elf64_Section, 365 pub st_value: Elf64_Addr, 366 pub st_size: Elf64_Xword, 367 } 368 369 pub struct Elf32_Phdr { 370 pub p_type: Elf32_Word, 371 pub p_offset: Elf32_Off, 372 pub p_vaddr: Elf32_Addr, 373 pub p_paddr: Elf32_Addr, 374 pub p_filesz: Elf32_Word, 375 pub p_memsz: Elf32_Word, 376 pub p_flags: Elf32_Word, 377 pub p_align: Elf32_Word, 378 } 379 380 pub struct Elf64_Phdr { 381 pub p_type: Elf64_Word, 382 pub p_flags: Elf64_Word, 383 pub p_offset: Elf64_Off, 384 pub p_vaddr: Elf64_Addr, 385 pub p_paddr: Elf64_Addr, 386 pub p_filesz: Elf64_Xword, 387 pub p_memsz: Elf64_Xword, 388 pub p_align: Elf64_Xword, 389 } 390 391 pub struct Elf32_Shdr { 392 pub sh_name: Elf32_Word, 393 pub sh_type: Elf32_Word, 394 pub sh_flags: Elf32_Word, 395 pub sh_addr: Elf32_Addr, 396 pub sh_offset: Elf32_Off, 397 pub sh_size: Elf32_Word, 398 pub sh_link: Elf32_Word, 399 pub sh_info: Elf32_Word, 400 pub sh_addralign: Elf32_Word, 401 pub sh_entsize: Elf32_Word, 402 } 403 404 pub struct Elf64_Shdr { 405 pub sh_name: Elf64_Word, 406 pub sh_type: Elf64_Word, 407 pub sh_flags: Elf64_Xword, 408 pub sh_addr: Elf64_Addr, 409 pub sh_offset: Elf64_Off, 410 pub sh_size: Elf64_Xword, 411 pub sh_link: Elf64_Word, 412 pub sh_info: Elf64_Word, 413 pub sh_addralign: Elf64_Xword, 414 pub sh_entsize: Elf64_Xword, 415 } 416 417 pub struct in6_pktinfo { 418 pub ipi6_addr: crate::in6_addr, 419 pub ipi6_ifindex: c_uint, 420 } 421 422 pub struct inotify_event { 423 pub wd: c_int, 424 pub mask: u32, 425 pub cookie: u32, 426 pub len: u32, 427 } 428 429 pub struct regmatch_t { 430 pub rm_so: regoff_t, 431 pub rm_eo: regoff_t, 432 } 433 434 pub struct msghdr { 435 pub msg_name: *mut c_void, 436 pub msg_namelen: crate::socklen_t, 437 pub msg_iov: *mut crate::iovec, 438 pub msg_iovlen: c_int, 439 pub msg_control: *mut c_void, 440 pub msg_controllen: crate::socklen_t, 441 pub msg_flags: c_int, 442 } 443 444 pub struct cmsghdr { 445 pub cmsg_len: crate::socklen_t, 446 pub cmsg_level: c_int, 447 pub cmsg_type: c_int, 448 } 449 450 pub struct termios { 451 pub c_iflag: crate::tcflag_t, 452 pub c_oflag: crate::tcflag_t, 453 pub c_cflag: crate::tcflag_t, 454 pub c_lflag: crate::tcflag_t, 455 pub c_cc: [crate::cc_t; crate::NCCS], 456 __reserved: Padding<[c_uint; 3]>, 457 pub c_ispeed: crate::speed_t, 458 pub c_ospeed: crate::speed_t, 459 } 460 461 pub struct mallinfo { 462 pub arena: c_int, 463 pub ordblks: c_int, 464 pub smblks: c_int, 465 pub hblks: c_int, 466 pub hblkhd: c_int, 467 pub usmblks: c_int, 468 pub fsmblks: c_int, 469 pub uordblks: c_int, 470 pub fordblks: c_int, 471 pub keepcost: c_int, 472 } 473 474 pub struct flock { 475 pub l_type: i16, 476 pub l_whence: i16, 477 pub l_zero1: i32, 478 pub l_start: off_t, 479 pub l_len: off_t, 480 pub l_pid: crate::pid_t, 481 pub l_sysid: u32, 482 } 483 484 pub struct statvfs { 485 pub f_bsize: c_ulong, 486 pub f_frsize: c_ulong, 487 pub f_blocks: crate::fsblkcnt_t, 488 pub f_bfree: crate::fsblkcnt_t, 489 pub f_bavail: crate::fsblkcnt_t, 490 pub f_files: crate::fsfilcnt_t, 491 pub f_ffree: crate::fsfilcnt_t, 492 pub f_favail: crate::fsfilcnt_t, 493 pub f_fsid: c_ulong, 494 pub f_basetype: [c_char; 16], 495 pub f_flag: c_ulong, 496 pub f_namemax: c_ulong, 497 f_filler: [c_uint; 21], 498 } 499 500 pub struct aiocb { 501 pub aio_fildes: c_int, 502 pub aio_reqprio: c_int, 503 pub aio_offset: off_t, 504 pub aio_buf: *mut c_void, 505 pub aio_nbytes: size_t, 506 pub aio_sigevent: crate::sigevent, 507 pub aio_lio_opcode: c_int, 508 pub _aio_lio_state: *mut c_void, 509 _aio_pad: Padding<[c_int; 3]>, 510 pub _aio_next: *mut crate::aiocb, 511 pub _aio_flag: c_uint, 512 pub _aio_iotype: c_uint, 513 pub _aio_result: ssize_t, 514 pub _aio_error: c_uint, 515 pub _aio_suspend: *mut c_void, 516 pub _aio_plist: *mut c_void, 517 pub _aio_policy: c_int, 518 pub _aio_param: crate::__sched_param, 519 } 520 521 pub struct pthread_attr_t { 522 __data1: c_long, 523 __data2: [u8; 96], 524 } 525 526 pub struct ipc_perm { 527 pub uid: crate::uid_t, 528 pub gid: crate::gid_t, 529 pub cuid: crate::uid_t, 530 pub cgid: crate::gid_t, 531 pub mode: mode_t, 532 pub seq: c_uint, 533 pub key: crate::key_t, 534 _reserved: Padding<[c_int; 4]>, 535 } 536 537 pub struct regex_t { 538 re_magic: c_int, 539 re_nsub: size_t, 540 re_endp: *const c_char, 541 re_g: *mut c_void, 542 } 543 544 // FIXME(1.0): This should not implement `PartialEq` 545 #[allow(unpredictable_function_pointer_comparisons)] 546 pub struct _thread_attr { 547 pub __flags: c_int, 548 pub __stacksize: size_t, 549 pub __stackaddr: *mut c_void, 550 pub __exitfunc: Option, 551 pub __policy: c_int, 552 pub __param: crate::__sched_param, 553 pub __guardsize: c_uint, 554 pub __prealloc: c_uint, 555 __spare: [c_int; 2], 556 } 557 558 pub struct _sync_attr { 559 pub __protocol: c_int, 560 pub __flags: c_int, 561 pub __prioceiling: c_int, 562 pub __clockid: c_int, 563 pub __count: c_int, 564 __reserved: Padding<[c_int; 3]>, 565 } 566 567 pub struct sockcred { 568 pub sc_uid: crate::uid_t, 569 pub sc_euid: crate::uid_t, 570 pub sc_gid: crate::gid_t, 571 pub sc_egid: crate::gid_t, 572 pub sc_ngroups: c_int, 573 pub sc_groups: [crate::gid_t; 1], 574 } 575 576 pub struct bpf_program { 577 pub bf_len: c_uint, 578 pub bf_insns: *mut crate::bpf_insn, 579 } 580 581 pub struct bpf_version { 582 pub bv_major: c_ushort, 583 pub bv_minor: c_ushort, 584 } 585 586 pub struct bpf_hdr { 587 pub bh_tstamp: crate::timeval, 588 pub bh_caplen: u32, 589 pub bh_datalen: u32, 590 pub bh_hdrlen: u16, 591 } 592 593 pub struct bpf_insn { 594 pub code: u16, 595 pub jt: c_uchar, 596 pub jf: c_uchar, 597 pub k: u32, 598 } 599 600 pub struct bpf_dltlist { 601 pub bfl_len: c_uint, 602 pub bfl_list: *mut c_uint, 603 } 604 605 pub struct dl_phdr_info { 606 pub dlpi_addr: crate::Elf64_Addr, 607 pub dlpi_name: *const c_char, 608 pub dlpi_phdr: *const crate::Elf64_Phdr, 609 pub dlpi_phnum: crate::Elf64_Half, 610 } 611 612 #[repr(align(8))] 613 pub struct ucontext_t { 614 pub uc_link: *mut ucontext_t, 615 pub uc_sigmask: crate::sigset_t, 616 pub uc_stack: stack_t, 617 pub uc_mcontext: mcontext_t, 618 } 619 pub struct sockaddr_un { 620 pub sun_len: u8, 621 pub sun_family: sa_family_t, 622 pub sun_path: [c_char; 104], 623 } 624 625 pub struct sockaddr_storage { 626 pub ss_len: u8, 627 pub ss_family: sa_family_t, 628 __ss_pad1: Padding<[c_char; 6]>, 629 __ss_align: i64, 630 __ss_pad2: Padding<[c_char; 112]>, 631 } 632 633 pub struct utsname { 634 pub sysname: [c_char; _SYSNAME_SIZE], 635 pub nodename: [c_char; _SYSNAME_SIZE], 636 pub release: [c_char; _SYSNAME_SIZE], 637 pub version: [c_char; _SYSNAME_SIZE], 638 pub machine: [c_char; _SYSNAME_SIZE], 639 } 640 641 pub struct sigevent { 642 pub sigev_notify: c_int, 643 __padding1: Padding, 644 pub sigev_signo: c_int, // union 645 __padding2: Padding, 646 pub sigev_value: crate::sigval, 647 __sigev_un2: usize, // union 648 } 649 pub struct dirent { 650 pub d_ino: crate::ino_t, 651 pub d_offset: off_t, 652 pub d_reclen: c_short, 653 pub d_namelen: c_short, 654 pub d_name: [c_char; 1], // flex array 655 } 656 657 pub struct sigset_t { 658 __val: [u32; 2], 659 } 660 661 pub struct mq_attr { 662 pub mq_maxmsg: c_long, 663 pub mq_msgsize: c_long, 664 pub mq_flags: c_long, 665 pub mq_curmsgs: c_long, 666 pub mq_sendwait: c_long, 667 pub mq_recvwait: c_long, 668 } 669 } 670 671 s_no_extra_traits! { 672 pub struct msg { 673 pub msg_next: *mut crate::msg, 674 pub msg_type: c_long, 675 pub msg_ts: c_ushort, 676 pub msg_spot: c_short, 677 _pad: Padding<[u8; 4]>, 678 } 679 680 pub struct msqid_ds { 681 pub msg_perm: crate::ipc_perm, 682 pub msg_first: *mut crate::msg, 683 pub msg_last: *mut crate::msg, 684 pub msg_cbytes: crate::msglen_t, 685 pub msg_qnum: crate::msgqnum_t, 686 pub msg_qbytes: crate::msglen_t, 687 pub msg_lspid: crate::pid_t, 688 pub msg_lrpid: crate::pid_t, 689 pub msg_stime: crate::time_t, 690 msg_pad1: Padding, 691 pub msg_rtime: crate::time_t, 692 msg_pad2: Padding, 693 pub msg_ctime: crate::time_t, 694 msg_pad3: Padding, 695 msg_pad4: Padding<[c_long; 4]>, 696 } 697 698 pub struct sync_t { 699 __u: c_uint, // union 700 pub __owner: c_uint, 701 } 702 703 #[repr(align(4))] 704 pub struct pthread_barrier_t { 705 // union 706 __pad: Padding<[u8; 28]>, // union 707 } 708 709 pub struct pthread_rwlock_t { 710 pub __active: c_int, 711 pub __blockedwriters: c_int, 712 pub __blockedreaders: c_int, 713 pub __heavy: c_int, 714 pub __lock: crate::pthread_mutex_t, // union 715 pub __rcond: crate::pthread_cond_t, // union 716 pub __wcond: crate::pthread_cond_t, // union 717 pub __owner: c_uint, 718 pub __spare: c_uint, 719 } 720 721 // There is no canonical definition of c_longdouble in Rust. For both AArch64 and x86_64, 722 // however, the size and alignment properties are that of the gcc __int128 which corresponds (at 723 // least on rustc 1.78+ with LLVM 18, see 724 // https://blog.rust-lang.org/2024/03/30/i128-layout-update/) to i128. Use this instead until we 725 // get native f128 support. 726 // 727 // The definition was taken from the definition of the _Maxalignt struct in the QNX SDK. 728 // However, on QNX SDP 7, there is a different definition of std::max_align_t (the C++ version of 729 // this type). In practice, this doesn't make a difference for the _alignment_ properties of the 730 // type - however, it changes the size, so using in in any other form than the zero-sized array 731 // form would be bogus and it would potentially change the size of the data type. On QNX SDP 8, this 732 // got fixed and both C and C++ are using the same definition. 733 pub struct max_align_t { 734 _ll: crate::c_longlong, 735 _ld: i128, 736 } 737 } 738 739 pub const _SYSNAME_SIZE: usize = 256 + 1; 740 pub const RLIM_INFINITY: crate::rlim_t = 0xfffffffffffffffd; 741 pub const O_LARGEFILE: c_int = 0o0100000; 742 743 // intentionally not public, only used for fd_set 744 cfg_if! { 745 if #[cfg(target_pointer_width = "32")] { 746 const ULONG_SIZE: usize = 32; 747 } else if #[cfg(target_pointer_width = "64")] { 748 const ULONG_SIZE: usize = 64; 749 } else { 750 // Unknown target_pointer_width 751 } 752 } 753 754 pub const EXIT_FAILURE: c_int = 1; 755 pub const EXIT_SUCCESS: c_int = 0; 756 pub const RAND_MAX: c_int = 32767; 757 pub const EOF: c_int = -1; 758 pub const SEEK_SET: c_int = 0; 759 pub const SEEK_CUR: c_int = 1; 760 pub const SEEK_END: c_int = 2; 761 pub const _IOFBF: c_int = 0; 762 pub const _IONBF: c_int = 2; 763 pub const _IOLBF: c_int = 1; 764 765 pub const F_DUPFD: c_int = 0; 766 pub const F_GETFD: c_int = 1; 767 pub const F_SETFD: c_int = 2; 768 pub const F_GETFL: c_int = 3; 769 pub const F_SETFL: c_int = 4; 770 771 pub const F_DUPFD_CLOEXEC: c_int = 5; 772 773 pub const SIGTRAP: c_int = 5; 774 775 pub const CLOCK_REALTIME: crate::clockid_t = 0; 776 pub const CLOCK_MONOTONIC: crate::clockid_t = 2; 777 pub const CLOCK_PROCESS_CPUTIME_ID: crate::clockid_t = 3; 778 pub const CLOCK_THREAD_CPUTIME_ID: crate::clockid_t = 4; 779 pub const TIMER_ABSTIME: c_uint = 0x80000000; 780 781 pub const RUSAGE_SELF: c_int = 0; 782 783 pub const F_OK: c_int = 0; 784 pub const X_OK: c_int = 1; 785 pub const W_OK: c_int = 2; 786 pub const R_OK: c_int = 4; 787 788 pub const SIGHUP: c_int = 1; 789 pub const SIGINT: c_int = 2; 790 pub const SIGQUIT: c_int = 3; 791 pub const SIGILL: c_int = 4; 792 pub const SIGABRT: c_int = 6; 793 pub const SIGFPE: c_int = 8; 794 pub const SIGKILL: c_int = 9; 795 pub const SIGSEGV: c_int = 11; 796 pub const SIGPIPE: c_int = 13; 797 pub const SIGALRM: c_int = 14; 798 pub const SIGTERM: c_int = 15; 799 800 pub const PROT_NONE: c_int = 0x00000000; 801 pub const PROT_READ: c_int = 0x00000100; 802 pub const PROT_WRITE: c_int = 0x00000200; 803 pub const PROT_EXEC: c_int = 0x00000400; 804 805 pub const MAP_FILE: c_int = 0; 806 pub const MAP_SHARED: c_int = 1; 807 pub const MAP_PRIVATE: c_int = 2; 808 pub const MAP_FIXED: c_int = 0x10; 809 810 pub const MAP_FAILED: *mut c_void = !0 as *mut c_void; 811 812 pub const MS_ASYNC: c_int = 1; 813 pub const MS_INVALIDATE: c_int = 4; 814 pub const MS_SYNC: c_int = 2; 815 816 pub const SCM_RIGHTS: c_int = 0x01; 817 pub const SCM_TIMESTAMP: c_int = 0x02; 818 819 pub const MAP_TYPE: c_int = 0x3; 820 821 pub const IFF_UP: c_int = 0x00000001; 822 pub const IFF_BROADCAST: c_int = 0x00000002; 823 pub const IFF_DEBUG: c_int = 0x00000004; 824 pub const IFF_LOOPBACK: c_int = 0x00000008; 825 pub const IFF_POINTOPOINT: c_int = 0x00000010; 826 pub const IFF_RUNNING: c_int = 0x00000040; 827 pub const IFF_NOARP: c_int = 0x00000080; 828 pub const IFF_PROMISC: c_int = 0x00000100; 829 pub const IFF_ALLMULTI: c_int = 0x00000200; 830 pub const IFF_MULTICAST: c_int = 0x00008000; 831 832 pub const AF_UNSPEC: c_int = 0; 833 pub const AF_UNIX: c_int = AF_LOCAL; 834 pub const AF_LOCAL: c_int = 1; 835 pub const AF_INET: c_int = 2; 836 pub const AF_IPX: c_int = 23; 837 pub const AF_APPLETALK: c_int = 16; 838 pub const AF_ROUTE: c_int = 17; 839 pub const AF_SNA: c_int = 11; 840 841 pub const AF_ISDN: c_int = 26; 842 843 pub const PF_UNSPEC: c_int = AF_UNSPEC; 844 pub const PF_UNIX: c_int = PF_LOCAL; 845 pub const PF_LOCAL: c_int = AF_LOCAL; 846 pub const PF_INET: c_int = AF_INET; 847 pub const PF_IPX: c_int = AF_IPX; 848 pub const PF_APPLETALK: c_int = AF_APPLETALK; 849 pub const PF_INET6: c_int = AF_INET6; 850 pub const PF_KEY: c_int = pseudo_AF_KEY; 851 pub const PF_ROUTE: c_int = AF_ROUTE; 852 pub const PF_SNA: c_int = AF_SNA; 853 854 pub const PF_BLUETOOTH: c_int = AF_BLUETOOTH; 855 pub const PF_ISDN: c_int = AF_ISDN; 856 857 pub const SOMAXCONN: c_int = 128; 858 859 pub const MSG_OOB: c_int = 0x0001; 860 pub const MSG_PEEK: c_int = 0x0002; 861 pub const MSG_DONTROUTE: c_int = 0x0004; 862 pub const MSG_CTRUNC: c_int = 0x0020; 863 pub const MSG_TRUNC: c_int = 0x0010; 864 pub const MSG_DONTWAIT: c_int = 0x0080; 865 pub const MSG_EOR: c_int = 0x0008; 866 pub const MSG_WAITALL: c_int = 0x0040; 867 868 pub const IP_TOS: c_int = 3; 869 pub const IP_TTL: c_int = 4; 870 pub const IP_HDRINCL: c_int = 2; 871 pub const IP_OPTIONS: c_int = 1; 872 pub const IP_RECVOPTS: c_int = 5; 873 pub const IP_RETOPTS: c_int = 8; 874 pub const IP_MULTICAST_IF: c_int = 9; 875 pub const IP_MULTICAST_TTL: c_int = 10; 876 pub const IP_MULTICAST_LOOP: c_int = 11; 877 pub const IP_ADD_MEMBERSHIP: c_int = 12; 878 pub const IP_DROP_MEMBERSHIP: c_int = 13; 879 pub const IP_DEFAULT_MULTICAST_TTL: c_int = 1; 880 pub const IP_DEFAULT_MULTICAST_LOOP: c_int = 1; 881 882 pub const IPPROTO_HOPOPTS: c_int = 0; 883 pub const IPPROTO_IGMP: c_int = 2; 884 pub const IPPROTO_IPIP: c_int = 4; 885 pub const IPPROTO_EGP: c_int = 8; 886 pub const IPPROTO_PUP: c_int = 12; 887 pub const IPPROTO_IDP: c_int = 22; 888 pub const IPPROTO_TP: c_int = 29; 889 pub const IPPROTO_ROUTING: c_int = 43; 890 pub const IPPROTO_FRAGMENT: c_int = 44; 891 pub const IPPROTO_RSVP: c_int = 46; 892 pub const IPPROTO_GRE: c_int = 47; 893 pub const IPPROTO_ESP: c_int = 50; 894 pub const IPPROTO_AH: c_int = 51; 895 pub const IPPROTO_NONE: c_int = 59; 896 pub const IPPROTO_DSTOPTS: c_int = 60; 897 pub const IPPROTO_ENCAP: c_int = 98; 898 pub const IPPROTO_PIM: c_int = 103; 899 pub const IPPROTO_SCTP: c_int = 132; 900 pub const IPPROTO_RAW: c_int = 255; 901 pub const IPPROTO_MAX: c_int = 256; 902 pub const IPPROTO_CARP: c_int = 112; 903 pub const IPPROTO_DONE: c_int = 257; 904 pub const IPPROTO_EON: c_int = 80; 905 pub const IPPROTO_ETHERIP: c_int = 97; 906 pub const IPPROTO_GGP: c_int = 3; 907 pub const IPPROTO_IPCOMP: c_int = 108; 908 pub const IPPROTO_MOBILE: c_int = 55; 909 910 pub const IPV6_RTHDR_LOOSE: c_int = 0; 911 pub const IPV6_RTHDR_STRICT: c_int = 1; 912 pub const IPV6_UNICAST_HOPS: c_int = 4; 913 pub const IPV6_MULTICAST_IF: c_int = 9; 914 pub const IPV6_MULTICAST_HOPS: c_int = 10; 915 pub const IPV6_MULTICAST_LOOP: c_int = 11; 916 pub const IPV6_JOIN_GROUP: c_int = 12; 917 pub const IPV6_LEAVE_GROUP: c_int = 13; 918 pub const IPV6_CHECKSUM: c_int = 26; 919 pub const IPV6_V6ONLY: c_int = 27; 920 pub const IPV6_RTHDRDSTOPTS: c_int = 35; 921 pub const IPV6_RECVPKTINFO: c_int = 36; 922 pub const IPV6_RECVHOPLIMIT: c_int = 37; 923 pub const IPV6_RECVRTHDR: c_int = 38; 924 pub const IPV6_RECVHOPOPTS: c_int = 39; 925 pub const IPV6_RECVDSTOPTS: c_int = 40; 926 pub const IPV6_RECVPATHMTU: c_int = 43; 927 pub const IPV6_PATHMTU: c_int = 44; 928 pub const IPV6_PKTINFO: c_int = 46; 929 pub const IPV6_HOPLIMIT: c_int = 47; 930 pub const IPV6_NEXTHOP: c_int = 48; 931 pub const IPV6_HOPOPTS: c_int = 49; 932 pub const IPV6_DSTOPTS: c_int = 50; 933 pub const IPV6_RECVTCLASS: c_int = 57; 934 pub const IPV6_TCLASS: c_int = 61; 935 pub const IPV6_DONTFRAG: c_int = 62; 936 937 pub const TCP_NODELAY: c_int = 0x01; 938 pub const TCP_MAXSEG: c_int = 0x02; 939 pub const TCP_MD5SIG: c_int = 0x10; 940 941 pub const SHUT_RD: c_int = 0; 942 pub const SHUT_WR: c_int = 1; 943 pub const SHUT_RDWR: c_int = 2; 944 945 pub const LOCK_SH: c_int = 0x1; 946 pub const LOCK_EX: c_int = 0x2; 947 pub const LOCK_NB: c_int = 0x4; 948 pub const LOCK_UN: c_int = 0x8; 949 950 pub const SS_ONSTACK: c_int = 1; 951 pub const SS_DISABLE: c_int = 2; 952 953 /// Constants may change across releases. See the [usage guidelines](crate#usage-guidelines) 954 /// for details. 955 pub const PATH_MAX: c_int = 1024; 956 957 pub const UIO_MAXIOV: c_int = 1024; 958 959 pub const FD_SETSIZE: usize = 256; 960 961 pub const TCIOFF: c_int = 0x0002; 962 pub const TCION: c_int = 0x0003; 963 pub const TCOOFF: c_int = 0x0000; 964 pub const TCOON: c_int = 0x0001; 965 pub const TCIFLUSH: c_int = 0; 966 pub const TCOFLUSH: c_int = 1; 967 pub const TCIOFLUSH: c_int = 2; 968 pub const NL0: crate::tcflag_t = 0x000; 969 pub const NL1: crate::tcflag_t = 0x100; 970 pub const TAB0: crate::tcflag_t = 0x0000; 971 pub const CR0: crate::tcflag_t = 0x000; 972 pub const FF0: crate::tcflag_t = 0x0000; 973 pub const BS0: crate::tcflag_t = 0x0000; 974 pub const VT0: crate::tcflag_t = 0x0000; 975 pub const VERASE: usize = 2; 976 pub const VKILL: usize = 3; 977 pub const VINTR: usize = 0; 978 pub const VQUIT: usize = 1; 979 pub const VLNEXT: usize = 15; 980 pub const IGNBRK: crate::tcflag_t = 0x00000001; 981 pub const BRKINT: crate::tcflag_t = 0x00000002; 982 pub const IGNPAR: crate::tcflag_t = 0x00000004; 983 pub const PARMRK: crate::tcflag_t = 0x00000008; 984 pub const INPCK: crate::tcflag_t = 0x00000010; 985 pub const ISTRIP: crate::tcflag_t = 0x00000020; 986 pub const INLCR: crate::tcflag_t = 0x00000040; 987 pub const IGNCR: crate::tcflag_t = 0x00000080; 988 pub const ICRNL: crate::tcflag_t = 0x00000100; 989 pub const IXANY: crate::tcflag_t = 0x00000800; 990 pub const IMAXBEL: crate::tcflag_t = 0x00002000; 991 pub const OPOST: crate::tcflag_t = 0x00000001; 992 pub const CS5: crate::tcflag_t = 0x00; 993 pub const ECHO: crate::tcflag_t = 0x00000008; 994 pub const OCRNL: crate::tcflag_t = 0x00000008; 995 pub const ONOCR: crate::tcflag_t = 0x00000010; 996 pub const ONLRET: crate::tcflag_t = 0x00000020; 997 pub const OFILL: crate::tcflag_t = 0x00000040; 998 pub const OFDEL: crate::tcflag_t = 0x00000080; 999 1000 pub const WNOHANG: c_int = 0x0040; 1001 pub const WUNTRACED: c_int = 0x0004; 1002 pub const WSTOPPED: c_int = WUNTRACED; 1003 pub const WEXITED: c_int = 0x0001; 1004 pub const WCONTINUED: c_int = 0x0008; 1005 pub const WNOWAIT: c_int = 0x0080; 1006 pub const WTRAPPED: c_int = 0x0002; 1007 1008 pub const RTLD_LOCAL: c_int = 0x0200; 1009 pub const RTLD_LAZY: c_int = 0x0001; 1010 1011 pub const POSIX_FADV_NORMAL: c_int = 0; 1012 pub const POSIX_FADV_RANDOM: c_int = 2; 1013 pub const POSIX_FADV_SEQUENTIAL: c_int = 1; 1014 pub const POSIX_FADV_WILLNEED: c_int = 3; 1015 1016 pub const AT_FDCWD: c_int = -100; 1017 pub const AT_EACCESS: c_int = 0x0001; 1018 pub const AT_SYMLINK_NOFOLLOW: c_int = 0x0002; 1019 pub const AT_SYMLINK_FOLLOW: c_int = 0x0004; 1020 pub const AT_REMOVEDIR: c_int = 0x0008; 1021 1022 pub const LOG_CRON: c_int = 9 << 3; 1023 pub const LOG_AUTHPRIV: c_int = 10 << 3; 1024 pub const LOG_FTP: c_int = 11 << 3; 1025 pub const LOG_PERROR: c_int = 0x20; 1026 1027 pub const PIPE_BUF: usize = 5120; 1028 1029 pub const CLD_EXITED: c_int = 1; 1030 pub const CLD_KILLED: c_int = 2; 1031 pub const CLD_DUMPED: c_int = 3; 1032 pub const CLD_TRAPPED: c_int = 4; 1033 pub const CLD_STOPPED: c_int = 5; 1034 pub const CLD_CONTINUED: c_int = 6; 1035 1036 pub const UTIME_OMIT: c_long = 0x40000002; 1037 pub const UTIME_NOW: c_long = 0x40000001; 1038 1039 pub const POLLIN: c_short = POLLRDNORM | POLLRDBAND; 1040 pub const POLLPRI: c_short = 0x0008; 1041 pub const POLLOUT: c_short = 0x0002; 1042 pub const POLLERR: c_short = 0x0020; 1043 pub const POLLHUP: c_short = 0x0040; 1044 pub const POLLNVAL: c_short = 0x1000; 1045 pub const POLLRDNORM: c_short = 0x0001; 1046 pub const POLLRDBAND: c_short = 0x0004; 1047 1048 pub const IPTOS_LOWDELAY: u8 = 0x10; 1049 pub const IPTOS_THROUGHPUT: u8 = 0x08; 1050 pub const IPTOS_RELIABILITY: u8 = 0x04; 1051 pub const IPTOS_MINCOST: u8 = 0x02; 1052 1053 pub const IPTOS_PREC_NETCONTROL: u8 = 0xe0; 1054 pub const IPTOS_PREC_INTERNETCONTROL: u8 = 0xc0; 1055 pub const IPTOS_PREC_CRITIC_ECP: u8 = 0xa0; 1056 pub const IPTOS_PREC_FLASHOVERRIDE: u8 = 0x80; 1057 pub const IPTOS_PREC_FLASH: u8 = 0x60; 1058 pub const IPTOS_PREC_IMMEDIATE: u8 = 0x40; 1059 pub const IPTOS_PREC_PRIORITY: u8 = 0x20; 1060 pub const IPTOS_PREC_ROUTINE: u8 = 0x00; 1061 1062 pub const IPTOS_ECN_MASK: u8 = 0x03; 1063 pub const IPTOS_ECN_ECT1: u8 = 0x01; 1064 pub const IPTOS_ECN_ECT0: u8 = 0x02; 1065 pub const IPTOS_ECN_CE: u8 = 0x03; 1066 1067 pub const IPOPT_CONTROL: u8 = 0x00; 1068 pub const IPOPT_RESERVED1: u8 = 0x20; 1069 pub const IPOPT_RESERVED2: u8 = 0x60; 1070 pub const IPOPT_LSRR: u8 = 131; 1071 pub const IPOPT_RR: u8 = 7; 1072 pub const IPOPT_SSRR: u8 = 137; 1073 pub const IPDEFTTL: u8 = 64; 1074 pub const IPOPT_OPTVAL: u8 = 0; 1075 pub const IPOPT_OLEN: u8 = 1; 1076 pub const IPOPT_OFFSET: u8 = 2; 1077 pub const IPOPT_MINOFF: u8 = 4; 1078 pub const IPOPT_NOP: u8 = 1; 1079 pub const IPOPT_EOL: u8 = 0; 1080 pub const IPOPT_TS: u8 = 68; 1081 pub const IPOPT_TS_TSONLY: u8 = 0; 1082 pub const IPOPT_TS_TSANDADDR: u8 = 1; 1083 pub const IPOPT_TS_PRESPEC: u8 = 3; 1084 1085 pub const MAX_IPOPTLEN: u8 = 40; 1086 pub const IPVERSION: u8 = 4; 1087 pub const MAXTTL: u8 = 255; 1088 1089 pub const ARPHRD_ETHER: u16 = 1; 1090 pub const ARPHRD_IEEE802: u16 = 6; 1091 pub const ARPHRD_IEEE1394: u16 = 24; 1092 1093 pub const SOL_SOCKET: c_int = 0xffff; 1094 1095 pub const SO_DEBUG: c_int = 0x0001; 1096 pub const SO_REUSEADDR: c_int = 0x0004; 1097 pub const SO_TYPE: c_int = 0x1008; 1098 pub const SO_ERROR: c_int = 0x1007; 1099 pub const SO_DONTROUTE: c_int = 0x0010; 1100 pub const SO_BROADCAST: c_int = 0x0020; 1101 pub const SO_SNDBUF: c_int = 0x1001; 1102 pub const SO_RCVBUF: c_int = 0x1002; 1103 pub const SO_KEEPALIVE: c_int = 0x0008; 1104 pub const SO_OOBINLINE: c_int = 0x0100; 1105 pub const SO_LINGER: c_int = 0x0080; 1106 pub const SO_REUSEPORT: c_int = 0x0200; 1107 pub const SO_RCVLOWAT: c_int = 0x1004; 1108 pub const SO_SNDLOWAT: c_int = 0x1003; 1109 pub const SO_RCVTIMEO: c_int = 0x1006; 1110 pub const SO_SNDTIMEO: c_int = 0x1005; 1111 pub const SO_TIMESTAMP: c_int = 0x0400; 1112 pub const SO_ACCEPTCONN: c_int = 0x0002; 1113 1114 pub const TIOCM_LE: c_int = 0x0100; 1115 pub const TIOCM_DTR: c_int = 0x0001; 1116 pub const TIOCM_RTS: c_int = 0x0002; 1117 pub const TIOCM_ST: c_int = 0x0200; 1118 pub const TIOCM_SR: c_int = 0x0400; 1119 pub const TIOCM_CTS: c_int = 0x1000; 1120 pub const TIOCM_CAR: c_int = TIOCM_CD; 1121 pub const TIOCM_CD: c_int = 0x8000; 1122 pub const TIOCM_RNG: c_int = TIOCM_RI; 1123 pub const TIOCM_RI: c_int = 0x4000; 1124 pub const TIOCM_DSR: c_int = 0x2000; 1125 1126 pub const SCHED_OTHER: c_int = 3; 1127 pub const SCHED_FIFO: c_int = 1; 1128 pub const SCHED_RR: c_int = 2; 1129 1130 pub const IPC_PRIVATE: crate::key_t = 0; 1131 1132 pub const IPC_CREAT: c_int = 0o001000; 1133 pub const IPC_EXCL: c_int = 0o002000; 1134 pub const IPC_NOWAIT: c_int = 0o004000; 1135 1136 pub const IPC_RMID: c_int = 0; 1137 pub const IPC_SET: c_int = 1; 1138 pub const IPC_STAT: c_int = 2; 1139 1140 pub const MSG_NOERROR: c_int = 0o010000; 1141 1142 pub const LOG_NFACILITIES: c_int = 24; 1143 1144 pub const SEM_FAILED: *mut crate::sem_t = 0xFFFFFFFFFFFFFFFF as *mut sem_t; 1145 1146 pub const AI_PASSIVE: c_int = 0x00000001; 1147 pub const AI_CANONNAME: c_int = 0x00000002; 1148 pub const AI_NUMERICHOST: c_int = 0x00000004; 1149 1150 pub const AI_NUMERICSERV: c_int = 0x00000008; 1151 1152 pub const EAI_BADFLAGS: c_int = 3; 1153 pub const EAI_NONAME: c_int = 8; 1154 pub const EAI_AGAIN: c_int = 2; 1155 pub const EAI_FAIL: c_int = 4; 1156 pub const EAI_FAMILY: c_int = 5; 1157 pub const EAI_SOCKTYPE: c_int = 10; 1158 pub const EAI_SERVICE: c_int = 9; 1159 pub const EAI_MEMORY: c_int = 6; 1160 pub const EAI_SYSTEM: c_int = 11; 1161 pub const EAI_OVERFLOW: c_int = 14; 1162 1163 pub const NI_NUMERICHOST: c_int = 0x00000002; 1164 pub const NI_NUMERICSERV: c_int = 0x00000008; 1165 pub const NI_NOFQDN: c_int = 0x00000001; 1166 pub const NI_NAMEREQD: c_int = 0x00000004; 1167 pub const NI_DGRAM: c_int = 0x00000010; 1168 1169 pub const AIO_CANCELED: c_int = 0; 1170 pub const AIO_NOTCANCELED: c_int = 2; 1171 pub const AIO_ALLDONE: c_int = 1; 1172 pub const LIO_READ: c_int = 1; 1173 pub const LIO_WRITE: c_int = 2; 1174 pub const LIO_NOP: c_int = 0; 1175 pub const LIO_WAIT: c_int = 1; 1176 pub const LIO_NOWAIT: c_int = 0; 1177 1178 pub const ITIMER_REAL: c_int = 0; 1179 pub const ITIMER_VIRTUAL: c_int = 1; 1180 pub const ITIMER_PROF: c_int = 2; 1181 1182 // DIFF(main): changed to `c_short` in `f62eb023ab` 1183 pub const POSIX_SPAWN_RESETIDS: c_int = 0x00000010; 1184 pub const POSIX_SPAWN_SETPGROUP: c_int = 0x00000001; 1185 pub const POSIX_SPAWN_SETSIGDEF: c_int = 0x00000004; 1186 pub const POSIX_SPAWN_SETSIGMASK: c_int = 0x00000002; 1187 pub const POSIX_SPAWN_SETSCHEDPARAM: c_int = 0x00000400; 1188 pub const POSIX_SPAWN_SETSCHEDULER: c_int = 0x00000040; 1189 1190 pub const RTF_UP: c_ushort = 0x0001; 1191 pub const RTF_GATEWAY: c_ushort = 0x0002; 1192 1193 pub const RTF_HOST: c_ushort = 0x0004; 1194 pub const RTF_DYNAMIC: c_ushort = 0x0010; 1195 pub const RTF_MODIFIED: c_ushort = 0x0020; 1196 pub const RTF_REJECT: c_ushort = 0x0008; 1197 pub const RTF_STATIC: c_ushort = 0x0800; 1198 pub const RTF_XRESOLVE: c_ushort = 0x0200; 1199 pub const RTM_NEWADDR: u16 = 0xc; 1200 pub const RTM_DELADDR: u16 = 0xd; 1201 pub const RTA_DST: c_ushort = 0x1; 1202 pub const RTA_GATEWAY: c_ushort = 0x2; 1203 1204 pub const IN_ACCESS: u32 = 0x00000001; 1205 pub const IN_MODIFY: u32 = 0x00000002; 1206 pub const IN_ATTRIB: u32 = 0x00000004; 1207 pub const IN_CLOSE_WRITE: u32 = 0x00000008; 1208 pub const IN_CLOSE_NOWRITE: u32 = 0x00000010; 1209 pub const IN_CLOSE: u32 = IN_CLOSE_WRITE | IN_CLOSE_NOWRITE; 1210 pub const IN_OPEN: u32 = 0x00000020; 1211 pub const IN_MOVED_FROM: u32 = 0x00000040; 1212 pub const IN_MOVED_TO: u32 = 0x00000080; 1213 pub const IN_MOVE: u32 = IN_MOVED_FROM | IN_MOVED_TO; 1214 pub const IN_CREATE: u32 = 0x00000100; 1215 pub const IN_DELETE: u32 = 0x00000200; 1216 pub const IN_DELETE_SELF: u32 = 0x00000400; 1217 pub const IN_MOVE_SELF: u32 = 0x00000800; 1218 pub const IN_UNMOUNT: u32 = 0x00002000; 1219 pub const IN_Q_OVERFLOW: u32 = 0x00004000; 1220 pub const IN_IGNORED: u32 = 0x00008000; 1221 pub const IN_ONLYDIR: u32 = 0x01000000; 1222 pub const IN_DONT_FOLLOW: u32 = 0x02000000; 1223 1224 pub const IN_ISDIR: u32 = 0x40000000; 1225 pub const IN_ONESHOT: u32 = 0x80000000; 1226 1227 pub const REG_EXTENDED: c_int = 0o0001; 1228 pub const REG_ICASE: c_int = 0o0002; 1229 pub const REG_NEWLINE: c_int = 0o0010; 1230 pub const REG_NOSUB: c_int = 0o0004; 1231 1232 pub const REG_NOTBOL: c_int = 0o00001; 1233 pub const REG_NOTEOL: c_int = 0o00002; 1234 1235 pub const REG_ENOSYS: c_int = 17; 1236 pub const REG_NOMATCH: c_int = 1; 1237 pub const REG_BADPAT: c_int = 2; 1238 pub const REG_ECOLLATE: c_int = 3; 1239 pub const REG_ECTYPE: c_int = 4; 1240 pub const REG_EESCAPE: c_int = 5; 1241 pub const REG_ESUBREG: c_int = 6; 1242 pub const REG_EBRACK: c_int = 7; 1243 pub const REG_EPAREN: c_int = 8; 1244 pub const REG_EBRACE: c_int = 9; 1245 pub const REG_BADBR: c_int = 10; 1246 pub const REG_ERANGE: c_int = 11; 1247 pub const REG_ESPACE: c_int = 12; 1248 pub const REG_BADRPT: c_int = 13; 1249 1250 // errno.h 1251 pub const EOK: c_int = 0; 1252 pub const EWOULDBLOCK: c_int = EAGAIN; 1253 pub const EPERM: c_int = 1; 1254 pub const ENOENT: c_int = 2; 1255 pub const ESRCH: c_int = 3; 1256 pub const EINTR: c_int = 4; 1257 pub const EIO: c_int = 5; 1258 pub const ENXIO: c_int = 6; 1259 pub const E2BIG: c_int = 7; 1260 pub const ENOEXEC: c_int = 8; 1261 pub const EBADF: c_int = 9; 1262 pub const ECHILD: c_int = 10; 1263 pub const EAGAIN: c_int = 11; 1264 pub const ENOMEM: c_int = 12; 1265 pub const EACCES: c_int = 13; 1266 pub const EFAULT: c_int = 14; 1267 pub const ENOTBLK: c_int = 15; 1268 pub const EBUSY: c_int = 16; 1269 pub const EEXIST: c_int = 17; 1270 pub const EXDEV: c_int = 18; 1271 pub const ENODEV: c_int = 19; 1272 pub const ENOTDIR: c_int = 20; 1273 pub const EISDIR: c_int = 21; 1274 pub const EINVAL: c_int = 22; 1275 pub const ENFILE: c_int = 23; 1276 pub const EMFILE: c_int = 24; 1277 pub const ENOTTY: c_int = 25; 1278 pub const ETXTBSY: c_int = 26; 1279 pub const EFBIG: c_int = 27; 1280 pub const ENOSPC: c_int = 28; 1281 pub const ESPIPE: c_int = 29; 1282 pub const EROFS: c_int = 30; 1283 pub const EMLINK: c_int = 31; 1284 pub const EPIPE: c_int = 32; 1285 pub const EDOM: c_int = 33; 1286 pub const ERANGE: c_int = 34; 1287 pub const ENOMSG: c_int = 35; 1288 pub const EIDRM: c_int = 36; 1289 pub const ECHRNG: c_int = 37; 1290 pub const EL2NSYNC: c_int = 38; 1291 pub const EL3HLT: c_int = 39; 1292 pub const EL3RST: c_int = 40; 1293 pub const ELNRNG: c_int = 41; 1294 pub const EUNATCH: c_int = 42; 1295 pub const ENOCSI: c_int = 43; 1296 pub const EL2HLT: c_int = 44; 1297 pub const EDEADLK: c_int = 45; 1298 pub const ENOLCK: c_int = 46; 1299 pub const ECANCELED: c_int = 47; 1300 pub const EDQUOT: c_int = 49; 1301 pub const EBADE: c_int = 50; 1302 pub const EBADR: c_int = 51; 1303 pub const EXFULL: c_int = 52; 1304 pub const ENOANO: c_int = 53; 1305 pub const EBADRQC: c_int = 54; 1306 pub const EBADSLT: c_int = 55; 1307 pub const EDEADLOCK: c_int = 56; 1308 pub const EBFONT: c_int = 57; 1309 pub const EOWNERDEAD: c_int = 58; 1310 pub const ENOSTR: c_int = 60; 1311 pub const ENODATA: c_int = 61; 1312 pub const ETIME: c_int = 62; 1313 pub const ENOSR: c_int = 63; 1314 pub const ENONET: c_int = 64; 1315 pub const ENOPKG: c_int = 65; 1316 pub const EREMOTE: c_int = 66; 1317 pub const ENOLINK: c_int = 67; 1318 pub const EADV: c_int = 68; 1319 pub const ESRMNT: c_int = 69; 1320 pub const ECOMM: c_int = 70; 1321 pub const EPROTO: c_int = 71; 1322 pub const EMULTIHOP: c_int = 74; 1323 pub const EBADMSG: c_int = 77; 1324 pub const ENAMETOOLONG: c_int = 78; 1325 pub const EOVERFLOW: c_int = 79; 1326 pub const ENOTUNIQ: c_int = 80; 1327 pub const EBADFD: c_int = 81; 1328 pub const EREMCHG: c_int = 82; 1329 pub const ELIBACC: c_int = 83; 1330 pub const ELIBBAD: c_int = 84; 1331 pub const ELIBSCN: c_int = 85; 1332 pub const ELIBMAX: c_int = 86; 1333 pub const ELIBEXEC: c_int = 87; 1334 pub const EILSEQ: c_int = 88; 1335 pub const ENOSYS: c_int = 89; 1336 pub const ELOOP: c_int = 90; 1337 pub const ERESTART: c_int = 91; 1338 pub const ESTRPIPE: c_int = 92; 1339 pub const ENOTEMPTY: c_int = 93; 1340 pub const EUSERS: c_int = 94; 1341 pub const ENOTRECOVERABLE: c_int = 95; 1342 pub const EOPNOTSUPP: c_int = 103; 1343 pub const EFPOS: c_int = 110; 1344 pub const ESTALE: c_int = 122; 1345 pub const EINPROGRESS: c_int = 236; 1346 pub const EALREADY: c_int = 237; 1347 pub const ENOTSOCK: c_int = 238; 1348 pub const EDESTADDRREQ: c_int = 239; 1349 pub const EMSGSIZE: c_int = 240; 1350 pub const EPROTOTYPE: c_int = 241; 1351 pub const ENOPROTOOPT: c_int = 242; 1352 pub const EPROTONOSUPPORT: c_int = 243; 1353 pub const ESOCKTNOSUPPORT: c_int = 244; 1354 pub const EPFNOSUPPORT: c_int = 246; 1355 pub const EAFNOSUPPORT: c_int = 247; 1356 pub const EADDRINUSE: c_int = 248; 1357 pub const EADDRNOTAVAIL: c_int = 249; 1358 pub const ENETDOWN: c_int = 250; 1359 pub const ENETUNREACH: c_int = 251; 1360 pub const ENETRESET: c_int = 252; 1361 pub const ECONNABORTED: c_int = 253; 1362 pub const ECONNRESET: c_int = 254; 1363 pub const ENOBUFS: c_int = 255; 1364 pub const EISCONN: c_int = 256; 1365 pub const ENOTCONN: c_int = 257; 1366 pub const ESHUTDOWN: c_int = 258; 1367 pub const ETOOMANYREFS: c_int = 259; 1368 pub const ETIMEDOUT: c_int = 260; 1369 pub const ECONNREFUSED: c_int = 261; 1370 pub const EHOSTDOWN: c_int = 264; 1371 pub const EHOSTUNREACH: c_int = 265; 1372 pub const EBADRPC: c_int = 272; 1373 pub const ERPCMISMATCH: c_int = 273; 1374 pub const EPROGUNAVAIL: c_int = 274; 1375 pub const EPROGMISMATCH: c_int = 275; 1376 pub const EPROCUNAVAIL: c_int = 276; 1377 pub const ENOREMOTE: c_int = 300; 1378 pub const ENONDP: c_int = 301; 1379 pub const EBADFSYS: c_int = 302; 1380 pub const EMORE: c_int = 309; 1381 pub const ECTRLTERM: c_int = 310; 1382 pub const ENOLIC: c_int = 311; 1383 pub const ESRVRFAULT: c_int = 312; 1384 pub const EENDIAN: c_int = 313; 1385 pub const ESECTYPEINVAL: c_int = 314; 1386 1387 pub const RUSAGE_CHILDREN: c_int = -1; 1388 pub const L_tmpnam: c_uint = 255; 1389 1390 pub const _PC_LINK_MAX: c_int = 1; 1391 pub const _PC_MAX_CANON: c_int = 2; 1392 pub const _PC_MAX_INPUT: c_int = 3; 1393 pub const _PC_NAME_MAX: c_int = 4; 1394 pub const _PC_PATH_MAX: c_int = 5; 1395 pub const _PC_PIPE_BUF: c_int = 6; 1396 pub const _PC_CHOWN_RESTRICTED: c_int = 9; 1397 pub const _PC_NO_TRUNC: c_int = 7; 1398 pub const _PC_VDISABLE: c_int = 8; 1399 pub const _PC_SYNC_IO: c_int = 14; 1400 pub const _PC_ASYNC_IO: c_int = 12; 1401 pub const _PC_PRIO_IO: c_int = 13; 1402 pub const _PC_SOCK_MAXBUF: c_int = 15; 1403 pub const _PC_FILESIZEBITS: c_int = 16; 1404 pub const _PC_REC_INCR_XFER_SIZE: c_int = 22; 1405 pub const _PC_REC_MAX_XFER_SIZE: c_int = 23; 1406 pub const _PC_REC_MIN_XFER_SIZE: c_int = 24; 1407 pub const _PC_REC_XFER_ALIGN: c_int = 25; 1408 pub const _PC_ALLOC_SIZE_MIN: c_int = 21; 1409 pub const _PC_SYMLINK_MAX: c_int = 17; 1410 pub const _PC_2_SYMLINKS: c_int = 20; 1411 1412 pub const _SC_PAGE_SIZE: c_int = _SC_PAGESIZE; 1413 pub const _SC_ARG_MAX: c_int = 1; 1414 pub const _SC_CHILD_MAX: c_int = 2; 1415 pub const _SC_CLK_TCK: c_int = 3; 1416 pub const _SC_NGROUPS_MAX: c_int = 4; 1417 pub const _SC_OPEN_MAX: c_int = 5; 1418 pub const _SC_JOB_CONTROL: c_int = 6; 1419 pub const _SC_SAVED_IDS: c_int = 7; 1420 pub const _SC_VERSION: c_int = 8; 1421 pub const _SC_PASS_MAX: c_int = 9; 1422 pub const _SC_PAGESIZE: c_int = 11; 1423 pub const _SC_XOPEN_VERSION: c_int = 12; 1424 pub const _SC_STREAM_MAX: c_int = 13; 1425 pub const _SC_TZNAME_MAX: c_int = 14; 1426 pub const _SC_AIO_LISTIO_MAX: c_int = 15; 1427 pub const _SC_AIO_MAX: c_int = 16; 1428 pub const _SC_AIO_PRIO_DELTA_MAX: c_int = 17; 1429 pub const _SC_DELAYTIMER_MAX: c_int = 18; 1430 pub const _SC_MQ_OPEN_MAX: c_int = 19; 1431 pub const _SC_MQ_PRIO_MAX: c_int = 20; 1432 pub const _SC_RTSIG_MAX: c_int = 21; 1433 pub const _SC_SEM_NSEMS_MAX: c_int = 22; 1434 pub const _SC_SEM_VALUE_MAX: c_int = 23; 1435 pub const _SC_SIGQUEUE_MAX: c_int = 24; 1436 pub const _SC_TIMER_MAX: c_int = 25; 1437 pub const _SC_ASYNCHRONOUS_IO: c_int = 26; 1438 pub const _SC_FSYNC: c_int = 27; 1439 pub const _SC_MAPPED_FILES: c_int = 28; 1440 pub const _SC_MEMLOCK: c_int = 29; 1441 pub const _SC_MEMLOCK_RANGE: c_int = 30; 1442 pub const _SC_MEMORY_PROTECTION: c_int = 31; 1443 pub const _SC_MESSAGE_PASSING: c_int = 32; 1444 pub const _SC_PRIORITIZED_IO: c_int = 33; 1445 pub const _SC_PRIORITY_SCHEDULING: c_int = 34; 1446 pub const _SC_REALTIME_SIGNALS: c_int = 35; 1447 pub const _SC_SEMAPHORES: c_int = 36; 1448 pub const _SC_SHARED_MEMORY_OBJECTS: c_int = 37; 1449 pub const _SC_SYNCHRONIZED_IO: c_int = 38; 1450 pub const _SC_TIMERS: c_int = 39; 1451 pub const _SC_GETGR_R_SIZE_MAX: c_int = 40; 1452 pub const _SC_GETPW_R_SIZE_MAX: c_int = 41; 1453 pub const _SC_LOGIN_NAME_MAX: c_int = 42; 1454 pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: c_int = 43; 1455 pub const _SC_THREAD_KEYS_MAX: c_int = 44; 1456 pub const _SC_THREAD_STACK_MIN: c_int = 45; 1457 pub const _SC_THREAD_THREADS_MAX: c_int = 46; 1458 pub const _SC_TTY_NAME_MAX: c_int = 47; 1459 pub const _SC_THREADS: c_int = 48; 1460 pub const _SC_THREAD_ATTR_STACKADDR: c_int = 49; 1461 pub const _SC_THREAD_ATTR_STACKSIZE: c_int = 50; 1462 pub const _SC_THREAD_PRIORITY_SCHEDULING: c_int = 51; 1463 pub const _SC_THREAD_PRIO_INHERIT: c_int = 52; 1464 pub const _SC_THREAD_PRIO_PROTECT: c_int = 53; 1465 pub const _SC_THREAD_PROCESS_SHARED: c_int = 54; 1466 pub const _SC_THREAD_SAFE_FUNCTIONS: c_int = 55; 1467 pub const _SC_2_CHAR_TERM: c_int = 56; 1468 pub const _SC_2_C_BIND: c_int = 57; 1469 pub const _SC_2_C_DEV: c_int = 58; 1470 pub const _SC_2_C_VERSION: c_int = 59; 1471 pub const _SC_2_FORT_DEV: c_int = 60; 1472 pub const _SC_2_FORT_RUN: c_int = 61; 1473 pub const _SC_2_LOCALEDEF: c_int = 62; 1474 pub const _SC_2_SW_DEV: c_int = 63; 1475 pub const _SC_2_UPE: c_int = 64; 1476 pub const _SC_2_VERSION: c_int = 65; 1477 pub const _SC_ATEXIT_MAX: c_int = 66; 1478 pub const _SC_AVPHYS_PAGES: c_int = 67; 1479 pub const _SC_BC_BASE_MAX: c_int = 68; 1480 pub const _SC_BC_DIM_MAX: c_int = 69; 1481 pub const _SC_BC_SCALE_MAX: c_int = 70; 1482 pub const _SC_BC_STRING_MAX: c_int = 71; 1483 pub const _SC_CHARCLASS_NAME_MAX: c_int = 72; 1484 pub const _SC_CHAR_BIT: c_int = 73; 1485 pub const _SC_CHAR_MAX: c_int = 74; 1486 pub const _SC_CHAR_MIN: c_int = 75; 1487 pub const _SC_COLL_WEIGHTS_MAX: c_int = 76; 1488 pub const _SC_EQUIV_CLASS_MAX: c_int = 77; 1489 pub const _SC_EXPR_NEST_MAX: c_int = 78; 1490 pub const _SC_INT_MAX: c_int = 79; 1491 pub const _SC_INT_MIN: c_int = 80; 1492 pub const _SC_LINE_MAX: c_int = 81; 1493 pub const _SC_LONG_BIT: c_int = 82; 1494 pub const _SC_MB_LEN_MAX: c_int = 83; 1495 pub const _SC_NL_ARGMAX: c_int = 84; 1496 pub const _SC_NL_LANGMAX: c_int = 85; 1497 pub const _SC_NL_MSGMAX: c_int = 86; 1498 pub const _SC_NL_NMAX: c_int = 87; 1499 pub const _SC_NL_SETMAX: c_int = 88; 1500 pub const _SC_NL_TEXTMAX: c_int = 89; 1501 pub const _SC_NPROCESSORS_CONF: c_int = 90; 1502 pub const _SC_NPROCESSORS_ONLN: c_int = 91; 1503 pub const _SC_NZERO: c_int = 92; 1504 pub const _SC_PHYS_PAGES: c_int = 93; 1505 pub const _SC_PII: c_int = 94; 1506 pub const _SC_PII_INTERNET: c_int = 95; 1507 pub const _SC_PII_INTERNET_DGRAM: c_int = 96; 1508 pub const _SC_PII_INTERNET_STREAM: c_int = 97; 1509 pub const _SC_PII_OSI: c_int = 98; 1510 pub const _SC_PII_OSI_CLTS: c_int = 99; 1511 pub const _SC_PII_OSI_COTS: c_int = 100; 1512 pub const _SC_PII_OSI_M: c_int = 101; 1513 pub const _SC_PII_SOCKET: c_int = 102; 1514 pub const _SC_PII_XTI: c_int = 103; 1515 pub const _SC_POLL: c_int = 104; 1516 pub const _SC_RE_DUP_MAX: c_int = 105; 1517 pub const _SC_SCHAR_MAX: c_int = 106; 1518 pub const _SC_SCHAR_MIN: c_int = 107; 1519 pub const _SC_SELECT: c_int = 108; 1520 pub const _SC_SHRT_MAX: c_int = 109; 1521 pub const _SC_SHRT_MIN: c_int = 110; 1522 pub const _SC_SSIZE_MAX: c_int = 111; 1523 pub const _SC_T_IOV_MAX: c_int = 112; 1524 pub const _SC_UCHAR_MAX: c_int = 113; 1525 pub const _SC_UINT_MAX: c_int = 114; 1526 pub const _SC_UIO_MAXIOV: c_int = 115; 1527 pub const _SC_ULONG_MAX: c_int = 116; 1528 pub const _SC_USHRT_MAX: c_int = 117; 1529 pub const _SC_WORD_BIT: c_int = 118; 1530 pub const _SC_XOPEN_CRYPT: c_int = 119; 1531 pub const _SC_XOPEN_ENH_I18N: c_int = 120; 1532 pub const _SC_XOPEN_SHM: c_int = 121; 1533 pub const _SC_XOPEN_UNIX: c_int = 122; 1534 pub const _SC_XOPEN_XCU_VERSION: c_int = 123; 1535 pub const _SC_XOPEN_XPG2: c_int = 124; 1536 pub const _SC_XOPEN_XPG3: c_int = 125; 1537 pub const _SC_XOPEN_XPG4: c_int = 126; 1538 pub const _SC_XBS5_ILP32_OFF32: c_int = 127; 1539 pub const _SC_XBS5_ILP32_OFFBIG: c_int = 128; 1540 pub const _SC_XBS5_LP64_OFF64: c_int = 129; 1541 pub const _SC_XBS5_LPBIG_OFFBIG: c_int = 130; 1542 pub const _SC_ADVISORY_INFO: c_int = 131; 1543 pub const _SC_CPUTIME: c_int = 132; 1544 pub const _SC_SPAWN: c_int = 133; 1545 pub const _SC_SPORADIC_SERVER: c_int = 134; 1546 pub const _SC_THREAD_CPUTIME: c_int = 135; 1547 pub const _SC_THREAD_SPORADIC_SERVER: c_int = 136; 1548 pub const _SC_TIMEOUTS: c_int = 137; 1549 pub const _SC_BARRIERS: c_int = 138; 1550 pub const _SC_CLOCK_SELECTION: c_int = 139; 1551 pub const _SC_MONOTONIC_CLOCK: c_int = 140; 1552 pub const _SC_READER_WRITER_LOCKS: c_int = 141; 1553 pub const _SC_SPIN_LOCKS: c_int = 142; 1554 pub const _SC_TYPED_MEMORY_OBJECTS: c_int = 143; 1555 pub const _SC_TRACE_EVENT_FILTER: c_int = 144; 1556 pub const _SC_TRACE: c_int = 145; 1557 pub const _SC_TRACE_INHERIT: c_int = 146; 1558 pub const _SC_TRACE_LOG: c_int = 147; 1559 pub const _SC_2_PBS: c_int = 148; 1560 pub const _SC_2_PBS_ACCOUNTING: c_int = 149; 1561 pub const _SC_2_PBS_CHECKPOINT: c_int = 150; 1562 pub const _SC_2_PBS_LOCATE: c_int = 151; 1563 pub const _SC_2_PBS_MESSAGE: c_int = 152; 1564 pub const _SC_2_PBS_TRACK: c_int = 153; 1565 pub const _SC_HOST_NAME_MAX: c_int = 154; 1566 pub const _SC_IOV_MAX: c_int = 155; 1567 pub const _SC_IPV6: c_int = 156; 1568 pub const _SC_RAW_SOCKETS: c_int = 157; 1569 pub const _SC_REGEXP: c_int = 158; 1570 pub const _SC_SHELL: c_int = 159; 1571 pub const _SC_SS_REPL_MAX: c_int = 160; 1572 pub const _SC_SYMLOOP_MAX: c_int = 161; 1573 pub const _SC_TRACE_EVENT_NAME_MAX: c_int = 162; 1574 pub const _SC_TRACE_NAME_MAX: c_int = 163; 1575 pub const _SC_TRACE_SYS_MAX: c_int = 164; 1576 pub const _SC_TRACE_USER_EVENT_MAX: c_int = 165; 1577 pub const _SC_V6_ILP32_OFF32: c_int = 166; 1578 pub const _SC_V6_ILP32_OFFBIG: c_int = 167; 1579 pub const _SC_V6_LP64_OFF64: c_int = 168; 1580 pub const _SC_V6_LPBIG_OFFBIG: c_int = 169; 1581 pub const _SC_XOPEN_REALTIME: c_int = 170; 1582 pub const _SC_XOPEN_REALTIME_THREADS: c_int = 171; 1583 pub const _SC_XOPEN_LEGACY: c_int = 172; 1584 pub const _SC_XOPEN_STREAMS: c_int = 173; 1585 pub const _SC_V7_ILP32_OFF32: c_int = 176; 1586 pub const _SC_V7_ILP32_OFFBIG: c_int = 177; 1587 pub const _SC_V7_LP64_OFF64: c_int = 178; 1588 pub const _SC_V7_LPBIG_OFFBIG: c_int = 179; 1589 1590 pub const GLOB_ERR: c_int = 0x0001; 1591 pub const GLOB_MARK: c_int = 0x0002; 1592 pub const GLOB_NOSORT: c_int = 0x0004; 1593 pub const GLOB_DOOFFS: c_int = 0x0008; 1594 pub const GLOB_NOCHECK: c_int = 0x0010; 1595 pub const GLOB_APPEND: c_int = 0x0020; 1596 pub const GLOB_NOESCAPE: c_int = 0x0040; 1597 1598 pub const GLOB_NOSPACE: c_int = 1; 1599 pub const GLOB_ABORTED: c_int = 2; 1600 pub const GLOB_NOMATCH: c_int = 3; 1601 1602 pub const S_IEXEC: mode_t = crate::S_IXUSR; 1603 pub const S_IWRITE: mode_t = crate::S_IWUSR; 1604 pub const S_IREAD: mode_t = crate::S_IRUSR; 1605 1606 pub const S_IFIFO: mode_t = 0o1_0000; 1607 pub const S_IFCHR: mode_t = 0o2_0000; 1608 pub const S_IFDIR: mode_t = 0o4_0000; 1609 pub const S_IFBLK: mode_t = 0o6_0000; 1610 pub const S_IFREG: mode_t = 0o10_0000; 1611 pub const S_IFLNK: mode_t = 0o12_0000; 1612 pub const S_IFSOCK: mode_t = 0o14_0000; 1613 pub const S_IFMT: mode_t = 0o17_0000; 1614 1615 pub const S_IXOTH: mode_t = 0o0001; 1616 pub const S_IWOTH: mode_t = 0o0002; 1617 pub const S_IROTH: mode_t = 0o0004; 1618 pub const S_IRWXO: mode_t = 0o0007; 1619 pub const S_IXGRP: mode_t = 0o0010; 1620 pub const S_IWGRP: mode_t = 0o0020; 1621 pub const S_IRGRP: mode_t = 0o0040; 1622 pub const S_IRWXG: mode_t = 0o0070; 1623 pub const S_IXUSR: mode_t = 0o0100; 1624 pub const S_IWUSR: mode_t = 0o0200; 1625 pub const S_IRUSR: mode_t = 0o0400; 1626 pub const S_IRWXU: mode_t = 0o0700; 1627 1628 pub const F_LOCK: c_int = 1; 1629 pub const F_TEST: c_int = 3; 1630 pub const F_TLOCK: c_int = 2; 1631 pub const F_ULOCK: c_int = 0; 1632 1633 pub const ST_RDONLY: c_ulong = 0x01; 1634 pub const ST_NOSUID: c_ulong = 0x04; 1635 pub const ST_NOEXEC: c_ulong = 0x02; 1636 pub const ST_NOATIME: c_ulong = 0x20; 1637 1638 pub const RTLD_NEXT: *mut c_void = -3i64 as *mut c_void; 1639 pub const RTLD_DEFAULT: *mut c_void = -2i64 as *mut c_void; 1640 pub const RTLD_NODELETE: c_int = 0x1000; 1641 pub const RTLD_NOW: c_int = 0x0002; 1642 1643 pub const EMPTY: c_short = 0; 1644 pub const RUN_LVL: c_short = 1; 1645 pub const BOOT_TIME: c_short = 2; 1646 pub const NEW_TIME: c_short = 4; 1647 pub const OLD_TIME: c_short = 3; 1648 pub const INIT_PROCESS: c_short = 5; 1649 pub const LOGIN_PROCESS: c_short = 6; 1650 pub const USER_PROCESS: c_short = 7; 1651 pub const DEAD_PROCESS: c_short = 8; 1652 pub const ACCOUNTING: c_short = 9; 1653 1654 pub const ENOTSUP: c_int = 48; 1655 1656 pub const BUFSIZ: c_uint = 1024; 1657 pub const TMP_MAX: c_uint = 26 * 26 * 26; 1658 pub const FOPEN_MAX: c_uint = 16; 1659 pub const FILENAME_MAX: c_uint = 255; 1660 1661 pub const NI_MAXHOST: crate::socklen_t = 1025; 1662 pub const M_KEEP: c_int = 4; 1663 pub const REG_STARTEND: c_int = 0o00004; 1664 pub const VEOF: usize = 4; 1665 1666 pub const RTLD_GLOBAL: c_int = 0x0100; 1667 pub const RTLD_NOLOAD: c_int = 0x0004; 1668 1669 pub const O_RDONLY: c_int = 0o000000; 1670 pub const O_WRONLY: c_int = 0o000001; 1671 pub const O_RDWR: c_int = 0o000002; 1672 1673 pub const O_EXEC: c_int = 0o00003; 1674 pub const O_ASYNC: c_int = 0o0200000; 1675 pub const O_NDELAY: c_int = O_NONBLOCK; 1676 pub const O_TRUNC: c_int = 0o001000; 1677 pub const O_CLOEXEC: c_int = 0o020000; 1678 pub const O_DIRECTORY: c_int = 0o4000000; 1679 pub const O_ACCMODE: c_int = 0o000007; 1680 pub const O_APPEND: c_int = 0o000010; 1681 pub const O_CREAT: c_int = 0o000400; 1682 pub const O_EXCL: c_int = 0o002000; 1683 pub const O_NOCTTY: c_int = 0o004000; 1684 pub const O_NONBLOCK: c_int = 0o000200; 1685 pub const O_SYNC: c_int = 0o000040; 1686 pub const O_RSYNC: c_int = 0o000100; 1687 pub const O_DSYNC: c_int = 0o000020; 1688 pub const O_NOFOLLOW: c_int = 0o010000; 1689 1690 pub const POSIX_FADV_DONTNEED: c_int = 4; 1691 pub const POSIX_FADV_NOREUSE: c_int = 5; 1692 1693 pub const SOCK_SEQPACKET: c_int = 5; 1694 pub const SOCK_STREAM: c_int = 1; 1695 pub const SOCK_DGRAM: c_int = 2; 1696 pub const SOCK_RAW: c_int = 3; 1697 pub const SOCK_RDM: c_int = 4; 1698 pub const SOCK_CLOEXEC: c_int = 0x10000000; 1699 1700 pub const SA_SIGINFO: c_int = 0x0002; 1701 pub const SA_NOCLDWAIT: c_int = 0x0020; 1702 pub const SA_NODEFER: c_int = 0x0010; 1703 pub const SA_RESETHAND: c_int = 0x0004; 1704 pub const SA_NOCLDSTOP: c_int = 0x0001; 1705 1706 pub const SIGTTIN: c_int = 26; 1707 pub const SIGTTOU: c_int = 27; 1708 pub const SIGXCPU: c_int = 30; 1709 pub const SIGXFSZ: c_int = 31; 1710 pub const SIGVTALRM: c_int = 28; 1711 pub const SIGPROF: c_int = 29; 1712 pub const SIGWINCH: c_int = 20; 1713 pub const SIGCHLD: c_int = 18; 1714 pub const SIGBUS: c_int = 10; 1715 pub const SIGUSR1: c_int = 16; 1716 pub const SIGUSR2: c_int = 17; 1717 pub const SIGCONT: c_int = 25; 1718 pub const SIGSTOP: c_int = 23; 1719 pub const SIGTSTP: c_int = 24; 1720 pub const SIGURG: c_int = 21; 1721 pub const SIGIO: c_int = SIGPOLL; 1722 pub const SIGSYS: c_int = 12; 1723 pub const SIGPOLL: c_int = 22; 1724 pub const SIGPWR: c_int = 19; 1725 pub const SIG_SETMASK: c_int = 2; 1726 pub const SIG_BLOCK: c_int = 0; 1727 pub const SIG_UNBLOCK: c_int = 1; 1728 1729 pub const POLLWRNORM: c_short = crate::POLLOUT; 1730 pub const POLLWRBAND: c_short = 0x0010; 1731 1732 pub const F_SETLK: c_int = 106; 1733 pub const F_SETLKW: c_int = 107; 1734 pub const F_ALLOCSP: c_int = 110; 1735 pub const F_FREESP: c_int = 111; 1736 pub const F_GETLK: c_int = 114; 1737 1738 pub const F_RDLCK: c_int = 1; 1739 pub const F_WRLCK: c_int = 2; 1740 pub const F_UNLCK: c_int = 3; 1741 1742 pub const NCCS: usize = 40; 1743 1744 pub const MAP_ANON: c_int = MAP_ANONYMOUS; 1745 pub const MAP_ANONYMOUS: c_int = 0x00080000; 1746 1747 pub const MCL_CURRENT: c_int = 0x000000001; 1748 pub const MCL_FUTURE: c_int = 0x000000002; 1749 1750 pub const _TIO_CBAUD: crate::tcflag_t = 15; 1751 pub const CBAUD: crate::tcflag_t = _TIO_CBAUD; 1752 pub const TAB1: crate::tcflag_t = 0x0800; 1753 pub const TAB2: crate::tcflag_t = 0x1000; 1754 pub const TAB3: crate::tcflag_t = 0x1800; 1755 pub const CR1: crate::tcflag_t = 0x200; 1756 pub const CR2: crate::tcflag_t = 0x400; 1757 pub const CR3: crate::tcflag_t = 0x600; 1758 pub const FF1: crate::tcflag_t = 0x8000; 1759 pub const BS1: crate::tcflag_t = 0x2000; 1760 pub const VT1: crate::tcflag_t = 0x4000; 1761 pub const VWERASE: usize = 14; 1762 pub const VREPRINT: usize = 12; 1763 pub const VSUSP: usize = 10; 1764 pub const VSTART: usize = 8; 1765 pub const VSTOP: usize = 9; 1766 pub const VDISCARD: usize = 13; 1767 pub const VTIME: usize = 17; 1768 pub const IXON: crate::tcflag_t = 0x00000400; 1769 pub const IXOFF: crate::tcflag_t = 0x00001000; 1770 pub const ONLCR: crate::tcflag_t = 0x00000004; 1771 pub const CSIZE: crate::tcflag_t = 0x00000030; 1772 pub const CS6: crate::tcflag_t = 0x10; 1773 pub const CS7: crate::tcflag_t = 0x20; 1774 pub const CS8: crate::tcflag_t = 0x30; 1775 pub const CSTOPB: crate::tcflag_t = 0x00000040; 1776 pub const CREAD: crate::tcflag_t = 0x00000080; 1777 pub const PARENB: crate::tcflag_t = 0x00000100; 1778 pub const PARODD: crate::tcflag_t = 0x00000200; 1779 pub const HUPCL: crate::tcflag_t = 0x00000400; 1780 pub const CLOCAL: crate::tcflag_t = 0x00000800; 1781 pub const ECHOKE: crate::tcflag_t = 0x00000800; 1782 pub const ECHOE: crate::tcflag_t = 0x00000010; 1783 pub const ECHOK: crate::tcflag_t = 0x00000020; 1784 pub const ECHONL: crate::tcflag_t = 0x00000040; 1785 pub const ECHOCTL: crate::tcflag_t = 0x00000200; 1786 pub const ISIG: crate::tcflag_t = 0x00000001; 1787 pub const ICANON: crate::tcflag_t = 0x00000002; 1788 pub const NOFLSH: crate::tcflag_t = 0x00000080; 1789 pub const OLCUC: crate::tcflag_t = 0x00000002; 1790 pub const NLDLY: crate::tcflag_t = 0x00000100; 1791 pub const CRDLY: crate::tcflag_t = 0x00000600; 1792 pub const TABDLY: crate::tcflag_t = 0x00001800; 1793 pub const BSDLY: crate::tcflag_t = 0x00002000; 1794 pub const FFDLY: crate::tcflag_t = 0x00008000; 1795 pub const VTDLY: crate::tcflag_t = 0x00004000; 1796 pub const XTABS: crate::tcflag_t = 0x1800; 1797 1798 pub const B0: crate::speed_t = 0; 1799 pub const B50: crate::speed_t = 1; 1800 pub const B75: crate::speed_t = 2; 1801 pub const B110: crate::speed_t = 3; 1802 pub const B134: crate::speed_t = 4; 1803 pub const B150: crate::speed_t = 5; 1804 pub const B200: crate::speed_t = 6; 1805 pub const B300: crate::speed_t = 7; 1806 pub const B600: crate::speed_t = 8; 1807 pub const B1200: crate::speed_t = 9; 1808 pub const B1800: crate::speed_t = 10; 1809 pub const B2400: crate::speed_t = 11; 1810 pub const B4800: crate::speed_t = 12; 1811 pub const B9600: crate::speed_t = 13; 1812 pub const B19200: crate::speed_t = 14; 1813 pub const B38400: crate::speed_t = 15; 1814 pub const EXTA: crate::speed_t = 14; 1815 pub const EXTB: crate::speed_t = 15; 1816 pub const B57600: crate::speed_t = 57600; 1817 pub const B115200: crate::speed_t = 115200; 1818 1819 pub const VEOL: usize = 5; 1820 pub const VEOL2: usize = 6; 1821 pub const VMIN: usize = 16; 1822 pub const IEXTEN: crate::tcflag_t = 0x00008000; 1823 pub const TOSTOP: crate::tcflag_t = 0x00000100; 1824 1825 pub const TCSANOW: c_int = 0x0001; 1826 pub const TCSADRAIN: c_int = 0x0002; 1827 pub const TCSAFLUSH: c_int = 0x0004; 1828 1829 pub const HW_MACHINE: c_int = 1; 1830 pub const HW_MODEL: c_int = 2; 1831 pub const HW_NCPU: c_int = 3; 1832 pub const HW_BYTEORDER: c_int = 4; 1833 pub const HW_PHYSMEM: c_int = 5; 1834 pub const HW_USERMEM: c_int = 6; 1835 pub const HW_PAGESIZE: c_int = 7; 1836 pub const HW_DISKNAMES: c_int = 8; 1837 pub const CTL_KERN: c_int = 1; 1838 pub const CTL_VM: c_int = 2; 1839 pub const CTL_VFS: c_int = 3; 1840 pub const CTL_NET: c_int = 4; 1841 pub const CTL_DEBUG: c_int = 5; 1842 pub const CTL_HW: c_int = 6; 1843 pub const CTL_MACHDEP: c_int = 7; 1844 pub const CTL_USER: c_int = 8; 1845 1846 pub const DAY_1: crate::nl_item = 8; 1847 pub const DAY_2: crate::nl_item = 9; 1848 pub const DAY_3: crate::nl_item = 10; 1849 pub const DAY_4: crate::nl_item = 11; 1850 pub const DAY_5: crate::nl_item = 12; 1851 pub const DAY_6: crate::nl_item = 13; 1852 pub const DAY_7: crate::nl_item = 14; 1853 1854 pub const MON_1: crate::nl_item = 22; 1855 pub const MON_2: crate::nl_item = 23; 1856 pub const MON_3: crate::nl_item = 24; 1857 pub const MON_4: crate::nl_item = 25; 1858 pub const MON_5: crate::nl_item = 26; 1859 pub const MON_6: crate::nl_item = 27; 1860 pub const MON_7: crate::nl_item = 28; 1861 pub const MON_8: crate::nl_item = 29; 1862 pub const MON_9: crate::nl_item = 30; 1863 pub const MON_10: crate::nl_item = 31; 1864 pub const MON_11: crate::nl_item = 32; 1865 pub const MON_12: crate::nl_item = 33; 1866 1867 pub const ABDAY_1: crate::nl_item = 15; 1868 pub const ABDAY_2: crate::nl_item = 16; 1869 pub const ABDAY_3: crate::nl_item = 17; 1870 pub const ABDAY_4: crate::nl_item = 18; 1871 pub const ABDAY_5: crate::nl_item = 19; 1872 pub const ABDAY_6: crate::nl_item = 20; 1873 pub const ABDAY_7: crate::nl_item = 21; 1874 1875 pub const ABMON_1: crate::nl_item = 34; 1876 pub const ABMON_2: crate::nl_item = 35; 1877 pub const ABMON_3: crate::nl_item = 36; 1878 pub const ABMON_4: crate::nl_item = 37; 1879 pub const ABMON_5: crate::nl_item = 38; 1880 pub const ABMON_6: crate::nl_item = 39; 1881 pub const ABMON_7: crate::nl_item = 40; 1882 pub const ABMON_8: crate::nl_item = 41; 1883 pub const ABMON_9: crate::nl_item = 42; 1884 pub const ABMON_10: crate::nl_item = 43; 1885 pub const ABMON_11: crate::nl_item = 44; 1886 pub const ABMON_12: crate::nl_item = 45; 1887 1888 pub const AF_CCITT: c_int = 10; 1889 pub const AF_CHAOS: c_int = 5; 1890 pub const AF_CNT: c_int = 21; 1891 pub const AF_COIP: c_int = 20; 1892 pub const AF_DATAKIT: c_int = 9; 1893 pub const AF_DECnet: c_int = 12; 1894 pub const AF_DLI: c_int = 13; 1895 pub const AF_E164: c_int = 26; 1896 pub const AF_ECMA: c_int = 8; 1897 pub const AF_HYLINK: c_int = 15; 1898 pub const AF_IMPLINK: c_int = 3; 1899 pub const AF_ISO: c_int = 7; 1900 pub const AF_LAT: c_int = 14; 1901 pub const AF_LINK: c_int = 18; 1902 pub const AF_OSI: c_int = 7; 1903 pub const AF_PUP: c_int = 4; 1904 pub const ALT_DIGITS: crate::nl_item = 50; 1905 pub const AM_STR: crate::nl_item = 6; 1906 pub const B76800: crate::speed_t = 76800; 1907 1908 pub const BIOCFLUSH: c_int = 17000; 1909 pub const BIOCGBLEN: c_int = `1074020966`; 1910 pub const BIOCGDLT: c_int = `1074020970`; 1911 pub const BIOCGHDRCMPLT: c_int = `1074020980`; 1912 pub const BIOCGRTIMEOUT: c_int = `1074807406`; 1913 pub const BIOCIMMEDIATE: c_int = -`2147204496`; 1914 pub const BIOCPROMISC: c_int = 17001; 1915 pub const BIOCSBLEN: c_int = -`1073462682`; 1916 pub const BIOCSETF: c_int = -`2146418073`; 1917 pub const BIOCSHDRCMPLT: c_int = -`2147204491`; 1918 pub const BIOCSRTIMEOUT: c_int = -`2146418067`; 1919 pub const BIOCVERSION: c_int = `1074020977`; 1920 1921 pub const BPF_ALIGNMENT: usize = size_of::(); 1922 pub const CHAR_BIT: usize = 8; 1923 pub const CODESET: crate::nl_item = 1; 1924 pub const CRNCYSTR: crate::nl_item = 55; 1925 1926 pub const D_FLAG_FILTER: c_int = 0x00000001; 1927 pub const D_FLAG_STAT: c_int = 0x00000002; 1928 pub const D_FLAG_STAT_FORM_MASK: c_int = 0x000000f0; 1929 pub const D_FLAG_STAT_FORM_T32_2001: c_int = 0x00000010; 1930 pub const D_FLAG_STAT_FORM_T32_2008: c_int = 0x00000020; 1931 pub const D_FLAG_STAT_FORM_T64_2008: c_int = 0x00000030; 1932 pub const D_FLAG_STAT_FORM_UNSET: c_int = 0x00000000; 1933 1934 pub const D_FMT: crate::nl_item = 3; 1935 pub const D_GETFLAG: c_int = 1; 1936 pub const D_SETFLAG: c_int = 2; 1937 pub const D_T_FMT: crate::nl_item = 2; 1938 pub const ERA: crate::nl_item = 46; 1939 pub const ERA_D_FMT: crate::nl_item = 47; 1940 pub const ERA_D_T_FMT: crate::nl_item = 48; 1941 pub const ERA_T_FMT: crate::nl_item = 49; 1942 pub const RADIXCHAR: crate::nl_item = 51; 1943 pub const THOUSEP: crate::nl_item = 52; 1944 pub const YESEXPR: crate::nl_item = 53; 1945 pub const NOEXPR: crate::nl_item = 54; 1946 pub const F_GETOWN: c_int = 35; 1947 1948 pub const FIONBIO: c_int = -`2147195266`; 1949 pub const FIOASYNC: c_int = -`2147195267`; 1950 pub const FIOCLEX: c_int = 26113; 1951 pub const FIOGETOWN: c_int = `1074030203`; 1952 pub const FIONCLEX: c_int = 26114; 1953 pub const FIONREAD: c_int = `1074030207`; 1954 pub const FIOSETOWN: c_int = -`2147195268`; 1955 1956 pub const F_SETOWN: c_int = 36; 1957 pub const IFF_LINK0: c_int = 0x00001000; 1958 pub const IFF_LINK1: c_int = 0x00002000; 1959 pub const IFF_LINK2: c_int = 0x00004000; 1960 pub const IFF_OACTIVE: c_int = 0x00000400; 1961 pub const IFF_SIMPLEX: c_int = 0x00000800; 1962 pub const IHFLOW: tcflag_t = 0x00000001; 1963 pub const IIDLE: tcflag_t = 0x00000008; 1964 pub const IP_RECVDSTADDR: c_int = 7; 1965 pub const IP_RECVIF: c_int = 20; 1966 pub const IPTOS_ECN_NOTECT: u8 = 0x00; 1967 pub const IUCLC: tcflag_t = 0x00000200; 1968 pub const IUTF8: tcflag_t = 0x0004000; 1969 1970 pub const KERN_ARGMAX: c_int = 8; 1971 pub const KERN_BOOTTIME: c_int = 21; 1972 pub const KERN_CLOCKRATE: c_int = 12; 1973 pub const KERN_FILE: c_int = 15; 1974 pub const KERN_HOSTID: c_int = 11; 1975 pub const KERN_HOSTNAME: c_int = 10; 1976 pub const KERN_JOB_CONTROL: c_int = 19; 1977 pub const KERN_MAXFILES: c_int = 7; 1978 pub const KERN_MAXPROC: c_int = 6; 1979 pub const KERN_MAXVNODES: c_int = 5; 1980 pub const KERN_NGROUPS: c_int = 18; 1981 pub const KERN_OSRELEASE: c_int = 2; 1982 pub const KERN_OSREV: c_int = 3; 1983 pub const KERN_OSTYPE: c_int = 1; 1984 pub const KERN_POSIX1: c_int = 17; 1985 pub const KERN_PROC: c_int = 14; 1986 pub const KERN_PROC_ALL: c_int = 0; 1987 pub const KERN_PROC_PGRP: c_int = 2; 1988 pub const KERN_PROC_PID: c_int = 1; 1989 pub const KERN_PROC_RUID: c_int = 6; 1990 pub const KERN_PROC_SESSION: c_int = 3; 1991 pub const KERN_PROC_TTY: c_int = 4; 1992 pub const KERN_PROC_UID: c_int = 5; 1993 pub const KERN_PROF: c_int = 16; 1994 pub const KERN_SAVED_IDS: c_int = 20; 1995 pub const KERN_SECURELVL: c_int = 9; 1996 pub const KERN_VERSION: c_int = 4; 1997 pub const KERN_VNODE: c_int = 13; 1998 1999 pub const LC_ALL: c_int = 63; 2000 pub const LC_COLLATE: c_int = 1; 2001 pub const LC_CTYPE: c_int = 2; 2002 pub const LC_MESSAGES: c_int = 32; 2003 pub const LC_MONETARY: c_int = 4; 2004 pub const LC_NUMERIC: c_int = 8; 2005 pub const LC_TIME: c_int = 16; 2006 2007 pub const MAP_STACK: c_int = 0x00001000; 2008 pub const MNT_NOEXEC: c_int = 0x02; 2009 pub const MNT_NOSUID: c_int = 0x04; 2010 pub const MNT_RDONLY: c_int = 0x01; 2011 2012 pub const NET_RT_DUMP: c_int = 1; 2013 pub const NET_RT_FLAGS: c_int = 2; 2014 pub const OHFLOW: tcflag_t = 0x00000002; 2015 pub const P_ALL: idtype_t = 0; 2016 pub const PARSTK: tcflag_t = 0x00000004; 2017 pub const PF_CCITT: c_int = 10; 2018 pub const PF_CHAOS: c_int = 5; 2019 pub const PF_CNT: c_int = 21; 2020 pub const PF_COIP: c_int = 20; 2021 pub const PF_DATAKIT: c_int = 9; 2022 pub const PF_DECnet: c_int = 12; 2023 pub const PF_DLI: c_int = 13; 2024 pub const PF_ECMA: c_int = 8; 2025 pub const PF_HYLINK: c_int = 15; 2026 pub const PF_IMPLINK: c_int = 3; 2027 pub const PF_ISO: c_int = 7; 2028 pub const PF_LAT: c_int = 14; 2029 pub const PF_LINK: c_int = 18; 2030 pub const PF_OSI: c_int = 7; 2031 pub const PF_PIP: c_int = 25; 2032 pub const PF_PUP: c_int = 4; 2033 pub const PF_RTIP: c_int = 22; 2034 pub const PF_XTP: c_int = 19; 2035 pub const PM_STR: crate::nl_item = 7; 2036 pub const POSIX_MADV_DONTNEED: c_int = 4; 2037 pub const POSIX_MADV_NORMAL: c_int = 0; 2038 pub const POSIX_MADV_RANDOM: c_int = 2; 2039 pub const POSIX_MADV_SEQUENTIAL: c_int = 1; 2040 pub const POSIX_MADV_WILLNEED: c_int = 3; 2041 pub const _POSIX_VDISABLE: c_int = 0; 2042 pub const P_PGID: idtype_t = 2; 2043 pub const P_PID: idtype_t = 1; 2044 pub const PRIO_PGRP: c_int = 1; 2045 pub const PRIO_PROCESS: c_int = 0; 2046 pub const PRIO_USER: c_int = 2; 2047 pub const pseudo_AF_PIP: c_int = 25; 2048 pub const pseudo_AF_RTIP: c_int = 22; 2049 pub const pseudo_AF_XTP: c_int = 19; 2050 pub const REG_ASSERT: c_int = 15; 2051 pub const REG_ATOI: c_int = 255; 2052 pub const REG_BACKR: c_int = 0x400; 2053 pub const REG_BASIC: c_int = 0x00; 2054 pub const REG_DUMP: c_int = 0x80; 2055 pub const REG_EMPTY: c_int = 14; 2056 pub const REG_INVARG: c_int = 16; 2057 pub const REG_ITOA: c_int = 0o400; 2058 pub const REG_LARGE: c_int = 0x200; 2059 pub const REG_NOSPEC: c_int = 0x10; 2060 pub const REG_OK: c_int = 0; 2061 pub const REG_PEND: c_int = 0x20; 2062 pub const REG_TRACE: c_int = 0x100; 2063 2064 pub const RLIMIT_AS: c_int = 6; 2065 pub const RLIMIT_CORE: c_int = 4; 2066 pub const RLIMIT_CPU: c_int = 0; 2067 pub const RLIMIT_DATA: c_int = 2; 2068 pub const RLIMIT_FSIZE: c_int = 1; 2069 pub const RLIMIT_MEMLOCK: c_int = 7; 2070 pub const RLIMIT_NOFILE: c_int = 5; 2071 pub const RLIMIT_NPROC: c_int = 8; 2072 pub const RLIMIT_RSS: c_int = 6; 2073 pub const RLIMIT_STACK: c_int = 3; 2074 pub const RLIMIT_VMEM: c_int = 6; 2075 #[deprecated(since = "0.2.64", note = "Not stable across OS versions")] 2076 pub const RLIM_NLIMITS: c_int = 14; 2077 2078 pub const SCHED_ADJTOHEAD: c_int = 5; 2079 pub const SCHED_ADJTOTAIL: c_int = 6; 2080 pub const SCHED_MAXPOLICY: c_int = 7; 2081 pub const SCHED_SETPRIO: c_int = 7; 2082 pub const SCHED_SPORADIC: c_int = 4; 2083 2084 pub const SHM_ANON: *mut c_char = -1isize as *mut c_char; 2085 pub const SIGCLD: c_int = SIGCHLD; 2086 pub const SIGDEADLK: c_int = 7; 2087 pub const SIGEMT: c_int = 7; 2088 pub const SIGEV_NONE: c_int = 0; 2089 pub const SIGEV_SIGNAL: c_int = 129; 2090 pub const SIGEV_THREAD: c_int = 135; 2091 pub const SO_USELOOPBACK: c_int = 0x0040; 2092 pub const _SS_ALIGNSIZE: usize = size_of::(); 2093 pub const _SS_MAXSIZE: usize = 128; 2094 pub const _SS_PAD1SIZE: usize = _SS_ALIGNSIZE - 2; 2095 pub const _SS_PAD2SIZE: usize = _SS_MAXSIZE - 2 - _SS_PAD1SIZE - _SS_ALIGNSIZE; 2096 pub const TC_CPOSIX: tcflag_t = CLOCAL | CREAD | CSIZE | CSTOPB | HUPCL | PARENB | PARODD; 2097 pub const TCGETS: c_int = 0x404c540d; 2098 pub const TC_IPOSIX: tcflag_t = 2099 BRKINT | ICRNL | IGNBRK | IGNPAR | INLCR | INPCK | ISTRIP | IXOFF | IXON | PARMRK; 2100 pub const TC_LPOSIX: tcflag_t = 2101 ECHO | ECHOE | ECHOK | ECHONL | ICANON | IEXTEN | ISIG | NOFLSH | TOSTOP; 2102 pub const TC_OPOSIX: tcflag_t = OPOST; 2103 pub const T_FMT_AMPM: crate::nl_item = 5; 2104 2105 pub const TIOCCBRK: c_int = 29818; 2106 pub const TIOCCDTR: c_int = 29816; 2107 pub const TIOCDRAIN: c_int = 29790; 2108 pub const TIOCEXCL: c_int = 29709; 2109 pub const TIOCFLUSH: c_int = -`2147191792`; 2110 pub const TIOCGETA: c_int = `1078752275`; 2111 pub const TIOCGPGRP: c_int = `1074033783`; 2112 pub const TIOCGWINSZ: c_int = `1074295912`; 2113 pub const TIOCMBIC: c_int = -`2147191701`; 2114 pub const TIOCMBIS: c_int = -`2147191700`; 2115 pub const TIOCMGET: c_int = `1074033770`; 2116 pub const TIOCMSET: c_int = -`2147191699`; 2117 pub const TIOCNOTTY: c_int = 29809; 2118 pub const TIOCNXCL: c_int = 29710; 2119 pub const TIOCOUTQ: c_int = `1074033779`; 2120 pub const TIOCPKT: c_int = -`2147191696`; 2121 pub const TIOCPKT_DATA: c_int = 0x00; 2122 pub const TIOCPKT_DOSTOP: c_int = 0x20; 2123 pub const TIOCPKT_FLUSHREAD: c_int = 0x01; 2124 pub const TIOCPKT_FLUSHWRITE: c_int = 0x02; 2125 pub const TIOCPKT_IOCTL: c_int = 0x40; 2126 pub const TIOCPKT_NOSTOP: c_int = 0x10; 2127 pub const TIOCPKT_START: c_int = 0x08; 2128 pub const TIOCPKT_STOP: c_int = 0x04; 2129 pub const TIOCSBRK: c_int = 29819; 2130 pub const TIOCSCTTY: c_int = 29793; 2131 pub const TIOCSDTR: c_int = 29817; 2132 pub const TIOCSETA: c_int = -`2142473196`; 2133 pub const TIOCSETAF: c_int = -`2142473194`; 2134 pub const TIOCSETAW: c_int = -`2142473195`; 2135 pub const TIOCSPGRP: c_int = -`2147191690`; 2136 pub const TIOCSTART: c_int = 29806; 2137 pub const TIOCSTI: c_int = -`2147388302`; 2138 pub const TIOCSTOP: c_int = 29807; 2139 pub const TIOCSWINSZ: c_int = -`2146929561`; 2140 2141 pub const USER_CS_PATH: c_int = 1; 2142 2143 /// Constants may change across releases. See the [usage guidelines](crate#usage-guidelines) 2144 /// for details. 2145 pub const USER_BC_BASE_MAX: c_int = 2; 2146 2147 /// Constants may change across releases. See the [usage guidelines](crate#usage-guidelines) 2148 /// for details. 2149 pub const USER_BC_DIM_MAX: c_int = 3; 2150 2151 /// Constants may change across releases. See the [usage guidelines](crate#usage-guidelines) 2152 /// for details. 2153 pub const USER_BC_SCALE_MAX: c_int = 4; 2154 2155 /// Constants may change across releases. See the [usage guidelines](crate#usage-guidelines) 2156 /// for details. 2157 pub const USER_BC_STRING_MAX: c_int = 5; 2158 2159 /// Constants may change across releases. See the [usage guidelines](crate#usage-guidelines) 2160 /// for details. 2161 pub const USER_COLL_WEIGHTS_MAX: c_int = 6; 2162 2163 /// Constants may change across releases. See the [usage guidelines](crate#usage-guidelines) 2164 /// for details. 2165 pub const USER_EXPR_NEST_MAX: c_int = 7; 2166 2167 /// Constants may change across releases. See the [usage guidelines](crate#usage-guidelines) 2168 /// for details. 2169 pub const USER_LINE_MAX: c_int = 8; 2170 2171 /// Constants may change across releases. See the [usage guidelines](crate#usage-guidelines) 2172 /// for details. 2173 pub const USER_RE_DUP_MAX: c_int = 9; 2174 2175 pub const USER_POSIX2_VERSION: c_int = 10; 2176 pub const USER_POSIX2_C_BIND: c_int = 11; 2177 pub const USER_POSIX2_C_DEV: c_int = 12; 2178 pub const USER_POSIX2_CHAR_TERM: c_int = 13; 2179 pub const USER_POSIX2_FORT_DEV: c_int = 14; 2180 pub const USER_POSIX2_FORT_RUN: c_int = 15; 2181 pub const USER_POSIX2_LOCALEDEF: c_int = 16; 2182 pub const USER_POSIX2_SW_DEV: c_int = 17; 2183 pub const USER_POSIX2_UPE: c_int = 18; 2184 pub const USER_STREAM_MAX: c_int = 19; 2185 pub const USER_TZNAME_MAX: c_int = 20; 2186 2187 pub const VDOWN: usize = 31; 2188 pub const VINS: usize = 32; 2189 pub const VDEL: usize = 33; 2190 pub const VRUB: usize = 34; 2191 pub const VCAN: usize = 35; 2192 pub const VHOME: usize = 36; 2193 pub const VEND: usize = 37; 2194 pub const VSPARE3: usize = 38; 2195 pub const VSPARE4: usize = 39; 2196 pub const VSWTCH: usize = 7; 2197 pub const VDSUSP: usize = 11; 2198 pub const VFWD: usize = 18; 2199 pub const VLOGIN: usize = 19; 2200 pub const VPREFIX: usize = 20; 2201 pub const VSUFFIX: usize = 24; 2202 pub const VLEFT: usize = 28; 2203 pub const VRIGHT: usize = 29; 2204 pub const VUP: usize = 30; 2205 pub const XCASE: tcflag_t = 0x00000004; 2206 2207 pub const PTHREAD_BARRIER_SERIAL_THREAD: c_int = -1; 2208 pub const PTHREAD_CREATE_JOINABLE: c_int = 0x00; 2209 pub const PTHREAD_CREATE_DETACHED: c_int = 0x01; 2210 2211 pub const PTHREAD_MUTEX_ERRORCHECK: c_int = 1; 2212 pub const PTHREAD_MUTEX_RECURSIVE: c_int = 2; 2213 pub const PTHREAD_MUTEX_NORMAL: c_int = 3; 2214 pub const PTHREAD_STACK_MIN: size_t = 256; 2215 pub const PTHREAD_MUTEX_DEFAULT: c_int = 0; 2216 pub const PTHREAD_MUTEX_STALLED: c_int = 0x00; 2217 pub const PTHREAD_MUTEX_ROBUST: c_int = 0x10; 2218 pub const PTHREAD_PROCESS_PRIVATE: c_int = 0x00; 2219 pub const PTHREAD_PROCESS_SHARED: c_int = 0x01; 2220 2221 pub const PTHREAD_KEYS_MAX: usize = 128; 2222 2223 #[cfg(not(any(target_env = "nto71", target_env = "nto71_iosock", target_os = "qnx")))] 2224 pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { 2225 __u: 0x80000000, 2226 __owner: 0xffffffff, 2227 }; 2228 #[cfg(any(target_env = "nto71", target_env = "nto71_iosock"))] 2229 pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { 2230 __u: 0x82000000, 2231 __owner: 0, 2232 }; 2233 #[cfg(target_os = "qnx")] 2234 pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { 2235 __u: 0x80000000, 2236 __owner: 0, 2237 }; 2238 pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { 2239 __u: CLOCK_REALTIME as u32, 2240 __owner: 0xfffffffb, 2241 }; 2242 pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { 2243 __active: 0, 2244 __blockedwriters: 0, 2245 __blockedreaders: 0, 2246 __heavy: 0, 2247 __lock: PTHREAD_MUTEX_INITIALIZER, 2248 __rcond: PTHREAD_COND_INITIALIZER, 2249 __wcond: PTHREAD_COND_INITIALIZER, 2250 __owner: -2i32 as c_uint, 2251 __spare: 0, 2252 }; 2253 2254 const fn _CMSG_ALIGN(len: usize) -> usize { 2255 len + size_of::() - 1 & !(size_of::() - 1) 2256 } 2257 2258 const fn _ALIGN(p: usize, b: usize) -> usize { 2259 (p + b - 1) & !(b - 1) 2260 } 2261 2262 f! { 2263 pub unsafe fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr { 2264 if (*mhdr).msg_controllen as usize >= size_of::() { 2265 (*mhdr).msg_control.cast() 2266 } else { 2267 ptr::null_mut() 2268 } 2269 } 2270 2271 pub unsafe fn CMSG_NXTHDR(mhdr: *const crate::msghdr, cmsg: *const cmsghdr) -> *mut cmsghdr { 2272 let msg = _CMSG_ALIGN((*cmsg).cmsg_len as usize); 2273 let next = cmsg as usize + msg + _CMSG_ALIGN(size_of::()); 2274 if next > (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize { 2275 ptr::null_mut() 2276 } else { 2277 (cmsg as usize + msg) as *mut cmsghdr 2278 } 2279 } 2280 2281 pub unsafe fn CMSG_DATA(cmsg: *const cmsghdr) -> *mut c_uchar { 2282 (cmsg as *mut c_uchar).offset(_CMSG_ALIGN(size_of::()) as isize) 2283 } 2284 2285 pub const unsafe fn CMSG_LEN(length: c_uint) -> c_uint { 2286 _CMSG_ALIGN(size_of::()) as c_uint + length 2287 } 2288 2289 pub const unsafe fn CMSG_SPACE(length: c_uint) -> c_uint { 2290 (_CMSG_ALIGN(size_of::()) + _CMSG_ALIGN(length as usize)) as c_uint 2291 } 2292 2293 pub unsafe fn FD_CLR(fd: c_int, set: *mut fd_set) -> () { 2294 let fd = fd as usize; 2295 let size = size_of_val(&(*set).fds_bits[0]) * 8; 2296 (*set).fds_bits[fd / size] &= !(1 << (fd % size)); 2297 return; 2298 } 2299 2300 pub unsafe fn FD_ISSET(fd: c_int, set: *const fd_set) -> bool { 2301 let fd = fd as usize; 2302 let size = size_of_val(&(*set).fds_bits[0]) * 8; 2303 return ((*set).fds_bits[fd / size] & (1 << (fd % size))) != 0; 2304 } 2305 2306 pub unsafe fn FD_SET(fd: c_int, set: *mut fd_set) -> () { 2307 let fd = fd as usize; 2308 let size = size_of_val(&(*set).fds_bits[0]) * 8; 2309 (*set).fds_bits[fd / size] |= 1 << (fd % size); 2310 return; 2311 } 2312 2313 pub unsafe fn FD_ZERO(set: *mut fd_set) -> () { 2314 (*set).fds_bits.fill(0); 2315 } 2316 2317 pub unsafe fn _DEXTRA_FIRST(_d: *const dirent) -> *mut crate::dirent_extra { 2318 let _f = &((*(_d)).d_name) as *const _; 2319 let _s = _d as usize; 2320 2321 _ALIGN(_s + _f as usize - _s + (*_d).d_namelen as usize + 1, 8) as *mut crate::dirent_extra 2322 } 2323 2324 pub unsafe fn _DEXTRA_VALID(_x: *const crate::dirent_extra, _d: *const dirent) -> bool { 2325 let sz = _x as usize - _d as usize + size_of::(); 2326 let rsz = (*_d).d_reclen as usize; 2327 2328 if sz > rsz || sz + (*_x).d_datalen as usize > rsz { 2329 false 2330 } else { 2331 true 2332 } 2333 } 2334 2335 pub unsafe fn _DEXTRA_NEXT(_x: *const crate::dirent_extra) -> *mut crate::dirent_extra { 2336 _ALIGN( 2337 _x as usize + size_of::() + (*_x).d_datalen as usize, 2338 8, 2339 ) as *mut crate::dirent_extra 2340 } 2341 2342 pub unsafe fn SOCKCREDSIZE(ngrps: usize) -> usize { 2343 let ngrps = if ngrps > 0 { ngrps - 1 } else { 0 }; 2344 size_of::() + size_of::() * ngrps 2345 } 2346 } 2347 2348 safe_f! { 2349 pub const safe fn WIFSTOPPED(status: c_int) -> bool { 2350 (status & 0xff) == 0x7f 2351 } 2352 2353 pub const safe fn WSTOPSIG(status: c_int) -> c_int { 2354 (status >> 8) & 0xff 2355 } 2356 2357 pub const safe fn WIFCONTINUED(status: c_int) -> bool { 2358 status == 0xffff 2359 } 2360 2361 pub const safe fn WIFSIGNALED(status: c_int) -> bool { 2362 ((status & 0x7f) + 1) as i8 >= 2 2363 } 2364 2365 pub const safe fn WTERMSIG(status: c_int) -> c_int { 2366 status & 0x7f 2367 } 2368 2369 pub const safe fn WIFEXITED(status: c_int) -> bool { 2370 (status & 0x7f) == 0 2371 } 2372 2373 pub const safe fn WEXITSTATUS(status: c_int) -> c_int { 2374 (status >> 8) & 0xff 2375 } 2376 2377 pub const safe fn WCOREDUMP(status: c_int) -> bool { 2378 (status & 0x80) != 0 2379 } 2380 2381 pub const safe fn IPTOS_ECN(x: u8) -> u8 { 2382 x & crate::IPTOS_ECN_MASK 2383 } 2384 2385 pub const safe fn makedev(major: c_uint, minor: c_uint) -> crate::dev_t { 2386 ((major << 10) | (minor)) as crate::dev_t 2387 } 2388 2389 pub const safe fn major(dev: crate::dev_t) -> c_uint { 2390 ((dev as c_uint) >> 10) & 0x3f 2391 } 2392 2393 pub const safe fn minor(dev: crate::dev_t) -> c_uint { 2394 (dev as c_uint) & 0x3ff 2395 } 2396 } 2397 2398 // Network related functions are provided by libsocket and regex 2399 // functions are provided by libregex. 2400 // In QNX <=7.0, libregex functions were included in libc itself. 2401 #[link(name = "socket")] 2402 #[cfg_attr(not(target_env = "nto70"), link(name = "regex"))] 2403 extern "C" { 2404 pub fn sem_destroy(sem: *mut sem_t) -> c_int; 2405 pub fn sem_init(sem: *mut sem_t, pshared: c_int, value: c_uint) -> c_int; 2406 pub fn fdatasync(fd: c_int) -> c_int; 2407 pub fn getpriority(which: c_int, who: crate::id_t) -> c_int; 2408 pub fn setpriority(which: c_int, who: crate::id_t, prio: c_int) -> c_int; 2409 pub fn mkfifoat(dirfd: c_int, pathname: *const c_char, mode: mode_t) -> c_int; 2410 pub fn mknodat(__fd: c_int, pathname: *const c_char, mode: mode_t, dev: crate::dev_t) -> c_int; 2411 2412 pub fn clock_getres(clk_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int; 2413 pub fn clock_gettime(clk_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int; 2414 pub fn clock_settime(clk_id: crate::clockid_t, tp: *const crate::timespec) -> c_int; 2415 pub fn clock_getcpuclockid(pid: crate::pid_t, clk_id: *mut crate::clockid_t) -> c_int; 2416 2417 pub fn pthread_attr_getstack( 2418 attr: *const crate::pthread_attr_t, 2419 stackaddr: *mut *mut c_void, 2420 stacksize: *mut size_t, 2421 ) -> c_int; 2422 pub fn memalign(align: size_t, size: size_t) -> *mut c_void; 2423 pub fn setgroups(ngroups: c_int, ptr: *const crate::gid_t) -> c_int; 2424 2425 pub fn posix_fadvise(fd: c_int, offset: off_t, len: off_t, advise: c_int) -> c_int; 2426 pub fn futimens(fd: c_int, times: *const crate::timespec) -> c_int; 2427 pub fn nl_langinfo(item: crate::nl_item) -> *mut c_char; 2428 2429 pub fn utimensat( 2430 dirfd: c_int, 2431 path: *const c_char, 2432 times: *const crate::timespec, 2433 flag: c_int, 2434 ) -> c_int; 2435 2436 pub fn pthread_condattr_getclock( 2437 attr: *const pthread_condattr_t, 2438 clock_id: *mut clockid_t, 2439 ) -> c_int; 2440 pub fn pthread_condattr_setclock( 2441 attr: *mut pthread_condattr_t, 2442 clock_id: crate::clockid_t, 2443 ) -> c_int; 2444 pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t, pshared: c_int) -> c_int; 2445 pub fn pthread_mutexattr_setpshared(attr: *mut pthread_mutexattr_t, pshared: c_int) -> c_int; 2446 pub fn pthread_rwlockattr_getpshared( 2447 attr: *const pthread_rwlockattr_t, 2448 val: *mut c_int, 2449 ) -> c_int; 2450 pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, val: c_int) -> c_int; 2451 pub fn ptsname_r(fd: c_int, buf: *mut c_char, buflen: size_t) -> *mut c_char; 2452 pub fn clearenv() -> c_int; 2453 pub fn waitid( 2454 idtype: idtype_t, 2455 id: id_t, 2456 infop: *mut crate::siginfo_t, 2457 options: c_int, 2458 ) -> c_int; 2459 pub fn wait4( 2460 pid: crate::pid_t, 2461 status: *mut c_int, 2462 options: c_int, 2463 rusage: *mut crate::rusage, 2464 ) -> crate::pid_t; 2465 2466 // DIFF(main): changed to `*const *mut` in `e77f551de9` 2467 pub fn execvpe( 2468 file: *const c_char, 2469 argv: *const *const c_char, 2470 envp: *const *const c_char, 2471 ) -> c_int; 2472 2473 pub fn getifaddrs(ifap: *mut *mut crate::ifaddrs) -> c_int; 2474 pub fn freeifaddrs(ifa: *mut crate::ifaddrs); 2475 pub fn bind( 2476 socket: c_int, 2477 address: *const crate::sockaddr, 2478 address_len: crate::socklen_t, 2479 ) -> c_int; 2480 2481 pub fn writev(fd: c_int, iov: *const crate::iovec, iovcnt: c_int) -> ssize_t; 2482 pub fn readv(fd: c_int, iov: *const crate::iovec, iovcnt: c_int) -> ssize_t; 2483 2484 pub fn sendmsg(fd: c_int, msg: *const crate::msghdr, flags: c_int) -> ssize_t; 2485 pub fn recvmsg(fd: c_int, msg: *mut crate::msghdr, flags: c_int) -> ssize_t; 2486 pub fn openpty( 2487 amaster: *mut c_int, 2488 aslave: *mut c_int, 2489 name: *mut c_char, 2490 termp: *mut termios, 2491 winp: *mut crate::winsize, 2492 ) -> c_int; 2493 pub fn forkpty( 2494 amaster: *mut c_int, 2495 name: *mut c_char, 2496 termp: *mut termios, 2497 winp: *mut crate::winsize, 2498 ) -> crate::pid_t; 2499 pub fn login_tty(fd: c_int) -> c_int; 2500 2501 pub fn uname(buf: *mut crate::utsname) -> c_int; 2502 2503 pub fn getpeereid(socket: c_int, euid: *mut crate::uid_t, egid: *mut crate::gid_t) -> c_int; 2504 2505 pub fn strerror_r(errnum: c_int, buf: *mut c_char, buflen: size_t) -> c_int; 2506 2507 pub fn abs(i: c_int) -> c_int; 2508 pub fn labs(i: c_long) -> c_long; 2509 pub fn rand() -> c_int; 2510 pub fn srand(seed: c_uint); 2511 2512 pub fn setpwent(); 2513 pub fn endpwent(); 2514 pub fn getpwent() -> *mut passwd; 2515 pub fn setgrent(); 2516 pub fn endgrent(); 2517 pub fn getgrent() -> *mut crate::group; 2518 pub fn setspent(); 2519 pub fn endspent(); 2520 2521 pub fn shm_open(name: *const c_char, oflag: c_int, mode: mode_t) -> c_int; 2522 2523 pub fn ftok(pathname: *const c_char, proj_id: c_int) -> crate::key_t; 2524 pub fn mprotect(addr: *mut c_void, len: size_t, prot: c_int) -> c_int; 2525 2526 pub fn posix_fallocate(fd: c_int, offset: off_t, len: off_t) -> c_int; 2527 pub fn mkostemp(template: *mut c_char, flags: c_int) -> c_int; 2528 pub fn mkostemps(template: *mut c_char, suffixlen: c_int, flags: c_int) -> c_int; 2529 pub fn sigtimedwait( 2530 set: *const sigset_t, 2531 info: *mut siginfo_t, 2532 timeout: *const crate::timespec, 2533 ) -> c_int; 2534 pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> c_int; 2535 pub fn pthread_setschedprio(native: crate::pthread_t, priority: c_int) -> c_int; 2536 2537 pub fn if_nameindex() -> *mut if_nameindex; 2538 pub fn if_freenameindex(ptr: *mut if_nameindex); 2539 2540 pub fn glob( 2541 pattern: *const c_char, 2542 flags: c_int, 2543 errfunc: Option c_int>, 2544 pglob: *mut crate::glob_t, 2545 ) -> c_int; 2546 pub fn globfree(pglob: *mut crate::glob_t); 2547 2548 pub fn posix_madvise(addr: *mut c_void, len: size_t, advice: c_int) -> c_int; 2549 2550 pub fn shm_unlink(name: *const c_char) -> c_int; 2551 2552 pub fn seekdir(dirp: *mut crate::DIR, loc: c_long); 2553 2554 pub fn telldir(dirp: *mut crate::DIR) -> c_long; 2555 2556 pub fn msync(addr: *mut c_void, len: size_t, flags: c_int) -> c_int; 2557 2558 pub fn recvfrom( 2559 socket: c_int, 2560 buf: *mut c_void, 2561 len: size_t, 2562 flags: c_int, 2563 addr: *mut crate::sockaddr, 2564 addrlen: *mut crate::socklen_t, 2565 ) -> ssize_t; 2566 pub fn mkstemps(template: *mut c_char, suffixlen: c_int) -> c_int; 2567 2568 pub fn getdomainname(name: *mut c_char, len: size_t) -> c_int; 2569 pub fn setdomainname(name: *const c_char, len: size_t) -> c_int; 2570 pub fn sync(); 2571 pub fn pthread_getschedparam( 2572 native: crate::pthread_t, 2573 policy: *mut c_int, 2574 param: *mut crate::sched_param, 2575 ) -> c_int; 2576 pub fn umount(target: *const c_char, flags: c_int) -> c_int; 2577 pub fn sched_get_priority_max(policy: c_int) -> c_int; 2578 pub fn settimeofday(tv: *const crate::timeval, tz: *const c_void) -> c_int; 2579 pub fn sched_rr_get_interval(pid: crate::pid_t, tp: *mut crate::timespec) -> c_int; 2580 pub fn sem_timedwait(sem: *mut sem_t, abstime: *const crate::timespec) -> c_int; 2581 pub fn sem_getvalue(sem: *mut sem_t, sval: *mut c_int) -> c_int; 2582 pub fn sched_setparam(pid: crate::pid_t, param: *const crate::sched_param) -> c_int; 2583 pub fn mount( 2584 special_device: *const c_char, 2585 mount_directory: *const c_char, 2586 flags: c_int, 2587 mount_type: *const c_char, 2588 mount_data: *const c_void, 2589 mount_datalen: c_int, 2590 ) -> c_int; 2591 pub fn sched_getparam(pid: crate::pid_t, param: *mut crate::sched_param) -> c_int; 2592 pub fn pthread_mutex_consistent(mutex: *mut pthread_mutex_t) -> c_int; 2593 pub fn pthread_mutex_timedlock( 2594 lock: *mut pthread_mutex_t, 2595 abstime: *const crate::timespec, 2596 ) -> c_int; 2597 pub fn pthread_spin_init(lock: *mut crate::pthread_spinlock_t, pshared: c_int) -> c_int; 2598 pub fn pthread_spin_destroy(lock: *mut crate::pthread_spinlock_t) -> c_int; 2599 pub fn pthread_spin_lock(lock: *mut crate::pthread_spinlock_t) -> c_int; 2600 pub fn pthread_spin_trylock(lock: *mut crate::pthread_spinlock_t) -> c_int; 2601 pub fn pthread_spin_unlock(lock: *mut crate::pthread_spinlock_t) -> c_int; 2602 pub fn pthread_barrierattr_init(__attr: *mut crate::pthread_barrierattr_t) -> c_int; 2603 pub fn pthread_barrierattr_destroy(__attr: *mut crate::pthread_barrierattr_t) -> c_int; 2604 pub fn pthread_barrierattr_getpshared( 2605 __attr: *const crate::pthread_barrierattr_t, 2606 __pshared: *mut c_int, 2607 ) -> c_int; 2608 pub fn pthread_barrierattr_setpshared( 2609 __attr: *mut crate::pthread_barrierattr_t, 2610 __pshared: c_int, 2611 ) -> c_int; 2612 pub fn pthread_barrier_init( 2613 __barrier: *mut crate::pthread_barrier_t, 2614 __attr: *const crate::pthread_barrierattr_t, 2615 __count: c_uint, 2616 ) -> c_int; 2617 pub fn pthread_barrier_destroy(__barrier: *mut crate::pthread_barrier_t) -> c_int; 2618 pub fn pthread_barrier_wait(__barrier: *mut crate::pthread_barrier_t) -> c_int; 2619 2620 pub fn sched_getscheduler(pid: crate::pid_t) -> c_int; 2621 pub fn clock_nanosleep( 2622 clk_id: crate::clockid_t, 2623 flags: c_int, 2624 rqtp: *const crate::timespec, 2625 rmtp: *mut crate::timespec, 2626 ) -> c_int; 2627 pub fn pthread_attr_getguardsize( 2628 attr: *const crate::pthread_attr_t, 2629 guardsize: *mut size_t, 2630 ) -> c_int; 2631 pub fn pthread_attr_setguardsize(attr: *mut crate::pthread_attr_t, guardsize: size_t) -> c_int; 2632 pub fn sethostname(name: *const c_char, len: size_t) -> c_int; 2633 pub fn sched_get_priority_min(policy: c_int) -> c_int; 2634 pub fn pthread_condattr_getpshared( 2635 attr: *const pthread_condattr_t, 2636 pshared: *mut c_int, 2637 ) -> c_int; 2638 pub fn pthread_setschedparam( 2639 native: crate::pthread_t, 2640 policy: c_int, 2641 param: *const crate::sched_param, 2642 ) -> c_int; 2643 pub fn sched_setscheduler( 2644 pid: crate::pid_t, 2645 policy: c_int, 2646 param: *const crate::sched_param, 2647 ) -> c_int; 2648 pub fn sigsuspend(mask: *const crate::sigset_t) -> c_int; 2649 pub fn getgrgid_r( 2650 gid: crate::gid_t, 2651 grp: *mut crate::group, 2652 buf: *mut c_char, 2653 buflen: size_t, 2654 result: *mut *mut crate::group, 2655 ) -> c_int; 2656 pub fn sem_close(sem: *mut sem_t) -> c_int; 2657 pub fn getdtablesize() -> c_int; 2658 pub fn getgrnam_r( 2659 name: *const c_char, 2660 grp: *mut crate::group, 2661 buf: *mut c_char, 2662 buflen: size_t, 2663 result: *mut *mut crate::group, 2664 ) -> c_int; 2665 pub fn initgroups(user: *const c_char, group: crate::gid_t) -> c_int; 2666 pub fn pthread_sigmask(how: c_int, set: *const sigset_t, oldset: *mut sigset_t) -> c_int; 2667 pub fn sem_open(name: *const c_char, oflag: c_int, ...) -> *mut sem_t; 2668 pub fn getgrnam(name: *const c_char) -> *mut crate::group; 2669 pub fn pthread_cancel(thread: crate::pthread_t) -> c_int; 2670 pub fn pthread_kill(thread: crate::pthread_t, sig: c_int) -> c_int; 2671 pub fn sem_unlink(name: *const c_char) -> c_int; 2672 pub fn daemon(nochdir: c_int, noclose: c_int) -> c_int; 2673 pub fn getpwnam_r( 2674 name: *const c_char, 2675 pwd: *mut passwd, 2676 buf: *mut c_char, 2677 buflen: size_t, 2678 result: *mut *mut passwd, 2679 ) -> c_int; 2680 pub fn getpwuid_r( 2681 uid: crate::uid_t, 2682 pwd: *mut passwd, 2683 buf: *mut c_char, 2684 buflen: size_t, 2685 result: *mut *mut passwd, 2686 ) -> c_int; 2687 pub fn sigwait(set: *const sigset_t, sig: *mut c_int) -> c_int; 2688 pub fn pthread_atfork( 2689 prepare: Option, 2690 parent: Option, 2691 child: Option, 2692 ) -> c_int; 2693 pub fn getgrgid(gid: crate::gid_t) -> *mut crate::group; 2694 pub fn getgrouplist( 2695 user: *const c_char, 2696 group: crate::gid_t, 2697 groups: *mut crate::gid_t, 2698 ngroups: *mut c_int, 2699 ) -> c_int; 2700 pub fn pthread_mutexattr_getpshared( 2701 attr: *const pthread_mutexattr_t, 2702 pshared: *mut c_int, 2703 ) -> c_int; 2704 pub fn pthread_mutexattr_getrobust( 2705 attr: *const pthread_mutexattr_t, 2706 robustness: *mut c_int, 2707 ) -> c_int; 2708 pub fn pthread_mutexattr_setrobust(attr: *mut pthread_mutexattr_t, robustness: c_int) -> c_int; 2709 pub fn pthread_create( 2710 native: *mut crate::pthread_t, 2711 attr: *const crate::pthread_attr_t, 2712 f: extern "C" fn(*mut c_void) -> *mut c_void, 2713 value: *mut c_void, 2714 ) -> c_int; 2715 pub fn getitimer(which: c_int, curr_value: *mut crate::itimerval) -> c_int; 2716 pub fn setitimer( 2717 which: c_int, 2718 value: *const crate::itimerval, 2719 ovalue: *mut crate::itimerval, 2720 ) -> c_int; 2721 pub fn posix_spawn( 2722 pid: *mut crate::pid_t, 2723 path: *const c_char, 2724 file_actions: *const crate::posix_spawn_file_actions_t, 2725 attrp: *const crate::posix_spawnattr_t, 2726 argv: *const *mut c_char, 2727 envp: *const *mut c_char, 2728 ) -> c_int; 2729 pub fn posix_spawnp( 2730 pid: *mut crate::pid_t, 2731 file: *const c_char, 2732 file_actions: *const crate::posix_spawn_file_actions_t, 2733 attrp: *const crate::posix_spawnattr_t, 2734 argv: *const *mut c_char, 2735 envp: *const *mut c_char, 2736 ) -> c_int; 2737 pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> c_int; 2738 pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> c_int; 2739 pub fn posix_spawnattr_getsigdefault( 2740 attr: *const posix_spawnattr_t, 2741 default: *mut crate::sigset_t, 2742 ) -> c_int; 2743 pub fn posix_spawnattr_setsigdefault( 2744 attr: *mut posix_spawnattr_t, 2745 default: *const crate::sigset_t, 2746 ) -> c_int; 2747 pub fn posix_spawnattr_getsigmask( 2748 attr: *const posix_spawnattr_t, 2749 default: *mut crate::sigset_t, 2750 ) -> c_int; 2751 pub fn posix_spawnattr_setsigmask( 2752 attr: *mut posix_spawnattr_t, 2753 default: *const crate::sigset_t, 2754 ) -> c_int; 2755 pub fn posix_spawnattr_getflags(attr: *const posix_spawnattr_t, flags: *mut c_short) -> c_int; 2756 pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: c_short) -> c_int; 2757 pub fn posix_spawnattr_getpgroup( 2758 attr: *const posix_spawnattr_t, 2759 flags: *mut crate::pid_t, 2760 ) -> c_int; 2761 pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: crate::pid_t) -> c_int; 2762 pub fn posix_spawnattr_getschedpolicy( 2763 attr: *const posix_spawnattr_t, 2764 flags: *mut c_int, 2765 ) -> c_int; 2766 pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: c_int) -> c_int; 2767 pub fn posix_spawnattr_getschedparam( 2768 attr: *const posix_spawnattr_t, 2769 param: *mut crate::sched_param, 2770 ) -> c_int; 2771 pub fn posix_spawnattr_setschedparam( 2772 attr: *mut posix_spawnattr_t, 2773 param: *const crate::sched_param, 2774 ) -> c_int; 2775 2776 pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> c_int; 2777 pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> c_int; 2778 pub fn posix_spawn_file_actions_addopen( 2779 actions: *mut posix_spawn_file_actions_t, 2780 fd: c_int, 2781 path: *const c_char, 2782 oflag: c_int, 2783 mode: mode_t, 2784 ) -> c_int; 2785 pub fn posix_spawn_file_actions_addclose( 2786 actions: *mut posix_spawn_file_actions_t, 2787 fd: c_int, 2788 ) -> c_int; 2789 pub fn posix_spawn_file_actions_adddup2( 2790 actions: *mut posix_spawn_file_actions_t, 2791 fd: c_int, 2792 newfd: c_int, 2793 ) -> c_int; 2794 pub fn popen(command: *const c_char, mode: *const c_char) -> *mut crate::FILE; 2795 pub fn faccessat(dirfd: c_int, pathname: *const c_char, mode: c_int, flags: c_int) -> c_int; 2796 pub fn inotify_rm_watch(fd: c_int, wd: c_int) -> c_int; 2797 pub fn inotify_init() -> c_int; 2798 pub fn inotify_add_watch(fd: c_int, path: *const c_char, mask: u32) -> c_int; 2799 2800 pub fn gettid() -> crate::pid_t; 2801 2802 pub fn pthread_getcpuclockid(thread: crate::pthread_t, clk_id: *mut crate::clockid_t) -> c_int; 2803 2804 pub fn getnameinfo( 2805 sa: *const crate::sockaddr, 2806 salen: crate::socklen_t, 2807 host: *mut c_char, 2808 hostlen: crate::socklen_t, 2809 serv: *mut c_char, 2810 servlen: crate::socklen_t, 2811 flags: c_int, 2812 ) -> c_int; 2813 2814 pub fn mallopt(param: c_int, value: i64) -> c_int; 2815 pub fn gettimeofday(tp: *mut crate::timeval, tz: *mut c_void) -> c_int; 2816 2817 pub fn ctermid(s: *mut c_char) -> *mut c_char; 2818 pub fn ioctl(fd: c_int, request: c_int, ...) -> c_int; 2819 2820 pub fn mallinfo() -> crate::mallinfo; 2821 pub fn getpwent_r( 2822 pwd: *mut crate::passwd, 2823 buf: *mut c_char, 2824 __bufsize: c_int, 2825 __result: *mut *mut crate::passwd, 2826 ) -> c_int; 2827 pub fn pthread_getname_np(thread: crate::pthread_t, name: *mut c_char, len: c_int) -> c_int; 2828 pub fn pthread_setname_np(thread: crate::pthread_t, name: *const c_char) -> c_int; 2829 2830 pub fn sysctl( 2831 _: *const c_int, 2832 _: c_uint, 2833 _: *mut c_void, 2834 _: *mut size_t, 2835 _: *const c_void, 2836 _: size_t, 2837 ) -> c_int; 2838 2839 pub fn getrlimit(resource: c_int, rlim: *mut crate::rlimit) -> c_int; 2840 pub fn setrlimit(resource: c_int, rlp: *const crate::rlimit) -> c_int; 2841 2842 pub fn lio_listio( 2843 __mode: c_int, 2844 __list: *const *mut aiocb, 2845 __nent: c_int, 2846 __sig: *mut sigevent, 2847 ) -> c_int; 2848 2849 pub fn dl_iterate_phdr( 2850 callback: Option< 2851 unsafe extern "C" fn( 2852 // The original .h file declares this as *const, but for consistency with other platforms, 2853 // changing this to *mut to make it easier to use. 2854 // Maybe in v0.3 all platforms should use this as a *const. 2855 info: *mut dl_phdr_info, 2856 size: size_t, 2857 data: *mut c_void, 2858 ) -> c_int, 2859 >, 2860 data: *mut c_void, 2861 ) -> c_int; 2862 2863 pub fn memset_s(s: *mut c_void, smax: size_t, c: c_int, n: size_t) -> c_int; 2864 2865 pub fn regcomp(__preg: *mut crate::regex_t, __pattern: *const c_char, __cflags: c_int) 2866 -> c_int; 2867 pub fn regexec( 2868 __preg: *const crate::regex_t, 2869 __str: *const c_char, 2870 __nmatch: size_t, 2871 __pmatch: *mut crate::regmatch_t, 2872 __eflags: c_int, 2873 ) -> c_int; 2874 pub fn regerror( 2875 __errcode: c_int, 2876 __preg: *const crate::regex_t, 2877 __errbuf: *mut c_char, 2878 __errbuf_size: size_t, 2879 ) -> size_t; 2880 pub fn regfree(__preg: *mut crate::regex_t); 2881 pub fn dirfd(__dirp: *mut crate::DIR) -> c_int; 2882 pub fn dircntl(dir: *mut crate::DIR, cmd: c_int, ...) -> c_int; 2883 2884 pub fn aio_cancel(__fd: c_int, __aiocbp: *mut crate::aiocb) -> c_int; 2885 pub fn aio_error(__aiocbp: *const crate::aiocb) -> c_int; 2886 pub fn aio_fsync(__operation: c_int, __aiocbp: *mut crate::aiocb) -> c_int; 2887 pub fn aio_read(__aiocbp: *mut crate::aiocb) -> c_int; 2888 pub fn aio_return(__aiocpb: *mut crate::aiocb) -> ssize_t; 2889 pub fn aio_suspend( 2890 __list: *const *const crate::aiocb, 2891 __nent: c_int, 2892 __timeout: *const crate::timespec, 2893 ) -> c_int; 2894 pub fn aio_write(__aiocpb: *mut crate::aiocb) -> c_int; 2895 2896 pub fn mq_close(__mqdes: crate::mqd_t) -> c_int; 2897 pub fn mq_getattr(__mqdes: crate::mqd_t, __mqstat: *mut crate::mq_attr) -> c_int; 2898 pub fn mq_notify(__mqdes: crate::mqd_t, __notification: *const crate::sigevent) -> c_int; 2899 pub fn mq_open(__name: *const c_char, __oflag: c_int, ...) -> crate::mqd_t; 2900 pub fn mq_receive( 2901 __mqdes: crate::mqd_t, 2902 __msg_ptr: *mut c_char, 2903 __msg_len: size_t, 2904 __msg_prio: *mut c_uint, 2905 ) -> ssize_t; 2906 pub fn mq_send( 2907 __mqdes: crate::mqd_t, 2908 __msg_ptr: *const c_char, 2909 __msg_len: size_t, 2910 __msg_prio: c_uint, 2911 ) -> c_int; 2912 pub fn mq_setattr( 2913 __mqdes: crate::mqd_t, 2914 __mqstat: *const mq_attr, 2915 __omqstat: *mut mq_attr, 2916 ) -> c_int; 2917 pub fn mq_timedreceive( 2918 __mqdes: crate::mqd_t, 2919 __msg_ptr: *mut c_char, 2920 __msg_len: size_t, 2921 __msg_prio: *mut c_uint, 2922 __abs_timeout: *const crate::timespec, 2923 ) -> ssize_t; 2924 pub fn mq_timedsend( 2925 __mqdes: crate::mqd_t, 2926 __msg_ptr: *const c_char, 2927 __msg_len: size_t, 2928 __msg_prio: c_uint, 2929 __abs_timeout: *const crate::timespec, 2930 ) -> c_int; 2931 pub fn mq_unlink(__name: *const c_char) -> c_int; 2932 pub fn __get_errno_ptr() -> *mut c_int; 2933 2934 // System page, see https://www.qnx.com/developers/docs/7.1#com.qnx.doc.neutrino.building/topic/syspage/syspage_about.html 2935 pub static mut _syspage_ptr: *mut syspage_entry; 2936 2937 // Function on the stack after a call to pthread_create(). This is used 2938 // as a sentinel to work around an infitnite loop in the unwinding code. 2939 pub fn __my_thread_exit(value_ptr: *mut *const c_void); 2940 } 2941 2942 // Models the implementation in stdlib.h. Ctest will fail if trying to use the 2943 // default symbol from libc 2944 pub unsafe fn atexit(cb: extern "C" fn()) -> c_int { 2945 extern "C" { 2946 static __dso_handle: *mut c_void; 2947 pub fn __cxa_atexit(cb: extern "C" fn(), __arg: *mut c_void, __dso: *mut c_void) -> c_int; 2948 } 2949 __cxa_atexit(cb, ptr::null_mut(), __dso_handle) 2950 } 2951 2952 impl siginfo_t { 2953 pub unsafe fn si_addr(&self) -> *mut c_void { 2954 #[repr(C)] 2955 struct siginfo_si_addr { 2956 _pad: Padding<[u8; 32]>, 2957 si_addr: *mut c_void, 2958 } 2959 (*(self as *const siginfo_t).cast::()).si_addr 2960 } 2961 2962 pub unsafe fn si_value(&self) -> crate::sigval { 2963 #[repr(C)] 2964 struct siginfo_si_value { 2965 _pad: Padding<[u8; 32]>, 2966 si_value: crate::sigval, 2967 } 2968 (*(self as *const siginfo_t).cast::()).si_value 2969 } 2970 2971 pub unsafe fn si_pid(&self) -> crate::pid_t { 2972 #[repr(C)] 2973 struct siginfo_si_pid { 2974 _pad: Padding<[u8; 16]>, 2975 si_pid: crate::pid_t, 2976 } 2977 (*(self as *const siginfo_t).cast::()).si_pid 2978 } 2979 2980 pub unsafe fn si_uid(&self) -> crate::uid_t { 2981 #[repr(C)] 2982 struct siginfo_si_uid { 2983 _pad: Padding<[u8; 24]>, 2984 si_uid: crate::uid_t, 2985 } 2986 (*(self as *const siginfo_t).cast::()).si_uid 2987 } 2988 2989 pub unsafe fn si_status(&self) -> c_int { 2990 #[repr(C)] 2991 struct siginfo_si_status { 2992 _pad: Padding<[u8; 28]>, 2993 si_status: c_int, 2994 } 2995 (*(self as *const siginfo_t).cast::()).si_status 2996 } 2997 } 2998 2999 // Things that are QNX specific 3000 3001 mod neutrino; 3002 pub use self::neutrino::*; 3003 3004 // Things that are architecture specific 3005 3006 mod arch; 3007 pub use self::arch::*; 3008 3009 // Things that are network-stack specific 3010 3011 cfg_if! { 3012 if #[cfg(any(target_env = "nto70", target_env = "nto71"))] { 3013 mod io_pkt; 3014 pub use self::io_pkt::*; 3015 } else if #[cfg(any(target_env = "nto71_iosock", target_os = "qnx"))] { 3016 mod io_sock; 3017 pub use self::io_sock::*; 3018 } else { 3019 panic!("Unsupported arch"); 3020 } 3021 }