1 pub type mode_t = u16; 2 pub type pthread_attr_t = *mut ::c_void; 3 pub type rlim_t = i64; 4 pub type pthread_mutex_t = *mut ::c_void; 5 pub type pthread_mutexattr_t = *mut ::c_void; 6 pub type pthread_cond_t = *mut ::c_void; 7 pub type pthread_condattr_t = *mut ::c_void; 8 pub type pthread_rwlock_t = *mut ::c_void; 9 pub type pthread_rwlockattr_t = *mut ::c_void; 10 pub type pthread_key_t = ::c_int; 11 pub type tcflag_t = ::c_uint; 12 pub type speed_t = ::c_uint; 13 pub type nl_item = ::c_int; 14 pub type id_t = i64; 15 pub type vm_size_t = ::uintptr_t; 16 17 // elf.h 18 19 pub type Elf32_Addr = u32; 20 pub type Elf32_Half = u16; 21 pub type Elf32_Lword = u64; 22 pub type Elf32_Off = u32; 23 pub type Elf32_Sword = i32; 24 pub type Elf32_Word = u32; 25 26 pub type Elf64_Addr = u64; 27 pub type Elf64_Half = u16; 28 pub type Elf64_Lword = u64; 29 pub type Elf64_Off = u64; 30 pub type Elf64_Sword = i32; 31 pub type Elf64_Sxword = i64; 32 pub type Elf64_Word = u32; 33 pub type Elf64_Xword = u64; 34 35 cfg_if! { 36 if #[cfg(target_pointer_width = "64")] { 37 type Elf_Addr = Elf64_Addr; 38 type Elf_Half = Elf64_Half; 39 type Elf_Phdr = Elf64_Phdr; 40 } else if #[cfg(target_pointer_width = "32")] { 41 type Elf_Addr = Elf32_Addr; 42 type Elf_Half = Elf32_Half; 43 type Elf_Phdr = Elf32_Phdr; 44 } 45 } 46 47 // link.h 48 49 #[cfg_attr(feature = "extra_traits", derive(Debug))] 50 pub enum timezone {} 51 impl ::Copy for timezone {} 52 impl ::Clone for timezone { clone(&self) -> timezone53 fn clone(&self) -> timezone { 54 *self 55 } 56 } 57 58 impl siginfo_t { si_addr(&self) -> *mut ::c_void59 pub unsafe fn si_addr(&self) -> *mut ::c_void { 60 self.si_addr 61 } 62 si_value(&self) -> ::sigval63 pub unsafe fn si_value(&self) -> ::sigval { 64 self.si_value 65 } 66 si_pid(&self) -> ::pid_t67 pub unsafe fn si_pid(&self) -> ::pid_t { 68 self.si_pid 69 } 70 si_uid(&self) -> ::uid_t71 pub unsafe fn si_uid(&self) -> ::uid_t { 72 self.si_uid 73 } 74 } 75 76 s! { 77 pub struct in_addr { 78 pub s_addr: ::in_addr_t, 79 } 80 81 pub struct ip_mreq { 82 pub imr_multiaddr: in_addr, 83 pub imr_interface: in_addr, 84 } 85 86 pub struct glob_t { 87 pub gl_pathc: ::size_t, 88 pub gl_matchc: ::size_t, 89 pub gl_offs: ::size_t, 90 pub gl_flags: ::c_int, 91 pub gl_pathv: *mut *mut ::c_char, 92 __unused3: *mut ::c_void, 93 __unused4: *mut ::c_void, 94 __unused5: *mut ::c_void, 95 __unused6: *mut ::c_void, 96 __unused7: *mut ::c_void, 97 __unused8: *mut ::c_void, 98 } 99 100 pub struct addrinfo { 101 pub ai_flags: ::c_int, 102 pub ai_family: ::c_int, 103 pub ai_socktype: ::c_int, 104 pub ai_protocol: ::c_int, 105 pub ai_addrlen: ::socklen_t, 106 pub ai_canonname: *mut ::c_char, 107 pub ai_addr: *mut ::sockaddr, 108 pub ai_next: *mut addrinfo, 109 } 110 111 pub struct sigset_t { 112 bits: [u32; 4], 113 } 114 115 pub struct siginfo_t { 116 pub si_signo: ::c_int, 117 pub si_errno: ::c_int, 118 pub si_code: ::c_int, 119 pub si_pid: ::pid_t, 120 pub si_uid: ::uid_t, 121 pub si_status: ::c_int, 122 pub si_addr: *mut ::c_void, 123 pub si_value: ::sigval, 124 _pad1: ::c_long, 125 _pad2: [::c_int; 7], 126 } 127 128 pub struct sigaction { 129 pub sa_sigaction: ::sighandler_t, 130 pub sa_flags: ::c_int, 131 pub sa_mask: sigset_t, 132 } 133 134 pub struct sched_param { 135 pub sched_priority: ::c_int, 136 } 137 138 pub struct Dl_info { 139 pub dli_fname: *const ::c_char, 140 pub dli_fbase: *mut ::c_void, 141 pub dli_sname: *const ::c_char, 142 pub dli_saddr: *mut ::c_void, 143 } 144 145 pub struct sockaddr_in { 146 pub sin_len: u8, 147 pub sin_family: ::sa_family_t, 148 pub sin_port: ::in_port_t, 149 pub sin_addr: ::in_addr, 150 pub sin_zero: [::c_char; 8], 151 } 152 153 pub struct termios { 154 pub c_iflag: ::tcflag_t, 155 pub c_oflag: ::tcflag_t, 156 pub c_cflag: ::tcflag_t, 157 pub c_lflag: ::tcflag_t, 158 pub c_cc: [::cc_t; ::NCCS], 159 pub c_ispeed: ::speed_t, 160 pub c_ospeed: ::speed_t, 161 } 162 163 pub struct flock { 164 pub l_start: ::off_t, 165 pub l_len: ::off_t, 166 pub l_pid: ::pid_t, 167 pub l_type: ::c_short, 168 pub l_whence: ::c_short, 169 #[cfg(not(target_os = "dragonfly"))] 170 pub l_sysid: ::c_int, 171 } 172 173 pub struct sf_hdtr { 174 pub headers: *mut ::iovec, 175 pub hdr_cnt: ::c_int, 176 pub trailers: *mut ::iovec, 177 pub trl_cnt: ::c_int, 178 } 179 180 pub struct lconv { 181 pub decimal_point: *mut ::c_char, 182 pub thousands_sep: *mut ::c_char, 183 pub grouping: *mut ::c_char, 184 pub int_curr_symbol: *mut ::c_char, 185 pub currency_symbol: *mut ::c_char, 186 pub mon_decimal_point: *mut ::c_char, 187 pub mon_thousands_sep: *mut ::c_char, 188 pub mon_grouping: *mut ::c_char, 189 pub positive_sign: *mut ::c_char, 190 pub negative_sign: *mut ::c_char, 191 pub int_frac_digits: ::c_char, 192 pub frac_digits: ::c_char, 193 pub p_cs_precedes: ::c_char, 194 pub p_sep_by_space: ::c_char, 195 pub n_cs_precedes: ::c_char, 196 pub n_sep_by_space: ::c_char, 197 pub p_sign_posn: ::c_char, 198 pub n_sign_posn: ::c_char, 199 pub int_p_cs_precedes: ::c_char, 200 pub int_n_cs_precedes: ::c_char, 201 pub int_p_sep_by_space: ::c_char, 202 pub int_n_sep_by_space: ::c_char, 203 pub int_p_sign_posn: ::c_char, 204 pub int_n_sign_posn: ::c_char, 205 } 206 207 pub struct cmsgcred { 208 pub cmcred_pid: ::pid_t, 209 pub cmcred_uid: ::uid_t, 210 pub cmcred_euid: ::uid_t, 211 pub cmcred_gid: ::gid_t, 212 pub cmcred_ngroups: ::c_short, 213 pub cmcred_groups: [::gid_t; CMGROUP_MAX], 214 } 215 216 pub struct rtprio { 217 pub type_: ::c_ushort, 218 pub prio: ::c_ushort, 219 } 220 221 pub struct in6_pktinfo { 222 pub ipi6_addr: ::in6_addr, 223 pub ipi6_ifindex: ::c_uint, 224 } 225 226 pub struct arphdr { 227 pub ar_hrd: u16, 228 pub ar_pro: u16, 229 pub ar_hln: u8, 230 pub ar_pln: u8, 231 pub ar_op: u16, 232 } 233 234 pub struct timex { 235 pub modes: ::c_uint, 236 pub offset: ::c_long, 237 pub freq: ::c_long, 238 pub maxerror: ::c_long, 239 pub esterror: ::c_long, 240 pub status: ::c_int, 241 pub constant: ::c_long, 242 pub precision: ::c_long, 243 pub tolerance: ::c_long, 244 pub ppsfreq: ::c_long, 245 pub jitter: ::c_long, 246 pub shift: ::c_int, 247 pub stabil: ::c_long, 248 pub jitcnt: ::c_long, 249 pub calcnt: ::c_long, 250 pub errcnt: ::c_long, 251 pub stbcnt: ::c_long, 252 } 253 254 pub struct ntptimeval { 255 pub time: ::timespec, 256 pub maxerror: ::c_long, 257 pub esterror: ::c_long, 258 pub tai: ::c_long, 259 pub time_state: ::c_int, 260 } 261 262 pub struct ptrace_io_desc { 263 pub piod_op: ::c_int, 264 pub piod_offs: *mut ::c_void, 265 pub piod_addr: *mut ::c_void, 266 pub piod_len: ::size_t, 267 } 268 269 // elf.h 270 271 pub struct Elf32_Phdr { 272 pub p_type: Elf32_Word, 273 pub p_offset: Elf32_Off, 274 pub p_vaddr: Elf32_Addr, 275 pub p_paddr: Elf32_Addr, 276 pub p_filesz: Elf32_Word, 277 pub p_memsz: Elf32_Word, 278 pub p_flags: Elf32_Word, 279 pub p_align: Elf32_Word, 280 } 281 282 pub struct Elf64_Phdr { 283 pub p_type: Elf64_Word, 284 pub p_flags: Elf64_Word, 285 pub p_offset: Elf64_Off, 286 pub p_vaddr: Elf64_Addr, 287 pub p_paddr: Elf64_Addr, 288 pub p_filesz: Elf64_Xword, 289 pub p_memsz: Elf64_Xword, 290 pub p_align: Elf64_Xword, 291 } 292 293 // link.h 294 295 pub struct dl_phdr_info { 296 pub dlpi_addr: Elf_Addr, 297 pub dlpi_name: *const ::c_char, 298 pub dlpi_phdr: *const Elf_Phdr, 299 pub dlpi_phnum: Elf_Half, 300 pub dlpi_adds: ::c_ulonglong, 301 pub dlpi_subs: ::c_ulonglong, 302 pub dlpi_tls_modid: usize, 303 pub dlpi_tls_data: *mut ::c_void, 304 } 305 } 306 307 s_no_extra_traits! { 308 pub struct sockaddr_storage { 309 pub ss_len: u8, 310 pub ss_family: ::sa_family_t, 311 __ss_pad1: [u8; 6], 312 __ss_align: i64, 313 __ss_pad2: [u8; 112], 314 } 315 } 316 317 cfg_if! { 318 if #[cfg(feature = "extra_traits")] { 319 impl PartialEq for sockaddr_storage { 320 fn eq(&self, other: &sockaddr_storage) -> bool { 321 self.ss_len == other.ss_len 322 && self.ss_family == other.ss_family 323 && self.__ss_pad1 == other.__ss_pad1 324 && self.__ss_align == other.__ss_align 325 && self 326 .__ss_pad2 327 .iter() 328 .zip(other.__ss_pad2.iter()) 329 .all(|(a, b)| a == b) 330 } 331 } 332 impl Eq for sockaddr_storage {} 333 impl ::fmt::Debug for sockaddr_storage { 334 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 335 f.debug_struct("sockaddr_storage") 336 .field("ss_len", &self.ss_len) 337 .field("ss_family", &self.ss_family) 338 .field("__ss_pad1", &self.__ss_pad1) 339 .field("__ss_align", &self.__ss_align) 340 // FIXME: .field("__ss_pad2", &self.__ss_pad2) 341 .finish() 342 } 343 } 344 impl ::hash::Hash for sockaddr_storage { 345 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 346 self.ss_len.hash(state); 347 self.ss_family.hash(state); 348 self.__ss_pad1.hash(state); 349 self.__ss_align.hash(state); 350 self.__ss_pad2.hash(state); 351 } 352 } 353 } 354 } 355 356 #[deprecated( 357 since = "0.2.64", 358 note = "Can vary at runtime. Use sysconf(3) instead" 359 )] 360 pub const AIO_LISTIO_MAX: ::c_int = 16; 361 pub const AIO_CANCELED: ::c_int = 1; 362 pub const AIO_NOTCANCELED: ::c_int = 2; 363 pub const AIO_ALLDONE: ::c_int = 3; 364 pub const LIO_NOP: ::c_int = 0; 365 pub const LIO_WRITE: ::c_int = 1; 366 pub const LIO_READ: ::c_int = 2; 367 pub const LIO_WAIT: ::c_int = 1; 368 pub const LIO_NOWAIT: ::c_int = 0; 369 370 pub const SIGEV_NONE: ::c_int = 0; 371 pub const SIGEV_SIGNAL: ::c_int = 1; 372 pub const SIGEV_THREAD: ::c_int = 2; 373 pub const SIGEV_KEVENT: ::c_int = 3; 374 375 pub const CODESET: ::nl_item = 0; 376 pub const D_T_FMT: ::nl_item = 1; 377 pub const D_FMT: ::nl_item = 2; 378 pub const T_FMT: ::nl_item = 3; 379 pub const T_FMT_AMPM: ::nl_item = 4; 380 pub const AM_STR: ::nl_item = 5; 381 pub const PM_STR: ::nl_item = 6; 382 383 pub const DAY_1: ::nl_item = 7; 384 pub const DAY_2: ::nl_item = 8; 385 pub const DAY_3: ::nl_item = 9; 386 pub const DAY_4: ::nl_item = 10; 387 pub const DAY_5: ::nl_item = 11; 388 pub const DAY_6: ::nl_item = 12; 389 pub const DAY_7: ::nl_item = 13; 390 391 pub const ABDAY_1: ::nl_item = 14; 392 pub const ABDAY_2: ::nl_item = 15; 393 pub const ABDAY_3: ::nl_item = 16; 394 pub const ABDAY_4: ::nl_item = 17; 395 pub const ABDAY_5: ::nl_item = 18; 396 pub const ABDAY_6: ::nl_item = 19; 397 pub const ABDAY_7: ::nl_item = 20; 398 399 pub const MON_1: ::nl_item = 21; 400 pub const MON_2: ::nl_item = 22; 401 pub const MON_3: ::nl_item = 23; 402 pub const MON_4: ::nl_item = 24; 403 pub const MON_5: ::nl_item = 25; 404 pub const MON_6: ::nl_item = 26; 405 pub const MON_7: ::nl_item = 27; 406 pub const MON_8: ::nl_item = 28; 407 pub const MON_9: ::nl_item = 29; 408 pub const MON_10: ::nl_item = 30; 409 pub const MON_11: ::nl_item = 31; 410 pub const MON_12: ::nl_item = 32; 411 412 pub const ABMON_1: ::nl_item = 33; 413 pub const ABMON_2: ::nl_item = 34; 414 pub const ABMON_3: ::nl_item = 35; 415 pub const ABMON_4: ::nl_item = 36; 416 pub const ABMON_5: ::nl_item = 37; 417 pub const ABMON_6: ::nl_item = 38; 418 pub const ABMON_7: ::nl_item = 39; 419 pub const ABMON_8: ::nl_item = 40; 420 pub const ABMON_9: ::nl_item = 41; 421 pub const ABMON_10: ::nl_item = 42; 422 pub const ABMON_11: ::nl_item = 43; 423 pub const ABMON_12: ::nl_item = 44; 424 425 pub const ERA: ::nl_item = 45; 426 pub const ERA_D_FMT: ::nl_item = 46; 427 pub const ERA_D_T_FMT: ::nl_item = 47; 428 pub const ERA_T_FMT: ::nl_item = 48; 429 pub const ALT_DIGITS: ::nl_item = 49; 430 431 pub const RADIXCHAR: ::nl_item = 50; 432 pub const THOUSEP: ::nl_item = 51; 433 434 pub const YESEXPR: ::nl_item = 52; 435 pub const NOEXPR: ::nl_item = 53; 436 437 pub const YESSTR: ::nl_item = 54; 438 pub const NOSTR: ::nl_item = 55; 439 440 pub const CRNCYSTR: ::nl_item = 56; 441 442 pub const D_MD_ORDER: ::nl_item = 57; 443 444 pub const ALTMON_1: ::nl_item = 58; 445 pub const ALTMON_2: ::nl_item = 59; 446 pub const ALTMON_3: ::nl_item = 60; 447 pub const ALTMON_4: ::nl_item = 61; 448 pub const ALTMON_5: ::nl_item = 62; 449 pub const ALTMON_6: ::nl_item = 63; 450 pub const ALTMON_7: ::nl_item = 64; 451 pub const ALTMON_8: ::nl_item = 65; 452 pub const ALTMON_9: ::nl_item = 66; 453 pub const ALTMON_10: ::nl_item = 67; 454 pub const ALTMON_11: ::nl_item = 68; 455 pub const ALTMON_12: ::nl_item = 69; 456 457 pub const EXIT_FAILURE: ::c_int = 1; 458 pub const EXIT_SUCCESS: ::c_int = 0; 459 pub const EOF: ::c_int = -1; 460 pub const SEEK_SET: ::c_int = 0; 461 pub const SEEK_CUR: ::c_int = 1; 462 pub const SEEK_END: ::c_int = 2; 463 pub const SEEK_DATA: ::c_int = 3; 464 pub const SEEK_HOLE: ::c_int = 4; 465 pub const _IOFBF: ::c_int = 0; 466 pub const _IONBF: ::c_int = 2; 467 pub const _IOLBF: ::c_int = 1; 468 pub const BUFSIZ: ::c_uint = 1024; 469 pub const FOPEN_MAX: ::c_uint = 20; 470 pub const FILENAME_MAX: ::c_uint = 1024; 471 pub const L_tmpnam: ::c_uint = 1024; 472 pub const TMP_MAX: ::c_uint = 308915776; 473 474 pub const O_NOCTTY: ::c_int = 32768; 475 pub const O_DIRECT: ::c_int = 0x00010000; 476 477 pub const S_IFIFO: mode_t = 4096; 478 pub const S_IFCHR: mode_t = 8192; 479 pub const S_IFBLK: mode_t = 24576; 480 pub const S_IFDIR: mode_t = 16384; 481 pub const S_IFREG: mode_t = 32768; 482 pub const S_IFLNK: mode_t = 40960; 483 pub const S_IFSOCK: mode_t = 49152; 484 pub const S_IFMT: mode_t = 61440; 485 pub const S_IEXEC: mode_t = 64; 486 pub const S_IWRITE: mode_t = 128; 487 pub const S_IREAD: mode_t = 256; 488 pub const S_IRWXU: mode_t = 448; 489 pub const S_IXUSR: mode_t = 64; 490 pub const S_IWUSR: mode_t = 128; 491 pub const S_IRUSR: mode_t = 256; 492 pub const S_IRWXG: mode_t = 56; 493 pub const S_IXGRP: mode_t = 8; 494 pub const S_IWGRP: mode_t = 16; 495 pub const S_IRGRP: mode_t = 32; 496 pub const S_IRWXO: mode_t = 7; 497 pub const S_IXOTH: mode_t = 1; 498 pub const S_IWOTH: mode_t = 2; 499 pub const S_IROTH: mode_t = 4; 500 pub const F_OK: ::c_int = 0; 501 pub const R_OK: ::c_int = 4; 502 pub const W_OK: ::c_int = 2; 503 pub const X_OK: ::c_int = 1; 504 pub const STDIN_FILENO: ::c_int = 0; 505 pub const STDOUT_FILENO: ::c_int = 1; 506 pub const STDERR_FILENO: ::c_int = 2; 507 pub const F_LOCK: ::c_int = 1; 508 pub const F_TEST: ::c_int = 3; 509 pub const F_TLOCK: ::c_int = 2; 510 pub const F_ULOCK: ::c_int = 0; 511 pub const F_DUPFD_CLOEXEC: ::c_int = 17; 512 pub const SIGHUP: ::c_int = 1; 513 pub const SIGINT: ::c_int = 2; 514 pub const SIGQUIT: ::c_int = 3; 515 pub const SIGILL: ::c_int = 4; 516 pub const SIGABRT: ::c_int = 6; 517 pub const SIGEMT: ::c_int = 7; 518 pub const SIGFPE: ::c_int = 8; 519 pub const SIGKILL: ::c_int = 9; 520 pub const SIGSEGV: ::c_int = 11; 521 pub const SIGPIPE: ::c_int = 13; 522 pub const SIGALRM: ::c_int = 14; 523 pub const SIGTERM: ::c_int = 15; 524 525 pub const PROT_NONE: ::c_int = 0; 526 pub const PROT_READ: ::c_int = 1; 527 pub const PROT_WRITE: ::c_int = 2; 528 pub const PROT_EXEC: ::c_int = 4; 529 530 pub const MAP_FILE: ::c_int = 0x0000; 531 pub const MAP_SHARED: ::c_int = 0x0001; 532 pub const MAP_PRIVATE: ::c_int = 0x0002; 533 pub const MAP_FIXED: ::c_int = 0x0010; 534 pub const MAP_ANON: ::c_int = 0x1000; 535 pub const MAP_ANONYMOUS: ::c_int = MAP_ANON; 536 537 pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void; 538 539 pub const MCL_CURRENT: ::c_int = 0x0001; 540 pub const MCL_FUTURE: ::c_int = 0x0002; 541 542 pub const MS_SYNC: ::c_int = 0x0000; 543 pub const MS_ASYNC: ::c_int = 0x0001; 544 pub const MS_INVALIDATE: ::c_int = 0x0002; 545 546 pub const EPERM: ::c_int = 1; 547 pub const ENOENT: ::c_int = 2; 548 pub const ESRCH: ::c_int = 3; 549 pub const EINTR: ::c_int = 4; 550 pub const EIO: ::c_int = 5; 551 pub const ENXIO: ::c_int = 6; 552 pub const E2BIG: ::c_int = 7; 553 pub const ENOEXEC: ::c_int = 8; 554 pub const EBADF: ::c_int = 9; 555 pub const ECHILD: ::c_int = 10; 556 pub const EDEADLK: ::c_int = 11; 557 pub const ENOMEM: ::c_int = 12; 558 pub const EACCES: ::c_int = 13; 559 pub const EFAULT: ::c_int = 14; 560 pub const ENOTBLK: ::c_int = 15; 561 pub const EBUSY: ::c_int = 16; 562 pub const EEXIST: ::c_int = 17; 563 pub const EXDEV: ::c_int = 18; 564 pub const ENODEV: ::c_int = 19; 565 pub const ENOTDIR: ::c_int = 20; 566 pub const EISDIR: ::c_int = 21; 567 pub const EINVAL: ::c_int = 22; 568 pub const ENFILE: ::c_int = 23; 569 pub const EMFILE: ::c_int = 24; 570 pub const ENOTTY: ::c_int = 25; 571 pub const ETXTBSY: ::c_int = 26; 572 pub const EFBIG: ::c_int = 27; 573 pub const ENOSPC: ::c_int = 28; 574 pub const ESPIPE: ::c_int = 29; 575 pub const EROFS: ::c_int = 30; 576 pub const EMLINK: ::c_int = 31; 577 pub const EPIPE: ::c_int = 32; 578 pub const EDOM: ::c_int = 33; 579 pub const ERANGE: ::c_int = 34; 580 pub const EAGAIN: ::c_int = 35; 581 pub const EWOULDBLOCK: ::c_int = 35; 582 pub const EINPROGRESS: ::c_int = 36; 583 pub const EALREADY: ::c_int = 37; 584 pub const ENOTSOCK: ::c_int = 38; 585 pub const EDESTADDRREQ: ::c_int = 39; 586 pub const EMSGSIZE: ::c_int = 40; 587 pub const EPROTOTYPE: ::c_int = 41; 588 pub const ENOPROTOOPT: ::c_int = 42; 589 pub const EPROTONOSUPPORT: ::c_int = 43; 590 pub const ESOCKTNOSUPPORT: ::c_int = 44; 591 pub const EOPNOTSUPP: ::c_int = 45; 592 pub const ENOTSUP: ::c_int = EOPNOTSUPP; 593 pub const EPFNOSUPPORT: ::c_int = 46; 594 pub const EAFNOSUPPORT: ::c_int = 47; 595 pub const EADDRINUSE: ::c_int = 48; 596 pub const EADDRNOTAVAIL: ::c_int = 49; 597 pub const ENETDOWN: ::c_int = 50; 598 pub const ENETUNREACH: ::c_int = 51; 599 pub const ENETRESET: ::c_int = 52; 600 pub const ECONNABORTED: ::c_int = 53; 601 pub const ECONNRESET: ::c_int = 54; 602 pub const ENOBUFS: ::c_int = 55; 603 pub const EISCONN: ::c_int = 56; 604 pub const ENOTCONN: ::c_int = 57; 605 pub const ESHUTDOWN: ::c_int = 58; 606 pub const ETOOMANYREFS: ::c_int = 59; 607 pub const ETIMEDOUT: ::c_int = 60; 608 pub const ECONNREFUSED: ::c_int = 61; 609 pub const ELOOP: ::c_int = 62; 610 pub const ENAMETOOLONG: ::c_int = 63; 611 pub const EHOSTDOWN: ::c_int = 64; 612 pub const EHOSTUNREACH: ::c_int = 65; 613 pub const ENOTEMPTY: ::c_int = 66; 614 pub const EPROCLIM: ::c_int = 67; 615 pub const EUSERS: ::c_int = 68; 616 pub const EDQUOT: ::c_int = 69; 617 pub const ESTALE: ::c_int = 70; 618 pub const EREMOTE: ::c_int = 71; 619 pub const EBADRPC: ::c_int = 72; 620 pub const ERPCMISMATCH: ::c_int = 73; 621 pub const EPROGUNAVAIL: ::c_int = 74; 622 pub const EPROGMISMATCH: ::c_int = 75; 623 pub const EPROCUNAVAIL: ::c_int = 76; 624 pub const ENOLCK: ::c_int = 77; 625 pub const ENOSYS: ::c_int = 78; 626 pub const EFTYPE: ::c_int = 79; 627 pub const EAUTH: ::c_int = 80; 628 pub const ENEEDAUTH: ::c_int = 81; 629 pub const EIDRM: ::c_int = 82; 630 pub const ENOMSG: ::c_int = 83; 631 pub const EOVERFLOW: ::c_int = 84; 632 pub const ECANCELED: ::c_int = 85; 633 pub const EILSEQ: ::c_int = 86; 634 pub const ENOATTR: ::c_int = 87; 635 pub const EDOOFUS: ::c_int = 88; 636 pub const EBADMSG: ::c_int = 89; 637 pub const EMULTIHOP: ::c_int = 90; 638 pub const ENOLINK: ::c_int = 91; 639 pub const EPROTO: ::c_int = 92; 640 641 pub const POLLSTANDARD: ::c_short = ::POLLIN 642 | ::POLLPRI 643 | ::POLLOUT 644 | ::POLLRDNORM 645 | ::POLLRDBAND 646 | ::POLLWRBAND 647 | ::POLLERR 648 | ::POLLHUP 649 | ::POLLNVAL; 650 651 pub const EAI_AGAIN: ::c_int = 2; 652 pub const EAI_BADFLAGS: ::c_int = 3; 653 pub const EAI_FAIL: ::c_int = 4; 654 pub const EAI_FAMILY: ::c_int = 5; 655 pub const EAI_MEMORY: ::c_int = 6; 656 pub const EAI_NONAME: ::c_int = 8; 657 pub const EAI_SERVICE: ::c_int = 9; 658 pub const EAI_SOCKTYPE: ::c_int = 10; 659 pub const EAI_SYSTEM: ::c_int = 11; 660 pub const EAI_OVERFLOW: ::c_int = 14; 661 662 pub const F_DUPFD: ::c_int = 0; 663 pub const F_GETFD: ::c_int = 1; 664 pub const F_SETFD: ::c_int = 2; 665 pub const F_GETFL: ::c_int = 3; 666 pub const F_SETFL: ::c_int = 4; 667 668 pub const SIGTRAP: ::c_int = 5; 669 670 pub const GLOB_APPEND: ::c_int = 0x0001; 671 pub const GLOB_DOOFFS: ::c_int = 0x0002; 672 pub const GLOB_ERR: ::c_int = 0x0004; 673 pub const GLOB_MARK: ::c_int = 0x0008; 674 pub const GLOB_NOCHECK: ::c_int = 0x0010; 675 pub const GLOB_NOSORT: ::c_int = 0x0020; 676 pub const GLOB_NOESCAPE: ::c_int = 0x2000; 677 678 pub const GLOB_NOSPACE: ::c_int = -1; 679 pub const GLOB_ABORTED: ::c_int = -2; 680 pub const GLOB_NOMATCH: ::c_int = -3; 681 682 pub const POSIX_MADV_NORMAL: ::c_int = 0; 683 pub const POSIX_MADV_RANDOM: ::c_int = 1; 684 pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2; 685 pub const POSIX_MADV_WILLNEED: ::c_int = 3; 686 pub const POSIX_MADV_DONTNEED: ::c_int = 4; 687 688 pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 0; 689 pub const PTHREAD_PROCESS_SHARED: ::c_int = 1; 690 pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0; 691 pub const PTHREAD_CREATE_DETACHED: ::c_int = 1; 692 693 pub const RLIMIT_CPU: ::c_int = 0; 694 pub const RLIMIT_FSIZE: ::c_int = 1; 695 pub const RLIMIT_DATA: ::c_int = 2; 696 pub const RLIMIT_STACK: ::c_int = 3; 697 pub const RLIMIT_CORE: ::c_int = 4; 698 pub const RLIMIT_RSS: ::c_int = 5; 699 pub const RLIMIT_MEMLOCK: ::c_int = 6; 700 pub const RLIMIT_NPROC: ::c_int = 7; 701 pub const RLIMIT_NOFILE: ::c_int = 8; 702 pub const RLIMIT_SBSIZE: ::c_int = 9; 703 pub const RLIMIT_VMEM: ::c_int = 10; 704 pub const RLIMIT_AS: ::c_int = RLIMIT_VMEM; 705 pub const RLIM_INFINITY: rlim_t = 0x7fff_ffff_ffff_ffff; 706 707 pub const RUSAGE_SELF: ::c_int = 0; 708 pub const RUSAGE_CHILDREN: ::c_int = -1; 709 710 pub const CLOCK_REALTIME: ::clockid_t = 0; 711 pub const CLOCK_VIRTUAL: ::clockid_t = 1; 712 pub const CLOCK_PROF: ::clockid_t = 2; 713 pub const CLOCK_MONOTONIC: ::clockid_t = 4; 714 pub const CLOCK_UPTIME: ::clockid_t = 5; 715 pub const CLOCK_UPTIME_PRECISE: ::clockid_t = 7; 716 pub const CLOCK_UPTIME_FAST: ::clockid_t = 8; 717 pub const CLOCK_REALTIME_PRECISE: ::clockid_t = 9; 718 pub const CLOCK_REALTIME_FAST: ::clockid_t = 10; 719 pub const CLOCK_MONOTONIC_PRECISE: ::clockid_t = 11; 720 pub const CLOCK_MONOTONIC_FAST: ::clockid_t = 12; 721 pub const CLOCK_SECOND: ::clockid_t = 13; 722 pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 14; 723 pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 15; 724 725 pub const MADV_NORMAL: ::c_int = 0; 726 pub const MADV_RANDOM: ::c_int = 1; 727 pub const MADV_SEQUENTIAL: ::c_int = 2; 728 pub const MADV_WILLNEED: ::c_int = 3; 729 pub const MADV_DONTNEED: ::c_int = 4; 730 pub const MADV_FREE: ::c_int = 5; 731 pub const MADV_NOSYNC: ::c_int = 6; 732 pub const MADV_AUTOSYNC: ::c_int = 7; 733 pub const MADV_NOCORE: ::c_int = 8; 734 pub const MADV_CORE: ::c_int = 9; 735 736 pub const MINCORE_INCORE: ::c_int = 0x1; 737 pub const MINCORE_REFERENCED: ::c_int = 0x2; 738 pub const MINCORE_MODIFIED: ::c_int = 0x4; 739 pub const MINCORE_REFERENCED_OTHER: ::c_int = 0x8; 740 pub const MINCORE_MODIFIED_OTHER: ::c_int = 0x10; 741 pub const MINCORE_SUPER: ::c_int = 0x20; 742 743 pub const AF_UNSPEC: ::c_int = 0; 744 pub const AF_LOCAL: ::c_int = 1; 745 pub const AF_UNIX: ::c_int = AF_LOCAL; 746 pub const AF_INET: ::c_int = 2; 747 pub const AF_IMPLINK: ::c_int = 3; 748 pub const AF_PUP: ::c_int = 4; 749 pub const AF_CHAOS: ::c_int = 5; 750 pub const AF_NETBIOS: ::c_int = 6; 751 pub const AF_ISO: ::c_int = 7; 752 pub const AF_OSI: ::c_int = AF_ISO; 753 pub const AF_ECMA: ::c_int = 8; 754 pub const AF_DATAKIT: ::c_int = 9; 755 pub const AF_CCITT: ::c_int = 10; 756 pub const AF_SNA: ::c_int = 11; 757 pub const AF_DECnet: ::c_int = 12; 758 pub const AF_DLI: ::c_int = 13; 759 pub const AF_LAT: ::c_int = 14; 760 pub const AF_HYLINK: ::c_int = 15; 761 pub const AF_APPLETALK: ::c_int = 16; 762 pub const AF_ROUTE: ::c_int = 17; 763 pub const AF_LINK: ::c_int = 18; 764 pub const pseudo_AF_XTP: ::c_int = 19; 765 pub const AF_COIP: ::c_int = 20; 766 pub const AF_CNT: ::c_int = 21; 767 pub const pseudo_AF_RTIP: ::c_int = 22; 768 pub const AF_IPX: ::c_int = 23; 769 pub const AF_SIP: ::c_int = 24; 770 pub const pseudo_AF_PIP: ::c_int = 25; 771 pub const AF_ISDN: ::c_int = 26; 772 pub const AF_E164: ::c_int = AF_ISDN; 773 pub const pseudo_AF_KEY: ::c_int = 27; 774 pub const AF_INET6: ::c_int = 28; 775 pub const AF_NATM: ::c_int = 29; 776 pub const AF_ATM: ::c_int = 30; 777 pub const pseudo_AF_HDRCMPLT: ::c_int = 31; 778 pub const AF_NETGRAPH: ::c_int = 32; 779 780 pub const PF_UNSPEC: ::c_int = AF_UNSPEC; 781 pub const PF_LOCAL: ::c_int = AF_LOCAL; 782 pub const PF_UNIX: ::c_int = PF_LOCAL; 783 pub const PF_INET: ::c_int = AF_INET; 784 pub const PF_IMPLINK: ::c_int = AF_IMPLINK; 785 pub const PF_PUP: ::c_int = AF_PUP; 786 pub const PF_CHAOS: ::c_int = AF_CHAOS; 787 pub const PF_NETBIOS: ::c_int = AF_NETBIOS; 788 pub const PF_ISO: ::c_int = AF_ISO; 789 pub const PF_OSI: ::c_int = AF_ISO; 790 pub const PF_ECMA: ::c_int = AF_ECMA; 791 pub const PF_DATAKIT: ::c_int = AF_DATAKIT; 792 pub const PF_CCITT: ::c_int = AF_CCITT; 793 pub const PF_SNA: ::c_int = AF_SNA; 794 pub const PF_DECnet: ::c_int = AF_DECnet; 795 pub const PF_DLI: ::c_int = AF_DLI; 796 pub const PF_LAT: ::c_int = AF_LAT; 797 pub const PF_HYLINK: ::c_int = AF_HYLINK; 798 pub const PF_APPLETALK: ::c_int = AF_APPLETALK; 799 pub const PF_ROUTE: ::c_int = AF_ROUTE; 800 pub const PF_LINK: ::c_int = AF_LINK; 801 pub const PF_XTP: ::c_int = pseudo_AF_XTP; 802 pub const PF_COIP: ::c_int = AF_COIP; 803 pub const PF_CNT: ::c_int = AF_CNT; 804 pub const PF_SIP: ::c_int = AF_SIP; 805 pub const PF_IPX: ::c_int = AF_IPX; 806 pub const PF_RTIP: ::c_int = pseudo_AF_RTIP; 807 pub const PF_PIP: ::c_int = pseudo_AF_PIP; 808 pub const PF_ISDN: ::c_int = AF_ISDN; 809 pub const PF_KEY: ::c_int = pseudo_AF_KEY; 810 pub const PF_INET6: ::c_int = AF_INET6; 811 pub const PF_NATM: ::c_int = AF_NATM; 812 pub const PF_ATM: ::c_int = AF_ATM; 813 pub const PF_NETGRAPH: ::c_int = AF_NETGRAPH; 814 815 pub const PIOD_READ_D: ::c_int = 1; 816 pub const PIOD_WRITE_D: ::c_int = 2; 817 pub const PIOD_READ_I: ::c_int = 3; 818 pub const PIOD_WRITE_I: ::c_int = 4; 819 820 pub const PT_TRACE_ME: ::c_int = 0; 821 pub const PT_READ_I: ::c_int = 1; 822 pub const PT_READ_D: ::c_int = 2; 823 pub const PT_WRITE_I: ::c_int = 4; 824 pub const PT_WRITE_D: ::c_int = 5; 825 pub const PT_CONTINUE: ::c_int = 7; 826 pub const PT_KILL: ::c_int = 8; 827 pub const PT_STEP: ::c_int = 9; 828 pub const PT_ATTACH: ::c_int = 10; 829 pub const PT_DETACH: ::c_int = 11; 830 pub const PT_IO: ::c_int = 12; 831 832 pub const SOMAXCONN: ::c_int = 128; 833 834 pub const MSG_OOB: ::c_int = 0x00000001; 835 pub const MSG_PEEK: ::c_int = 0x00000002; 836 pub const MSG_DONTROUTE: ::c_int = 0x00000004; 837 pub const MSG_EOR: ::c_int = 0x00000008; 838 pub const MSG_TRUNC: ::c_int = 0x00000010; 839 pub const MSG_CTRUNC: ::c_int = 0x00000020; 840 pub const MSG_WAITALL: ::c_int = 0x00000040; 841 pub const MSG_DONTWAIT: ::c_int = 0x00000080; 842 pub const MSG_EOF: ::c_int = 0x00000100; 843 844 pub const SCM_TIMESTAMP: ::c_int = 0x02; 845 pub const SCM_CREDS: ::c_int = 0x03; 846 847 pub const SOCK_STREAM: ::c_int = 1; 848 pub const SOCK_DGRAM: ::c_int = 2; 849 pub const SOCK_RAW: ::c_int = 3; 850 pub const SOCK_RDM: ::c_int = 4; 851 pub const SOCK_SEQPACKET: ::c_int = 5; 852 pub const SOCK_CLOEXEC: ::c_int = 0x10000000; 853 pub const SOCK_NONBLOCK: ::c_int = 0x20000000; 854 pub const SOCK_MAXADDRLEN: ::c_int = 255; 855 pub const IP_TTL: ::c_int = 4; 856 pub const IP_HDRINCL: ::c_int = 2; 857 pub const IP_RECVDSTADDR: ::c_int = 7; 858 pub const IP_SENDSRCADDR: ::c_int = IP_RECVDSTADDR; 859 pub const IP_ADD_MEMBERSHIP: ::c_int = 12; 860 pub const IP_DROP_MEMBERSHIP: ::c_int = 13; 861 pub const IP_RECVIF: ::c_int = 20; 862 pub const IPV6_JOIN_GROUP: ::c_int = 12; 863 pub const IPV6_LEAVE_GROUP: ::c_int = 13; 864 pub const IPV6_CHECKSUM: ::c_int = 26; 865 pub const IPV6_RECVPKTINFO: ::c_int = 36; 866 pub const IPV6_PKTINFO: ::c_int = 46; 867 pub const IPV6_HOPLIMIT: ::c_int = 47; 868 pub const IPV6_RECVTCLASS: ::c_int = 57; 869 pub const IPV6_TCLASS: ::c_int = 61; 870 871 pub const TCP_NOPUSH: ::c_int = 4; 872 pub const TCP_NOOPT: ::c_int = 8; 873 pub const TCP_KEEPIDLE: ::c_int = 256; 874 pub const TCP_KEEPINTVL: ::c_int = 512; 875 pub const TCP_KEEPCNT: ::c_int = 1024; 876 877 pub const SOL_SOCKET: ::c_int = 0xffff; 878 pub const SO_DEBUG: ::c_int = 0x01; 879 pub const SO_ACCEPTCONN: ::c_int = 0x0002; 880 pub const SO_REUSEADDR: ::c_int = 0x0004; 881 pub const SO_KEEPALIVE: ::c_int = 0x0008; 882 pub const SO_DONTROUTE: ::c_int = 0x0010; 883 pub const SO_BROADCAST: ::c_int = 0x0020; 884 pub const SO_USELOOPBACK: ::c_int = 0x0040; 885 pub const SO_LINGER: ::c_int = 0x0080; 886 pub const SO_OOBINLINE: ::c_int = 0x0100; 887 pub const SO_REUSEPORT: ::c_int = 0x0200; 888 pub const SO_TIMESTAMP: ::c_int = 0x0400; 889 pub const SO_NOSIGPIPE: ::c_int = 0x0800; 890 pub const SO_ACCEPTFILTER: ::c_int = 0x1000; 891 pub const SO_SNDBUF: ::c_int = 0x1001; 892 pub const SO_RCVBUF: ::c_int = 0x1002; 893 pub const SO_SNDLOWAT: ::c_int = 0x1003; 894 pub const SO_RCVLOWAT: ::c_int = 0x1004; 895 pub const SO_SNDTIMEO: ::c_int = 0x1005; 896 pub const SO_RCVTIMEO: ::c_int = 0x1006; 897 pub const SO_ERROR: ::c_int = 0x1007; 898 pub const SO_TYPE: ::c_int = 0x1008; 899 900 pub const SHUT_RD: ::c_int = 0; 901 pub const SHUT_WR: ::c_int = 1; 902 pub const SHUT_RDWR: ::c_int = 2; 903 904 pub const LOCK_SH: ::c_int = 1; 905 pub const LOCK_EX: ::c_int = 2; 906 pub const LOCK_NB: ::c_int = 4; 907 pub const LOCK_UN: ::c_int = 8; 908 909 pub const MAP_COPY: ::c_int = 0x0002; 910 #[doc(hidden)] 911 #[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")] 912 pub const MAP_RENAME: ::c_int = 0x0020; 913 #[doc(hidden)] 914 #[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")] 915 pub const MAP_NORESERVE: ::c_int = 0x0040; 916 pub const MAP_HASSEMAPHORE: ::c_int = 0x0200; 917 pub const MAP_STACK: ::c_int = 0x0400; 918 pub const MAP_NOSYNC: ::c_int = 0x0800; 919 pub const MAP_NOCORE: ::c_int = 0x020000; 920 921 pub const IPPROTO_RAW: ::c_int = 255; 922 923 pub const _PC_LINK_MAX: ::c_int = 1; 924 pub const _PC_MAX_CANON: ::c_int = 2; 925 pub const _PC_MAX_INPUT: ::c_int = 3; 926 pub const _PC_NAME_MAX: ::c_int = 4; 927 pub const _PC_PATH_MAX: ::c_int = 5; 928 pub const _PC_PIPE_BUF: ::c_int = 6; 929 pub const _PC_CHOWN_RESTRICTED: ::c_int = 7; 930 pub const _PC_NO_TRUNC: ::c_int = 8; 931 pub const _PC_VDISABLE: ::c_int = 9; 932 pub const _PC_ALLOC_SIZE_MIN: ::c_int = 10; 933 pub const _PC_FILESIZEBITS: ::c_int = 12; 934 pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 14; 935 pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 15; 936 pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 16; 937 pub const _PC_REC_XFER_ALIGN: ::c_int = 17; 938 pub const _PC_SYMLINK_MAX: ::c_int = 18; 939 pub const _PC_MIN_HOLE_SIZE: ::c_int = 21; 940 pub const _PC_ASYNC_IO: ::c_int = 53; 941 pub const _PC_PRIO_IO: ::c_int = 54; 942 pub const _PC_SYNC_IO: ::c_int = 55; 943 pub const _PC_ACL_EXTENDED: ::c_int = 59; 944 pub const _PC_ACL_PATH_MAX: ::c_int = 60; 945 pub const _PC_CAP_PRESENT: ::c_int = 61; 946 pub const _PC_INF_PRESENT: ::c_int = 62; 947 pub const _PC_MAC_PRESENT: ::c_int = 63; 948 949 pub const _SC_ARG_MAX: ::c_int = 1; 950 pub const _SC_CHILD_MAX: ::c_int = 2; 951 pub const _SC_CLK_TCK: ::c_int = 3; 952 pub const _SC_NGROUPS_MAX: ::c_int = 4; 953 pub const _SC_OPEN_MAX: ::c_int = 5; 954 pub const _SC_JOB_CONTROL: ::c_int = 6; 955 pub const _SC_SAVED_IDS: ::c_int = 7; 956 pub const _SC_VERSION: ::c_int = 8; 957 pub const _SC_BC_BASE_MAX: ::c_int = 9; 958 pub const _SC_BC_DIM_MAX: ::c_int = 10; 959 pub const _SC_BC_SCALE_MAX: ::c_int = 11; 960 pub const _SC_BC_STRING_MAX: ::c_int = 12; 961 pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 13; 962 pub const _SC_EXPR_NEST_MAX: ::c_int = 14; 963 pub const _SC_LINE_MAX: ::c_int = 15; 964 pub const _SC_RE_DUP_MAX: ::c_int = 16; 965 pub const _SC_2_VERSION: ::c_int = 17; 966 pub const _SC_2_C_BIND: ::c_int = 18; 967 pub const _SC_2_C_DEV: ::c_int = 19; 968 pub const _SC_2_CHAR_TERM: ::c_int = 20; 969 pub const _SC_2_FORT_DEV: ::c_int = 21; 970 pub const _SC_2_FORT_RUN: ::c_int = 22; 971 pub const _SC_2_LOCALEDEF: ::c_int = 23; 972 pub const _SC_2_SW_DEV: ::c_int = 24; 973 pub const _SC_2_UPE: ::c_int = 25; 974 pub const _SC_STREAM_MAX: ::c_int = 26; 975 pub const _SC_TZNAME_MAX: ::c_int = 27; 976 pub const _SC_ASYNCHRONOUS_IO: ::c_int = 28; 977 pub const _SC_MAPPED_FILES: ::c_int = 29; 978 pub const _SC_MEMLOCK: ::c_int = 30; 979 pub const _SC_MEMLOCK_RANGE: ::c_int = 31; 980 pub const _SC_MEMORY_PROTECTION: ::c_int = 32; 981 pub const _SC_MESSAGE_PASSING: ::c_int = 33; 982 pub const _SC_PRIORITIZED_IO: ::c_int = 34; 983 pub const _SC_PRIORITY_SCHEDULING: ::c_int = 35; 984 pub const _SC_REALTIME_SIGNALS: ::c_int = 36; 985 pub const _SC_SEMAPHORES: ::c_int = 37; 986 pub const _SC_FSYNC: ::c_int = 38; 987 pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 39; 988 pub const _SC_SYNCHRONIZED_IO: ::c_int = 40; 989 pub const _SC_TIMERS: ::c_int = 41; 990 pub const _SC_AIO_LISTIO_MAX: ::c_int = 42; 991 pub const _SC_AIO_MAX: ::c_int = 43; 992 pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 44; 993 pub const _SC_DELAYTIMER_MAX: ::c_int = 45; 994 pub const _SC_MQ_OPEN_MAX: ::c_int = 46; 995 pub const _SC_PAGESIZE: ::c_int = 47; 996 pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE; 997 pub const _SC_RTSIG_MAX: ::c_int = 48; 998 pub const _SC_SEM_NSEMS_MAX: ::c_int = 49; 999 pub const _SC_SEM_VALUE_MAX: ::c_int = 50; 1000 pub const _SC_SIGQUEUE_MAX: ::c_int = 51; 1001 pub const _SC_TIMER_MAX: ::c_int = 52; 1002 pub const _SC_IOV_MAX: ::c_int = 56; 1003 pub const _SC_NPROCESSORS_CONF: ::c_int = 57; 1004 pub const _SC_2_PBS: ::c_int = 59; 1005 pub const _SC_2_PBS_ACCOUNTING: ::c_int = 60; 1006 pub const _SC_2_PBS_CHECKPOINT: ::c_int = 61; 1007 pub const _SC_2_PBS_LOCATE: ::c_int = 62; 1008 pub const _SC_2_PBS_MESSAGE: ::c_int = 63; 1009 pub const _SC_2_PBS_TRACK: ::c_int = 64; 1010 pub const _SC_ADVISORY_INFO: ::c_int = 65; 1011 pub const _SC_BARRIERS: ::c_int = 66; 1012 pub const _SC_CLOCK_SELECTION: ::c_int = 67; 1013 pub const _SC_CPUTIME: ::c_int = 68; 1014 pub const _SC_FILE_LOCKING: ::c_int = 69; 1015 pub const _SC_NPROCESSORS_ONLN: ::c_int = 58; 1016 pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 70; 1017 pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 71; 1018 pub const _SC_HOST_NAME_MAX: ::c_int = 72; 1019 pub const _SC_LOGIN_NAME_MAX: ::c_int = 73; 1020 pub const _SC_MONOTONIC_CLOCK: ::c_int = 74; 1021 pub const _SC_MQ_PRIO_MAX: ::c_int = 75; 1022 pub const _SC_READER_WRITER_LOCKS: ::c_int = 76; 1023 pub const _SC_REGEXP: ::c_int = 77; 1024 pub const _SC_SHELL: ::c_int = 78; 1025 pub const _SC_SPAWN: ::c_int = 79; 1026 pub const _SC_SPIN_LOCKS: ::c_int = 80; 1027 pub const _SC_SPORADIC_SERVER: ::c_int = 81; 1028 pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 82; 1029 pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 83; 1030 pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 85; 1031 pub const _SC_THREAD_KEYS_MAX: ::c_int = 86; 1032 pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 87; 1033 pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 88; 1034 pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 89; 1035 pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 90; 1036 pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 91; 1037 pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 92; 1038 pub const _SC_THREAD_STACK_MIN: ::c_int = 93; 1039 pub const _SC_THREAD_THREADS_MAX: ::c_int = 94; 1040 pub const _SC_TIMEOUTS: ::c_int = 95; 1041 pub const _SC_THREADS: ::c_int = 96; 1042 pub const _SC_TRACE: ::c_int = 97; 1043 pub const _SC_TRACE_EVENT_FILTER: ::c_int = 98; 1044 pub const _SC_TRACE_INHERIT: ::c_int = 99; 1045 pub const _SC_TRACE_LOG: ::c_int = 100; 1046 pub const _SC_TTY_NAME_MAX: ::c_int = 101; 1047 pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 102; 1048 pub const _SC_V6_ILP32_OFF32: ::c_int = 103; 1049 pub const _SC_V6_ILP32_OFFBIG: ::c_int = 104; 1050 pub const _SC_V6_LP64_OFF64: ::c_int = 105; 1051 pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 106; 1052 pub const _SC_ATEXIT_MAX: ::c_int = 107; 1053 pub const _SC_XOPEN_CRYPT: ::c_int = 108; 1054 pub const _SC_XOPEN_ENH_I18N: ::c_int = 109; 1055 pub const _SC_XOPEN_LEGACY: ::c_int = 110; 1056 pub const _SC_XOPEN_REALTIME: ::c_int = 111; 1057 pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 112; 1058 pub const _SC_XOPEN_SHM: ::c_int = 113; 1059 pub const _SC_XOPEN_STREAMS: ::c_int = 114; 1060 pub const _SC_XOPEN_UNIX: ::c_int = 115; 1061 pub const _SC_XOPEN_VERSION: ::c_int = 116; 1062 pub const _SC_XOPEN_XCU_VERSION: ::c_int = 117; 1063 pub const _SC_IPV6: ::c_int = 118; 1064 pub const _SC_RAW_SOCKETS: ::c_int = 119; 1065 pub const _SC_SYMLOOP_MAX: ::c_int = 120; 1066 pub const _SC_PHYS_PAGES: ::c_int = 121; 1067 1068 pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = 0 as *mut _; 1069 pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = 0 as *mut _; 1070 pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = 0 as *mut _; 1071 pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 1; 1072 pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2; 1073 pub const PTHREAD_MUTEX_NORMAL: ::c_int = 3; 1074 pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_ERRORCHECK; 1075 1076 pub const SCHED_FIFO: ::c_int = 1; 1077 pub const SCHED_OTHER: ::c_int = 2; 1078 pub const SCHED_RR: ::c_int = 3; 1079 1080 pub const FD_SETSIZE: usize = 1024; 1081 1082 pub const ST_NOSUID: ::c_ulong = 2; 1083 1084 pub const NI_MAXHOST: ::size_t = 1025; 1085 1086 pub const RTLD_LOCAL: ::c_int = 0; 1087 pub const RTLD_NODELETE: ::c_int = 0x1000; 1088 pub const RTLD_NOLOAD: ::c_int = 0x2000; 1089 pub const RTLD_GLOBAL: ::c_int = 0x100; 1090 1091 pub const LOG_NTP: ::c_int = 12 << 3; 1092 pub const LOG_SECURITY: ::c_int = 13 << 3; 1093 pub const LOG_CONSOLE: ::c_int = 14 << 3; 1094 pub const LOG_NFACILITIES: ::c_int = 24; 1095 1096 pub const TIOCEXCL: ::c_uint = 0x2000740d; 1097 pub const TIOCNXCL: ::c_uint = 0x2000740e; 1098 pub const TIOCFLUSH: ::c_ulong = 0x80047410; 1099 pub const TIOCGETA: ::c_uint = 0x402c7413; 1100 pub const TIOCSETA: ::c_ulong = 0x802c7414; 1101 pub const TIOCSETAW: ::c_ulong = 0x802c7415; 1102 pub const TIOCSETAF: ::c_ulong = 0x802c7416; 1103 pub const TIOCGETD: ::c_uint = 0x4004741a; 1104 pub const TIOCSETD: ::c_ulong = 0x8004741b; 1105 pub const TIOCGDRAINWAIT: ::c_uint = 0x40047456; 1106 pub const TIOCSDRAINWAIT: ::c_ulong = 0x80047457; 1107 pub const TIOCTIMESTAMP: ::c_uint = 0x40107459; 1108 pub const TIOCMGDTRWAIT: ::c_uint = 0x4004745a; 1109 pub const TIOCMSDTRWAIT: ::c_ulong = 0x8004745b; 1110 pub const TIOCDRAIN: ::c_uint = 0x2000745e; 1111 pub const TIOCEXT: ::c_ulong = 0x80047460; 1112 pub const TIOCSCTTY: ::c_uint = 0x20007461; 1113 pub const TIOCCONS: ::c_ulong = 0x80047462; 1114 pub const TIOCGSID: ::c_uint = 0x40047463; 1115 pub const TIOCSTAT: ::c_uint = 0x20007465; 1116 pub const TIOCUCNTL: ::c_ulong = 0x80047466; 1117 pub const TIOCSWINSZ: ::c_ulong = 0x80087467; 1118 pub const TIOCGWINSZ: ::c_uint = 0x40087468; 1119 pub const TIOCMGET: ::c_uint = 0x4004746a; 1120 pub const TIOCM_LE: ::c_int = 0x1; 1121 pub const TIOCM_DTR: ::c_int = 0x2; 1122 pub const TIOCM_RTS: ::c_int = 0x4; 1123 pub const TIOCM_ST: ::c_int = 0x8; 1124 pub const TIOCM_SR: ::c_int = 0x10; 1125 pub const TIOCM_CTS: ::c_int = 0x20; 1126 pub const TIOCM_RI: ::c_int = 0x80; 1127 pub const TIOCM_DSR: ::c_int = 0x100; 1128 pub const TIOCM_CD: ::c_int = 0x40; 1129 pub const TIOCM_CAR: ::c_int = 0x40; 1130 pub const TIOCM_RNG: ::c_int = 0x80; 1131 pub const TIOCMBIC: ::c_ulong = 0x8004746b; 1132 pub const TIOCMBIS: ::c_ulong = 0x8004746c; 1133 pub const TIOCMSET: ::c_ulong = 0x8004746d; 1134 pub const TIOCSTART: ::c_uint = 0x2000746e; 1135 pub const TIOCSTOP: ::c_uint = 0x2000746f; 1136 pub const TIOCPKT: ::c_ulong = 0x80047470; 1137 pub const TIOCPKT_DATA: ::c_int = 0x0; 1138 pub const TIOCPKT_FLUSHREAD: ::c_int = 0x1; 1139 pub const TIOCPKT_FLUSHWRITE: ::c_int = 0x2; 1140 pub const TIOCPKT_STOP: ::c_int = 0x4; 1141 pub const TIOCPKT_START: ::c_int = 0x8; 1142 pub const TIOCPKT_NOSTOP: ::c_int = 0x10; 1143 pub const TIOCPKT_DOSTOP: ::c_int = 0x20; 1144 pub const TIOCPKT_IOCTL: ::c_int = 0x40; 1145 pub const TIOCNOTTY: ::c_uint = 0x20007471; 1146 pub const TIOCSTI: ::c_ulong = 0x80017472; 1147 pub const TIOCOUTQ: ::c_uint = 0x40047473; 1148 pub const TIOCSPGRP: ::c_ulong = 0x80047476; 1149 pub const TIOCGPGRP: ::c_uint = 0x40047477; 1150 pub const TIOCCDTR: ::c_uint = 0x20007478; 1151 pub const TIOCSDTR: ::c_uint = 0x20007479; 1152 pub const TTYDISC: ::c_int = 0x0; 1153 pub const SLIPDISC: ::c_int = 0x4; 1154 pub const PPPDISC: ::c_int = 0x5; 1155 pub const NETGRAPHDISC: ::c_int = 0x6; 1156 1157 pub const BIOCGRSIG: ::c_ulong = 0x40044272; 1158 pub const BIOCSRSIG: ::c_ulong = 0x80044273; 1159 pub const BIOCSDLT: ::c_ulong = 0x80044278; 1160 pub const BIOCGSEESENT: ::c_ulong = 0x40044276; 1161 pub const BIOCSSEESENT: ::c_ulong = 0x80044277; 1162 pub const BIOCSETF: ::c_ulong = 0x80104267; 1163 pub const BIOCGDLTLIST: ::c_ulong = 0xc0104279; 1164 pub const BIOCSRTIMEOUT: ::c_ulong = 0x8010426d; 1165 pub const BIOCGRTIMEOUT: ::c_ulong = 0x4010426e; 1166 1167 pub const FIODTYPE: ::c_ulong = 0x4004667a; 1168 pub const FIOGETLBA: ::c_ulong = 0x40046679; 1169 pub const FIODGNAME: ::c_ulong = 0x80106678; 1170 1171 pub const B0: speed_t = 0; 1172 pub const B50: speed_t = 50; 1173 pub const B75: speed_t = 75; 1174 pub const B110: speed_t = 110; 1175 pub const B134: speed_t = 134; 1176 pub const B150: speed_t = 150; 1177 pub const B200: speed_t = 200; 1178 pub const B300: speed_t = 300; 1179 pub const B600: speed_t = 600; 1180 pub const B1200: speed_t = 1200; 1181 pub const B1800: speed_t = 1800; 1182 pub const B2400: speed_t = 2400; 1183 pub const B4800: speed_t = 4800; 1184 pub const B9600: speed_t = 9600; 1185 pub const B19200: speed_t = 19200; 1186 pub const B38400: speed_t = 38400; 1187 pub const B7200: speed_t = 7200; 1188 pub const B14400: speed_t = 14400; 1189 pub const B28800: speed_t = 28800; 1190 pub const B57600: speed_t = 57600; 1191 pub const B76800: speed_t = 76800; 1192 pub const B115200: speed_t = 115200; 1193 pub const B230400: speed_t = 230400; 1194 pub const EXTA: speed_t = 19200; 1195 pub const EXTB: speed_t = 38400; 1196 1197 pub const SEM_FAILED: *mut sem_t = 0 as *mut sem_t; 1198 1199 pub const CRTSCTS: ::tcflag_t = 0x00030000; 1200 pub const CCTS_OFLOW: ::tcflag_t = 0x00010000; 1201 pub const CRTS_IFLOW: ::tcflag_t = 0x00020000; 1202 pub const CDTR_IFLOW: ::tcflag_t = 0x00040000; 1203 pub const CDSR_OFLOW: ::tcflag_t = 0x00080000; 1204 pub const CCAR_OFLOW: ::tcflag_t = 0x00100000; 1205 pub const VERASE2: usize = 7; 1206 pub const OCRNL: ::tcflag_t = 0x10; 1207 pub const ONOCR: ::tcflag_t = 0x20; 1208 pub const ONLRET: ::tcflag_t = 0x40; 1209 1210 pub const CMGROUP_MAX: usize = 16; 1211 1212 // https://github.com/freebsd/freebsd/blob/master/sys/net/bpf.h 1213 // sizeof(long) 1214 pub const BPF_ALIGNMENT: ::c_int = 8; 1215 1216 // Values for rtprio struct (prio field) and syscall (function argument) 1217 pub const RTP_PRIO_MIN: ::c_ushort = 0; 1218 pub const RTP_PRIO_MAX: ::c_ushort = 31; 1219 pub const RTP_LOOKUP: ::c_int = 0; 1220 pub const RTP_SET: ::c_int = 1; 1221 1222 // Flags for chflags(2) 1223 pub const UF_SETTABLE: ::c_ulong = 0x0000ffff; 1224 pub const UF_NODUMP: ::c_ulong = 0x00000001; 1225 pub const UF_IMMUTABLE: ::c_ulong = 0x00000002; 1226 pub const UF_APPEND: ::c_ulong = 0x00000004; 1227 pub const UF_OPAQUE: ::c_ulong = 0x00000008; 1228 pub const UF_NOUNLINK: ::c_ulong = 0x00000010; 1229 pub const SF_SETTABLE: ::c_ulong = 0xffff0000; 1230 pub const SF_ARCHIVED: ::c_ulong = 0x00010000; 1231 pub const SF_IMMUTABLE: ::c_ulong = 0x00020000; 1232 pub const SF_APPEND: ::c_ulong = 0x00040000; 1233 pub const SF_NOUNLINK: ::c_ulong = 0x00100000; 1234 1235 pub const TIMER_ABSTIME: ::c_int = 1; 1236 1237 //<sys/timex.h> 1238 pub const NTP_API: ::c_int = 4; 1239 pub const MAXPHASE: ::c_long = 500000000; 1240 pub const MAXFREQ: ::c_long = 500000; 1241 pub const MINSEC: ::c_int = 256; 1242 pub const MAXSEC: ::c_int = 2048; 1243 pub const NANOSECOND: ::c_long = 1000000000; 1244 pub const SCALE_PPM: ::c_int = 65; 1245 pub const MAXTC: ::c_int = 10; 1246 pub const MOD_OFFSET: ::c_uint = 0x0001; 1247 pub const MOD_FREQUENCY: ::c_uint = 0x0002; 1248 pub const MOD_MAXERROR: ::c_uint = 0x0004; 1249 pub const MOD_ESTERROR: ::c_uint = 0x0008; 1250 pub const MOD_STATUS: ::c_uint = 0x0010; 1251 pub const MOD_TIMECONST: ::c_uint = 0x0020; 1252 pub const MOD_PPSMAX: ::c_uint = 0x0040; 1253 pub const MOD_TAI: ::c_uint = 0x0080; 1254 pub const MOD_MICRO: ::c_uint = 0x1000; 1255 pub const MOD_NANO: ::c_uint = 0x2000; 1256 pub const MOD_CLKB: ::c_uint = 0x4000; 1257 pub const MOD_CLKA: ::c_uint = 0x8000; 1258 pub const STA_PLL: ::c_int = 0x0001; 1259 pub const STA_PPSFREQ: ::c_int = 0x0002; 1260 pub const STA_PPSTIME: ::c_int = 0x0004; 1261 pub const STA_FLL: ::c_int = 0x0008; 1262 pub const STA_INS: ::c_int = 0x0010; 1263 pub const STA_DEL: ::c_int = 0x0020; 1264 pub const STA_UNSYNC: ::c_int = 0x0040; 1265 pub const STA_FREQHOLD: ::c_int = 0x0080; 1266 pub const STA_PPSSIGNAL: ::c_int = 0x0100; 1267 pub const STA_PPSJITTER: ::c_int = 0x0200; 1268 pub const STA_PPSWANDER: ::c_int = 0x0400; 1269 pub const STA_PPSERROR: ::c_int = 0x0800; 1270 pub const STA_CLOCKERR: ::c_int = 0x1000; 1271 pub const STA_NANO: ::c_int = 0x2000; 1272 pub const STA_MODE: ::c_int = 0x4000; 1273 pub const STA_CLK: ::c_int = 0x8000; 1274 pub const STA_RONLY: ::c_int = STA_PPSSIGNAL 1275 | STA_PPSJITTER 1276 | STA_PPSWANDER 1277 | STA_PPSERROR 1278 | STA_CLOCKERR 1279 | STA_NANO 1280 | STA_MODE 1281 | STA_CLK; 1282 pub const TIME_OK: ::c_int = 0; 1283 pub const TIME_INS: ::c_int = 1; 1284 pub const TIME_DEL: ::c_int = 2; 1285 pub const TIME_OOP: ::c_int = 3; 1286 pub const TIME_WAIT: ::c_int = 4; 1287 pub const TIME_ERROR: ::c_int = 5; 1288 1289 pub const REG_ENOSYS: ::c_int = -1; 1290 pub const REG_ILLSEQ: ::c_int = 17; 1291 1292 safe_f! { 1293 pub {const} fn WIFCONTINUED(status: ::c_int) -> bool { 1294 status == 0x13 1295 } 1296 1297 pub {const} fn WSTOPSIG(status: ::c_int) -> ::c_int { 1298 status >> 8 1299 } 1300 1301 pub {const} fn WIFSTOPPED(status: ::c_int) -> bool { 1302 (status & 0o177) == 0o177 1303 } 1304 } 1305 1306 extern "C" { sem_destroy(sem: *mut sem_t) -> ::c_int1307 pub fn sem_destroy(sem: *mut sem_t) -> ::c_int; sem_init( sem: *mut sem_t, pshared: ::c_int, value: ::c_uint, ) -> ::c_int1308 pub fn sem_init( 1309 sem: *mut sem_t, 1310 pshared: ::c_int, 1311 value: ::c_uint, 1312 ) -> ::c_int; 1313 daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int1314 pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int; gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int1315 pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int; accept4( s: ::c_int, addr: *mut ::sockaddr, addrlen: *mut ::socklen_t, flags: ::c_int, ) -> ::c_int1316 pub fn accept4( 1317 s: ::c_int, 1318 addr: *mut ::sockaddr, 1319 addrlen: *mut ::socklen_t, 1320 flags: ::c_int, 1321 ) -> ::c_int; chflags(path: *const ::c_char, flags: ::c_ulong) -> ::c_int1322 pub fn chflags(path: *const ::c_char, flags: ::c_ulong) -> ::c_int; chflagsat( fd: ::c_int, path: *const ::c_char, flags: ::c_ulong, atflag: ::c_int, ) -> ::c_int1323 pub fn chflagsat( 1324 fd: ::c_int, 1325 path: *const ::c_char, 1326 flags: ::c_ulong, 1327 atflag: ::c_int, 1328 ) -> ::c_int; 1329 clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int1330 pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int; clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int1331 pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int; clock_settime( clk_id: ::clockid_t, tp: *const ::timespec, ) -> ::c_int1332 pub fn clock_settime( 1333 clk_id: ::clockid_t, 1334 tp: *const ::timespec, 1335 ) -> ::c_int; clock_getcpuclockid( pid: ::pid_t, clk_id: *mut ::clockid_t, ) -> ::c_int1336 pub fn clock_getcpuclockid( 1337 pid: ::pid_t, 1338 clk_id: *mut ::clockid_t, 1339 ) -> ::c_int; 1340 dirfd(dirp: *mut ::DIR) -> ::c_int1341 pub fn dirfd(dirp: *mut ::DIR) -> ::c_int; duplocale(base: ::locale_t) -> ::locale_t1342 pub fn duplocale(base: ::locale_t) -> ::locale_t; endutxent()1343 pub fn endutxent(); fchflags(fd: ::c_int, flags: ::c_ulong) -> ::c_int1344 pub fn fchflags(fd: ::c_int, flags: ::c_ulong) -> ::c_int; futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int1345 pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int; getdomainname(name: *mut ::c_char, len: ::c_int) -> ::c_int1346 pub fn getdomainname(name: *mut ::c_char, len: ::c_int) -> ::c_int; getgrent_r( grp: *mut ::group, buf: *mut ::c_char, buflen: ::size_t, result: *mut *mut ::group, ) -> ::c_int1347 pub fn getgrent_r( 1348 grp: *mut ::group, 1349 buf: *mut ::c_char, 1350 buflen: ::size_t, 1351 result: *mut *mut ::group, 1352 ) -> ::c_int; getpwent_r( pwd: *mut ::passwd, buf: *mut ::c_char, buflen: ::size_t, result: *mut *mut ::passwd, ) -> ::c_int1353 pub fn getpwent_r( 1354 pwd: *mut ::passwd, 1355 buf: *mut ::c_char, 1356 buflen: ::size_t, 1357 result: *mut *mut ::passwd, 1358 ) -> ::c_int; getgrouplist( name: *const ::c_char, basegid: ::gid_t, groups: *mut ::gid_t, ngroups: *mut ::c_int, ) -> ::c_int1359 pub fn getgrouplist( 1360 name: *const ::c_char, 1361 basegid: ::gid_t, 1362 groups: *mut ::gid_t, 1363 ngroups: *mut ::c_int, 1364 ) -> ::c_int; getnameinfo( sa: *const ::sockaddr, salen: ::socklen_t, host: *mut ::c_char, hostlen: ::size_t, serv: *mut ::c_char, servlen: ::size_t, flags: ::c_int, ) -> ::c_int1365 pub fn getnameinfo( 1366 sa: *const ::sockaddr, 1367 salen: ::socklen_t, 1368 host: *mut ::c_char, 1369 hostlen: ::size_t, 1370 serv: *mut ::c_char, 1371 servlen: ::size_t, 1372 flags: ::c_int, 1373 ) -> ::c_int; getpriority(which: ::c_int, who: ::c_int) -> ::c_int1374 pub fn getpriority(which: ::c_int, who: ::c_int) -> ::c_int; getutxent() -> *mut utmpx1375 pub fn getutxent() -> *mut utmpx; getutxid(ut: *const utmpx) -> *mut utmpx1376 pub fn getutxid(ut: *const utmpx) -> *mut utmpx; getutxline(ut: *const utmpx) -> *mut utmpx1377 pub fn getutxline(ut: *const utmpx) -> *mut utmpx; initgroups(name: *const ::c_char, basegid: ::gid_t) -> ::c_int1378 pub fn initgroups(name: *const ::c_char, basegid: ::gid_t) -> ::c_int; 1379 #[cfg_attr( 1380 all(target_os = "freebsd", any(freebsd11, freebsd10)), 1381 link_name = "kevent@FBSD_1.0" 1382 )] kevent( kq: ::c_int, changelist: *const ::kevent, nchanges: ::c_int, eventlist: *mut ::kevent, nevents: ::c_int, timeout: *const ::timespec, ) -> ::c_int1383 pub fn kevent( 1384 kq: ::c_int, 1385 changelist: *const ::kevent, 1386 nchanges: ::c_int, 1387 eventlist: *mut ::kevent, 1388 nevents: ::c_int, 1389 timeout: *const ::timespec, 1390 ) -> ::c_int; lchflags(path: *const ::c_char, flags: ::c_ulong) -> ::c_int1391 pub fn lchflags(path: *const ::c_char, flags: ::c_ulong) -> ::c_int; lio_listio( mode: ::c_int, aiocb_list: *const *mut aiocb, nitems: ::c_int, sevp: *mut sigevent, ) -> ::c_int1392 pub fn lio_listio( 1393 mode: ::c_int, 1394 aiocb_list: *const *mut aiocb, 1395 nitems: ::c_int, 1396 sevp: *mut sigevent, 1397 ) -> ::c_int; lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int1398 pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int; memrchr( cx: *const ::c_void, c: ::c_int, n: ::size_t, ) -> *mut ::c_void1399 pub fn memrchr( 1400 cx: *const ::c_void, 1401 c: ::c_int, 1402 n: ::size_t, 1403 ) -> *mut ::c_void; mkfifoat( dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t, ) -> ::c_int1404 pub fn mkfifoat( 1405 dirfd: ::c_int, 1406 pathname: *const ::c_char, 1407 mode: ::mode_t, 1408 ) -> ::c_int; 1409 #[cfg_attr( 1410 all(target_os = "freebsd", any(freebsd11, freebsd10)), 1411 link_name = "mknodat@FBSD_1.1" 1412 )] mknodat( dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t, dev: dev_t, ) -> ::c_int1413 pub fn mknodat( 1414 dirfd: ::c_int, 1415 pathname: *const ::c_char, 1416 mode: ::mode_t, 1417 dev: dev_t, 1418 ) -> ::c_int; mincore( addr: *const ::c_void, len: ::size_t, vec: *mut ::c_char, ) -> ::c_int1419 pub fn mincore( 1420 addr: *const ::c_void, 1421 len: ::size_t, 1422 vec: *mut ::c_char, 1423 ) -> ::c_int; newlocale( mask: ::c_int, locale: *const ::c_char, base: ::locale_t, ) -> ::locale_t1424 pub fn newlocale( 1425 mask: ::c_int, 1426 locale: *const ::c_char, 1427 base: ::locale_t, 1428 ) -> ::locale_t; nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char1429 pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) 1430 -> *mut ::c_char; pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int1431 pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int; ppoll( fds: *mut ::pollfd, nfds: ::nfds_t, timeout: *const ::timespec, sigmask: *const sigset_t, ) -> ::c_int1432 pub fn ppoll( 1433 fds: *mut ::pollfd, 1434 nfds: ::nfds_t, 1435 timeout: *const ::timespec, 1436 sigmask: *const sigset_t, 1437 ) -> ::c_int; preadv( fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t, ) -> ::ssize_t1438 pub fn preadv( 1439 fd: ::c_int, 1440 iov: *const ::iovec, 1441 iovcnt: ::c_int, 1442 offset: ::off_t, 1443 ) -> ::ssize_t; pthread_attr_get_np( tid: ::pthread_t, attr: *mut ::pthread_attr_t, ) -> ::c_int1444 pub fn pthread_attr_get_np( 1445 tid: ::pthread_t, 1446 attr: *mut ::pthread_attr_t, 1447 ) -> ::c_int; pthread_attr_getguardsize( attr: *const ::pthread_attr_t, guardsize: *mut ::size_t, ) -> ::c_int1448 pub fn pthread_attr_getguardsize( 1449 attr: *const ::pthread_attr_t, 1450 guardsize: *mut ::size_t, 1451 ) -> ::c_int; pthread_attr_getstack( attr: *const ::pthread_attr_t, stackaddr: *mut *mut ::c_void, stacksize: *mut ::size_t, ) -> ::c_int1452 pub fn pthread_attr_getstack( 1453 attr: *const ::pthread_attr_t, 1454 stackaddr: *mut *mut ::c_void, 1455 stacksize: *mut ::size_t, 1456 ) -> ::c_int; pthread_condattr_getclock( attr: *const pthread_condattr_t, clock_id: *mut clockid_t, ) -> ::c_int1457 pub fn pthread_condattr_getclock( 1458 attr: *const pthread_condattr_t, 1459 clock_id: *mut clockid_t, 1460 ) -> ::c_int; pthread_condattr_getpshared( attr: *const pthread_condattr_t, pshared: *mut ::c_int, ) -> ::c_int1461 pub fn pthread_condattr_getpshared( 1462 attr: *const pthread_condattr_t, 1463 pshared: *mut ::c_int, 1464 ) -> ::c_int; pthread_condattr_setclock( attr: *mut pthread_condattr_t, clock_id: ::clockid_t, ) -> ::c_int1465 pub fn pthread_condattr_setclock( 1466 attr: *mut pthread_condattr_t, 1467 clock_id: ::clockid_t, 1468 ) -> ::c_int; pthread_condattr_setpshared( attr: *mut pthread_condattr_t, pshared: ::c_int, ) -> ::c_int1469 pub fn pthread_condattr_setpshared( 1470 attr: *mut pthread_condattr_t, 1471 pshared: ::c_int, 1472 ) -> ::c_int; pthread_main_np() -> ::c_int1473 pub fn pthread_main_np() -> ::c_int; pthread_mutex_timedlock( lock: *mut pthread_mutex_t, abstime: *const ::timespec, ) -> ::c_int1474 pub fn pthread_mutex_timedlock( 1475 lock: *mut pthread_mutex_t, 1476 abstime: *const ::timespec, 1477 ) -> ::c_int; pthread_mutexattr_getpshared( attr: *const pthread_mutexattr_t, pshared: *mut ::c_int, ) -> ::c_int1478 pub fn pthread_mutexattr_getpshared( 1479 attr: *const pthread_mutexattr_t, 1480 pshared: *mut ::c_int, 1481 ) -> ::c_int; pthread_mutexattr_setpshared( attr: *mut pthread_mutexattr_t, pshared: ::c_int, ) -> ::c_int1482 pub fn pthread_mutexattr_setpshared( 1483 attr: *mut pthread_mutexattr_t, 1484 pshared: ::c_int, 1485 ) -> ::c_int; pthread_rwlockattr_getpshared( attr: *const pthread_rwlockattr_t, val: *mut ::c_int, ) -> ::c_int1486 pub fn pthread_rwlockattr_getpshared( 1487 attr: *const pthread_rwlockattr_t, 1488 val: *mut ::c_int, 1489 ) -> ::c_int; pthread_rwlockattr_setpshared( attr: *mut pthread_rwlockattr_t, val: ::c_int, ) -> ::c_int1490 pub fn pthread_rwlockattr_setpshared( 1491 attr: *mut pthread_rwlockattr_t, 1492 val: ::c_int, 1493 ) -> ::c_int; pthread_set_name_np(tid: ::pthread_t, name: *const ::c_char)1494 pub fn pthread_set_name_np(tid: ::pthread_t, name: *const ::c_char); ptrace( request: ::c_int, pid: ::pid_t, addr: *mut ::c_char, data: ::c_int, ) -> ::c_int1495 pub fn ptrace( 1496 request: ::c_int, 1497 pid: ::pid_t, 1498 addr: *mut ::c_char, 1499 data: ::c_int, 1500 ) -> ::c_int; pututxline(ut: *const utmpx) -> *mut utmpx1501 pub fn pututxline(ut: *const utmpx) -> *mut utmpx; pwritev( fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t, ) -> ::ssize_t1502 pub fn pwritev( 1503 fd: ::c_int, 1504 iov: *const ::iovec, 1505 iovcnt: ::c_int, 1506 offset: ::off_t, 1507 ) -> ::ssize_t; querylocale(mask: ::c_int, loc: ::locale_t) -> *const ::c_char1508 pub fn querylocale(mask: ::c_int, loc: ::locale_t) -> *const ::c_char; rtprio( function: ::c_int, pid: ::pid_t, rtp: *mut rtprio, ) -> ::c_int1509 pub fn rtprio( 1510 function: ::c_int, 1511 pid: ::pid_t, 1512 rtp: *mut rtprio, 1513 ) -> ::c_int; sched_getscheduler(pid: ::pid_t) -> ::c_int1514 pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int; sched_setscheduler( pid: ::pid_t, policy: ::c_int, param: *const ::sched_param, ) -> ::c_int1515 pub fn sched_setscheduler( 1516 pid: ::pid_t, 1517 policy: ::c_int, 1518 param: *const ::sched_param, 1519 ) -> ::c_int; sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int1520 pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int; sem_timedwait( sem: *mut sem_t, abstime: *const ::timespec, ) -> ::c_int1521 pub fn sem_timedwait( 1522 sem: *mut sem_t, 1523 abstime: *const ::timespec, 1524 ) -> ::c_int; sendfile( fd: ::c_int, s: ::c_int, offset: ::off_t, nbytes: ::size_t, hdtr: *mut ::sf_hdtr, sbytes: *mut ::off_t, flags: ::c_int, ) -> ::c_int1525 pub fn sendfile( 1526 fd: ::c_int, 1527 s: ::c_int, 1528 offset: ::off_t, 1529 nbytes: ::size_t, 1530 hdtr: *mut ::sf_hdtr, 1531 sbytes: *mut ::off_t, 1532 flags: ::c_int, 1533 ) -> ::c_int; setdomainname(name: *const ::c_char, len: ::c_int) -> ::c_int1534 pub fn setdomainname(name: *const ::c_char, len: ::c_int) -> ::c_int; sethostname(name: *const ::c_char, len: ::c_int) -> ::c_int1535 pub fn sethostname(name: *const ::c_char, len: ::c_int) -> ::c_int; setpriority(which: ::c_int, who: ::c_int, prio: ::c_int) -> ::c_int1536 pub fn setpriority(which: ::c_int, who: ::c_int, prio: ::c_int) 1537 -> ::c_int; setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int1538 pub fn setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int; setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int1539 pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int; settimeofday( tv: *const ::timeval, tz: *const ::timezone, ) -> ::c_int1540 pub fn settimeofday( 1541 tv: *const ::timeval, 1542 tz: *const ::timezone, 1543 ) -> ::c_int; setutxent()1544 pub fn setutxent(); shm_open( name: *const ::c_char, oflag: ::c_int, mode: ::mode_t, ) -> ::c_int1545 pub fn shm_open( 1546 name: *const ::c_char, 1547 oflag: ::c_int, 1548 mode: ::mode_t, 1549 ) -> ::c_int; sigtimedwait( set: *const sigset_t, info: *mut siginfo_t, timeout: *const ::timespec, ) -> ::c_int1550 pub fn sigtimedwait( 1551 set: *const sigset_t, 1552 info: *mut siginfo_t, 1553 timeout: *const ::timespec, 1554 ) -> ::c_int; sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int1555 pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int; sysctl( name: *const ::c_int, namelen: ::c_uint, oldp: *mut ::c_void, oldlenp: *mut ::size_t, newp: *const ::c_void, newlen: ::size_t, ) -> ::c_int1556 pub fn sysctl( 1557 name: *const ::c_int, 1558 namelen: ::c_uint, 1559 oldp: *mut ::c_void, 1560 oldlenp: *mut ::size_t, 1561 newp: *const ::c_void, 1562 newlen: ::size_t, 1563 ) -> ::c_int; sysctlbyname( name: *const ::c_char, oldp: *mut ::c_void, oldlenp: *mut ::size_t, newp: *const ::c_void, newlen: ::size_t, ) -> ::c_int1564 pub fn sysctlbyname( 1565 name: *const ::c_char, 1566 oldp: *mut ::c_void, 1567 oldlenp: *mut ::size_t, 1568 newp: *const ::c_void, 1569 newlen: ::size_t, 1570 ) -> ::c_int; sysctlnametomib( name: *const ::c_char, mibp: *mut ::c_int, sizep: *mut ::size_t, ) -> ::c_int1571 pub fn sysctlnametomib( 1572 name: *const ::c_char, 1573 mibp: *mut ::c_int, 1574 sizep: *mut ::size_t, 1575 ) -> ::c_int; uselocale(loc: ::locale_t) -> ::locale_t1576 pub fn uselocale(loc: ::locale_t) -> ::locale_t; utimensat( dirfd: ::c_int, path: *const ::c_char, times: *const ::timespec, flag: ::c_int, ) -> ::c_int1577 pub fn utimensat( 1578 dirfd: ::c_int, 1579 path: *const ::c_char, 1580 times: *const ::timespec, 1581 flag: ::c_int, 1582 ) -> ::c_int; 1583 ntp_adjtime(buf: *mut timex) -> ::c_int1584 pub fn ntp_adjtime(buf: *mut timex) -> ::c_int; ntp_gettime(buf: *mut ntptimeval) -> ::c_int1585 pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int; 1586 1587 // #include <link.h> dl_iterate_phdr( callback: ::Option< unsafe extern "C" fn( info: *mut dl_phdr_info, size: usize, data: *mut ::c_void, ) -> ::c_int, >, data: *mut ::c_void, ) -> ::c_int1588 pub fn dl_iterate_phdr( 1589 callback: ::Option< 1590 unsafe extern "C" fn( 1591 info: *mut dl_phdr_info, 1592 size: usize, 1593 data: *mut ::c_void, 1594 ) -> ::c_int, 1595 >, 1596 data: *mut ::c_void, 1597 ) -> ::c_int; 1598 } 1599 1600 #[link(name = "rt")] 1601 extern "C" { aio_read(aiocbp: *mut aiocb) -> ::c_int1602 pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int; aio_write(aiocbp: *mut aiocb) -> ::c_int1603 pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int; aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int1604 pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int; aio_error(aiocbp: *const aiocb) -> ::c_int1605 pub fn aio_error(aiocbp: *const aiocb) -> ::c_int; aio_return(aiocbp: *mut aiocb) -> ::ssize_t1606 pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t; aio_suspend( aiocb_list: *const *const aiocb, nitems: ::c_int, timeout: *const ::timespec, ) -> ::c_int1607 pub fn aio_suspend( 1608 aiocb_list: *const *const aiocb, 1609 nitems: ::c_int, 1610 timeout: *const ::timespec, 1611 ) -> ::c_int; aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int1612 pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int; mq_close(mqd: ::mqd_t) -> ::c_int1613 pub fn mq_close(mqd: ::mqd_t) -> ::c_int; mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int1614 pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int; mq_notify(mqd: ::mqd_t, notification: *const ::sigevent) -> ::c_int1615 pub fn mq_notify(mqd: ::mqd_t, notification: *const ::sigevent) 1616 -> ::c_int; mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t1617 pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t; mq_receive( mqd: ::mqd_t, msg_ptr: *mut ::c_char, msg_len: ::size_t, msg_prio: *mut ::c_uint, ) -> ::ssize_t1618 pub fn mq_receive( 1619 mqd: ::mqd_t, 1620 msg_ptr: *mut ::c_char, 1621 msg_len: ::size_t, 1622 msg_prio: *mut ::c_uint, 1623 ) -> ::ssize_t; mq_send( mqd: ::mqd_t, msg_ptr: *const ::c_char, msg_len: ::size_t, msg_prio: ::c_uint, ) -> ::c_int1624 pub fn mq_send( 1625 mqd: ::mqd_t, 1626 msg_ptr: *const ::c_char, 1627 msg_len: ::size_t, 1628 msg_prio: ::c_uint, 1629 ) -> ::c_int; mq_setattr( mqd: ::mqd_t, newattr: *const ::mq_attr, oldattr: *mut ::mq_attr, ) -> ::c_int1630 pub fn mq_setattr( 1631 mqd: ::mqd_t, 1632 newattr: *const ::mq_attr, 1633 oldattr: *mut ::mq_attr, 1634 ) -> ::c_int; mq_timedreceive( mqd: ::mqd_t, msg_ptr: *mut ::c_char, msg_len: ::size_t, msg_prio: *mut ::c_uint, abs_timeout: *const ::timespec, ) -> ::ssize_t1635 pub fn mq_timedreceive( 1636 mqd: ::mqd_t, 1637 msg_ptr: *mut ::c_char, 1638 msg_len: ::size_t, 1639 msg_prio: *mut ::c_uint, 1640 abs_timeout: *const ::timespec, 1641 ) -> ::ssize_t; mq_timedsend( mqd: ::mqd_t, msg_ptr: *const ::c_char, msg_len: ::size_t, msg_prio: ::c_uint, abs_timeout: *const ::timespec, ) -> ::c_int1642 pub fn mq_timedsend( 1643 mqd: ::mqd_t, 1644 msg_ptr: *const ::c_char, 1645 msg_len: ::size_t, 1646 msg_prio: ::c_uint, 1647 abs_timeout: *const ::timespec, 1648 ) -> ::c_int; mq_unlink(name: *const ::c_char) -> ::c_int1649 pub fn mq_unlink(name: *const ::c_char) -> ::c_int; 1650 } 1651 1652 #[link(name = "util")] 1653 extern "C" { openpty( amaster: *mut ::c_int, aslave: *mut ::c_int, name: *mut ::c_char, termp: *mut termios, winp: *mut ::winsize, ) -> ::c_int1654 pub fn openpty( 1655 amaster: *mut ::c_int, 1656 aslave: *mut ::c_int, 1657 name: *mut ::c_char, 1658 termp: *mut termios, 1659 winp: *mut ::winsize, 1660 ) -> ::c_int; forkpty( amaster: *mut ::c_int, name: *mut ::c_char, termp: *mut termios, winp: *mut ::winsize, ) -> ::pid_t1661 pub fn forkpty( 1662 amaster: *mut ::c_int, 1663 name: *mut ::c_char, 1664 termp: *mut termios, 1665 winp: *mut ::winsize, 1666 ) -> ::pid_t; login_tty(fd: ::c_int) -> ::c_int1667 pub fn login_tty(fd: ::c_int) -> ::c_int; 1668 } 1669 1670 cfg_if! { 1671 if #[cfg(target_os = "freebsd")] { 1672 mod freebsd; 1673 pub use self::freebsd::*; 1674 } else if #[cfg(target_os = "dragonfly")] { 1675 mod dragonfly; 1676 pub use self::dragonfly::*; 1677 } else { 1678 // ... 1679 } 1680 } 1681