1 pub type dev_t = u32; 2 pub type c_char = i8; 3 pub type wchar_t = i32; 4 pub type clock_t = u64; 5 pub type ino_t = u64; 6 pub type lwpid_t = i32; 7 pub type nlink_t = u32; 8 pub type blksize_t = i64; 9 pub type clockid_t = ::c_ulong; 10 11 pub type c_long = i64; 12 pub type c_ulong = u64; 13 pub type time_t = i64; 14 pub type suseconds_t = i64; 15 16 pub type uuid_t = ::uuid; 17 18 pub type fsblkcnt_t = u64; 19 pub type fsfilcnt_t = u64; 20 pub type idtype_t = ::c_uint; 21 pub type shmatt_t = ::c_uint; 22 23 pub type mqd_t = ::c_int; 24 pub type sem_t = *mut sem; 25 26 pub type cpuset_t = cpumask_t; 27 pub type cpu_set_t = cpumask_t; 28 29 pub type register_t = ::c_long; 30 pub type umtx_t = ::c_int; 31 pub type pthread_barrierattr_t = ::c_int; 32 pub type pthread_barrier_t = ::uintptr_t; 33 pub type pthread_spinlock_t = ::uintptr_t; 34 35 #[cfg_attr(feature = "extra_traits", derive(Debug))] 36 pub enum sem {} 37 impl ::Copy for sem {} 38 impl ::Clone for sem { clone(&self) -> sem39 fn clone(&self) -> sem { 40 *self 41 } 42 } 43 44 s! { 45 pub struct kevent { 46 pub ident: ::uintptr_t, 47 pub filter: ::c_short, 48 pub flags: ::c_ushort, 49 pub fflags: ::c_uint, 50 pub data: ::intptr_t, 51 pub udata: *mut ::c_void, 52 } 53 54 pub struct exit_status { 55 pub e_termination: u16, 56 pub e_exit: u16 57 } 58 59 pub struct aiocb { 60 pub aio_fildes: ::c_int, 61 pub aio_offset: ::off_t, 62 pub aio_buf: *mut ::c_void, 63 pub aio_nbytes: ::size_t, 64 pub aio_sigevent: sigevent, 65 pub aio_lio_opcode: ::c_int, 66 pub aio_reqprio: ::c_int, 67 _aio_val: ::c_int, 68 _aio_err: ::c_int 69 } 70 71 pub struct uuid { 72 pub time_low: u32, 73 pub time_mid: u16, 74 pub time_hi_and_version: u16, 75 pub clock_seq_hi_and_reserved: u8, 76 pub clock_seq_low: u8, 77 pub node: [u8; 6], 78 } 79 80 pub struct mq_attr { 81 pub mq_flags: ::c_long, 82 pub mq_maxmsg: ::c_long, 83 pub mq_msgsize: ::c_long, 84 pub mq_curmsgs: ::c_long, 85 } 86 87 pub struct statvfs { 88 pub f_bsize: ::c_ulong, 89 pub f_frsize: ::c_ulong, 90 pub f_blocks: ::fsblkcnt_t, 91 pub f_bfree: ::fsblkcnt_t, 92 pub f_bavail: ::fsblkcnt_t, 93 pub f_files: ::fsfilcnt_t, 94 pub f_ffree: ::fsfilcnt_t, 95 pub f_favail: ::fsfilcnt_t, 96 pub f_fsid: ::c_ulong, 97 pub f_flag: ::c_ulong, 98 pub f_namemax: ::c_ulong, 99 pub f_owner: ::uid_t, 100 pub f_type: ::c_uint, 101 pub f_syncreads: u64, 102 pub f_syncwrites: u64, 103 pub f_asyncreads: u64, 104 pub f_asyncwrites: u64, 105 pub f_fsid_uuid: ::uuid_t, 106 pub f_uid_uuid: ::uuid_t, 107 } 108 109 #[deprecated( 110 since = "0.2.107", 111 note = "stat.st_blksize is an i64 and stat.st_qspare1 is replaced with \ 112 stat.st_blksize in DragonFly 5.8" 113 )] 114 pub struct stat { 115 pub st_ino: ::ino_t, 116 pub st_nlink: ::nlink_t, 117 pub st_dev: ::dev_t, 118 pub st_mode: ::mode_t, 119 pub st_padding1: u16, 120 pub st_uid: ::uid_t, 121 pub st_gid: ::gid_t, 122 pub st_rdev: ::dev_t, 123 pub st_atime: ::time_t, 124 pub st_atime_nsec: ::c_long, 125 pub st_mtime: ::time_t, 126 pub st_mtime_nsec: ::c_long, 127 pub st_ctime: ::time_t, 128 pub st_ctime_nsec: ::c_long, 129 pub st_size: ::off_t, 130 pub st_blocks: i64, 131 pub st_blksize: u32, 132 pub st_flags: u32, 133 pub st_gen: u32, 134 pub st_lspare: i32, 135 pub st_qspare1: i64, 136 pub st_qspare2: i64, 137 } 138 139 pub struct if_data { 140 pub ifi_type: ::c_uchar, 141 pub ifi_physical: ::c_uchar, 142 pub ifi_addrlen: ::c_uchar, 143 pub ifi_hdrlen: ::c_uchar, 144 pub ifi_recvquota: ::c_uchar, 145 pub ifi_xmitquota: ::c_uchar, 146 pub ifi_mtu: ::c_ulong, 147 pub ifi_metric: ::c_ulong, 148 pub ifi_link_state: ::c_ulong, 149 pub ifi_baudrate: u64, 150 pub ifi_ipackets: ::c_ulong, 151 pub ifi_ierrors: ::c_ulong, 152 pub ifi_opackets: ::c_ulong, 153 pub ifi_oerrors: ::c_ulong, 154 pub ifi_collisions: ::c_ulong, 155 pub ifi_ibytes: ::c_ulong, 156 pub ifi_obytes: ::c_ulong, 157 pub ifi_imcasts: ::c_ulong, 158 pub ifi_omcasts: ::c_ulong, 159 pub ifi_iqdrops: ::c_ulong, 160 pub ifi_noproto: ::c_ulong, 161 pub ifi_hwassist: ::c_ulong, 162 pub ifi_oqdrops: ::c_ulong, 163 pub ifi_lastchange: ::timeval, 164 } 165 166 pub struct if_msghdr { 167 pub ifm_msglen: ::c_ushort, 168 pub ifm_version: ::c_uchar, 169 pub ifm_type: ::c_uchar, 170 pub ifm_addrs: ::c_int, 171 pub ifm_flags: ::c_int, 172 pub ifm_index: ::c_ushort, 173 pub ifm_data: if_data, 174 } 175 176 pub struct sockaddr_dl { 177 pub sdl_len: ::c_uchar, 178 pub sdl_family: ::c_uchar, 179 pub sdl_index: ::c_ushort, 180 pub sdl_type: ::c_uchar, 181 pub sdl_nlen: ::c_uchar, 182 pub sdl_alen: ::c_uchar, 183 pub sdl_slen: ::c_uchar, 184 pub sdl_data: [::c_char; 12], 185 pub sdl_rcf: ::c_ushort, 186 pub sdl_route: [::c_ushort; 16], 187 } 188 189 pub struct xucred { 190 pub cr_version: ::c_uint, 191 pub cr_uid: ::uid_t, 192 pub cr_ngroups: ::c_short, 193 pub cr_groups: [::gid_t; 16], 194 __cr_unused1: *mut ::c_void, 195 } 196 197 pub struct stack_t { 198 pub ss_sp: *mut ::c_void, 199 pub ss_size: ::size_t, 200 pub ss_flags: ::c_int, 201 } 202 203 pub struct cpumask_t { 204 ary: [u64; 4], 205 } 206 207 pub struct shmid_ds { 208 pub shm_perm: ::ipc_perm, 209 pub shm_segsz: ::size_t, 210 pub shm_lpid: ::pid_t, 211 pub shm_cpid: ::pid_t, 212 pub shm_nattch: ::shmatt_t, 213 pub shm_atime: ::time_t, 214 pub shm_dtime: ::time_t, 215 pub shm_ctime: ::time_t, 216 shm_internal: *mut ::c_void, 217 } 218 219 pub struct kinfo_file { 220 pub f_size: ::size_t, 221 pub f_pid: ::pid_t, 222 pub f_uid: ::uid_t, 223 pub f_fd: ::c_int, 224 pub f_file: *mut ::c_void, 225 pub f_type: ::c_short, 226 pub f_count: ::c_int, 227 pub f_msgcount: ::c_int, 228 pub f_offset: ::off_t, 229 pub f_data: *mut ::c_void, 230 pub f_flag: ::c_uint, 231 } 232 233 pub struct kinfo_cputime { 234 pub cp_user: u64, 235 pub cp_nice: u64, 236 pub cp_sys: u64, 237 pub cp_intr: u64, 238 pub cp_idel: u64, 239 cp_unused01: u64, 240 cp_unused02: u64, 241 pub cp_sample_pc: u64, 242 pub cp_sample_sp: u64, 243 pub cp_msg: [::c_char; 32], 244 } 245 246 pub struct cpuctl_msr_args_t { 247 pub msr: ::c_int, 248 pub data: u64, 249 } 250 251 pub struct cpuctl_cpuid_args_t { 252 pub level: ::c_int, 253 pub data: [u32; 4], 254 } 255 256 pub struct cpuctl_cpuid_count_args_t { 257 pub level: ::c_int, 258 pub level_type: ::c_int, 259 pub data: [u32; 4], 260 } 261 262 pub struct cpuctl_update_args_t { 263 pub data: *mut ::c_void, 264 pub size: ::size_t, 265 } 266 } 267 268 s_no_extra_traits! { 269 pub struct utmpx { 270 pub ut_name: [::c_char; 32], 271 pub ut_id: [::c_char; 4], 272 273 pub ut_line: [::c_char; 32], 274 pub ut_host: [::c_char; 256], 275 276 pub ut_unused: [u8; 16], 277 pub ut_session: u16, 278 pub ut_type: u16, 279 pub ut_pid: ::pid_t, 280 ut_exit: exit_status, 281 ut_ss: ::sockaddr_storage, 282 pub ut_tv: ::timeval, 283 pub ut_unused2: [u8; 16], 284 } 285 286 pub struct lastlogx { 287 pub ll_tv: ::timeval, 288 pub ll_line: [::c_char; _UTX_LINESIZE], 289 pub ll_host: [::c_char; _UTX_HOSTSIZE], 290 pub ll_ss: ::sockaddr_storage, 291 } 292 293 pub struct dirent { 294 pub d_fileno: ::ino_t, 295 pub d_namlen: u16, 296 pub d_type: u8, 297 __unused1: u8, 298 __unused2: u32, 299 pub d_name: [::c_char; 256], 300 } 301 302 pub struct statfs { 303 __spare2: ::c_long, 304 pub f_bsize: ::c_long, 305 pub f_iosize: ::c_long, 306 pub f_blocks: ::c_long, 307 pub f_bfree: ::c_long, 308 pub f_bavail: ::c_long, 309 pub f_files: ::c_long, 310 pub f_ffree: ::c_long, 311 pub f_fsid: ::fsid_t, 312 pub f_owner: ::uid_t, 313 pub f_type: ::c_int, 314 pub f_flags: ::c_int, 315 pub f_syncwrites: ::c_long, 316 pub f_asyncwrites: ::c_long, 317 pub f_fstypename: [::c_char; 16], 318 pub f_mntonname: [::c_char; 80], 319 pub f_syncreads: ::c_long, 320 pub f_asyncreads: ::c_long, 321 __spares1: ::c_short, 322 pub f_mntfromname: [::c_char; 80], 323 __spares2: ::c_short, 324 __spare: [::c_long; 2], 325 } 326 327 pub struct sigevent { 328 pub sigev_notify: ::c_int, 329 // The union is 8-byte in size, so it is aligned at a 8-byte offset. 330 #[cfg(target_pointer_width = "64")] 331 __unused1: ::c_int, 332 pub sigev_signo: ::c_int, //actually a union 333 // pad the union 334 #[cfg(target_pointer_width = "64")] 335 __unused2: ::c_int, 336 pub sigev_value: ::sigval, 337 __unused3: *mut ::c_void //actually a function pointer 338 } 339 340 pub struct mcontext_t { 341 pub mc_onstack: register_t, 342 pub mc_rdi: register_t, 343 pub mc_rsi: register_t, 344 pub mc_rdx: register_t, 345 pub mc_rcx: register_t, 346 pub mc_r8: register_t, 347 pub mc_r9: register_t, 348 pub mc_rax: register_t, 349 pub mc_rbx: register_t, 350 pub mc_rbp: register_t, 351 pub mc_r10: register_t, 352 pub mc_r11: register_t, 353 pub mc_r12: register_t, 354 pub mc_r13: register_t, 355 pub mc_r14: register_t, 356 pub mc_r15: register_t, 357 pub mc_xflags: register_t, 358 pub mc_trapno: register_t, 359 pub mc_addr: register_t, 360 pub mc_flags: register_t, 361 pub mc_err: register_t, 362 pub mc_rip: register_t, 363 pub mc_cs: register_t, 364 pub mc_rflags: register_t, 365 pub mc_rsp: register_t, 366 pub mc_ss: register_t, 367 pub mc_len: ::c_uint, 368 pub mc_fpformat: ::c_uint, 369 pub mc_ownedfp: ::c_uint, 370 __reserved: ::c_uint, 371 __unused: [::c_uint; 8], 372 pub mc_fpregs: [[::c_uint; 8]; 32], 373 } 374 375 pub struct ucontext_t { 376 pub uc_sigmask: ::sigset_t, 377 pub uc_mcontext: mcontext_t, 378 pub uc_link: *mut ucontext_t, 379 pub uc_stack: stack_t, 380 pub uc_cofunc: ::Option<unsafe extern "C" fn(uc: *mut ucontext_t, arg: *mut ::c_void)>, 381 pub uc_arg: *mut ::c_void, 382 __pad: [::c_int; 4], 383 } 384 } 385 386 cfg_if! { 387 if #[cfg(feature = "extra_traits")] { 388 impl PartialEq for utmpx { 389 fn eq(&self, other: &utmpx) -> bool { 390 self.ut_name == other.ut_name 391 && self.ut_id == other.ut_id 392 && self.ut_line == other.ut_line 393 && self 394 .ut_host 395 .iter() 396 .zip(other.ut_host.iter()) 397 .all(|(a,b)| a == b) 398 && self.ut_unused == other.ut_unused 399 && self.ut_session == other.ut_session 400 && self.ut_type == other.ut_type 401 && self.ut_pid == other.ut_pid 402 && self.ut_exit == other.ut_exit 403 && self.ut_ss == other.ut_ss 404 && self.ut_tv == other.ut_tv 405 && self.ut_unused2 == other.ut_unused2 406 } 407 } 408 impl Eq for utmpx {} 409 impl ::fmt::Debug for utmpx { 410 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 411 f.debug_struct("utmpx") 412 .field("ut_name", &self.ut_name) 413 .field("ut_id", &self.ut_id) 414 .field("ut_line", &self.ut_line) 415 // FIXME: .field("ut_host", &self.ut_host) 416 .field("ut_unused", &self.ut_unused) 417 .field("ut_session", &self.ut_session) 418 .field("ut_type", &self.ut_type) 419 .field("ut_pid", &self.ut_pid) 420 .field("ut_exit", &self.ut_exit) 421 .field("ut_ss", &self.ut_ss) 422 .field("ut_tv", &self.ut_tv) 423 .field("ut_unused2", &self.ut_unused2) 424 .finish() 425 } 426 } 427 impl ::hash::Hash for utmpx { 428 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 429 self.ut_name.hash(state); 430 self.ut_id.hash(state); 431 self.ut_line.hash(state); 432 self.ut_host.hash(state); 433 self.ut_unused.hash(state); 434 self.ut_session.hash(state); 435 self.ut_type.hash(state); 436 self.ut_pid.hash(state); 437 self.ut_exit.hash(state); 438 self.ut_ss.hash(state); 439 self.ut_tv.hash(state); 440 self.ut_unused2.hash(state); 441 } 442 } 443 impl PartialEq for lastlogx { 444 fn eq(&self, other: &lastlogx) -> bool { 445 self.ll_tv == other.ll_tv 446 && self.ll_line == other.ll_line 447 && self.ll_host == other.ll_host 448 && self.ll_ss == other.ll_ss 449 } 450 } 451 impl Eq for lastlogx {} 452 impl ::fmt::Debug for lastlogx { 453 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 454 f.debug_struct("lastlogx") 455 .field("ll_tv", &self.ll_tv) 456 .field("ll_line", &self.ll_line) 457 .field("ll_host", &self.ll_host) 458 .field("ll_ss", &self.ll_ss) 459 .finish() 460 } 461 } 462 impl ::hash::Hash for lastlogx { 463 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 464 self.ll_tv.hash(state); 465 self.ll_line.hash(state); 466 self.ll_host.hash(state); 467 self.ll_ss.hash(state); 468 } 469 } 470 471 impl PartialEq for dirent { 472 fn eq(&self, other: &dirent) -> bool { 473 self.d_fileno == other.d_fileno 474 && self.d_namlen == other.d_namlen 475 && self.d_type == other.d_type 476 // Ignore __unused1 477 // Ignore __unused2 478 && self 479 .d_name 480 .iter() 481 .zip(other.d_name.iter()) 482 .all(|(a,b)| a == b) 483 } 484 } 485 impl Eq for dirent {} 486 impl ::fmt::Debug for dirent { 487 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 488 f.debug_struct("dirent") 489 .field("d_fileno", &self.d_fileno) 490 .field("d_namlen", &self.d_namlen) 491 .field("d_type", &self.d_type) 492 // Ignore __unused1 493 // Ignore __unused2 494 // FIXME: .field("d_name", &self.d_name) 495 .finish() 496 } 497 } 498 impl ::hash::Hash for dirent { 499 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 500 self.d_fileno.hash(state); 501 self.d_namlen.hash(state); 502 self.d_type.hash(state); 503 // Ignore __unused1 504 // Ignore __unused2 505 self.d_name.hash(state); 506 } 507 } 508 509 impl PartialEq for statfs { 510 fn eq(&self, other: &statfs) -> bool { 511 self.f_bsize == other.f_bsize 512 && self.f_iosize == other.f_iosize 513 && self.f_blocks == other.f_blocks 514 && self.f_bfree == other.f_bfree 515 && self.f_bavail == other.f_bavail 516 && self.f_files == other.f_files 517 && self.f_ffree == other.f_ffree 518 && self.f_fsid == other.f_fsid 519 && self.f_owner == other.f_owner 520 && self.f_type == other.f_type 521 && self.f_flags == other.f_flags 522 && self.f_syncwrites == other.f_syncwrites 523 && self.f_asyncwrites == other.f_asyncwrites 524 && self.f_fstypename == other.f_fstypename 525 && self 526 .f_mntonname 527 .iter() 528 .zip(other.f_mntonname.iter()) 529 .all(|(a,b)| a == b) 530 && self.f_syncreads == other.f_syncreads 531 && self.f_asyncreads == other.f_asyncreads 532 && self 533 .f_mntfromname 534 .iter() 535 .zip(other.f_mntfromname.iter()) 536 .all(|(a,b)| a == b) 537 } 538 } 539 impl Eq for statfs {} 540 impl ::fmt::Debug for statfs { 541 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 542 f.debug_struct("statfs") 543 .field("f_bsize", &self.f_bsize) 544 .field("f_iosize", &self.f_iosize) 545 .field("f_blocks", &self.f_blocks) 546 .field("f_bfree", &self.f_bfree) 547 .field("f_bavail", &self.f_bavail) 548 .field("f_files", &self.f_files) 549 .field("f_ffree", &self.f_ffree) 550 .field("f_fsid", &self.f_fsid) 551 .field("f_owner", &self.f_owner) 552 .field("f_type", &self.f_type) 553 .field("f_flags", &self.f_flags) 554 .field("f_syncwrites", &self.f_syncwrites) 555 .field("f_asyncwrites", &self.f_asyncwrites) 556 // FIXME: .field("f_mntonname", &self.f_mntonname) 557 .field("f_syncreads", &self.f_syncreads) 558 .field("f_asyncreads", &self.f_asyncreads) 559 // FIXME: .field("f_mntfromname", &self.f_mntfromname) 560 .finish() 561 } 562 } 563 impl ::hash::Hash for statfs { 564 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 565 self.f_bsize.hash(state); 566 self.f_iosize.hash(state); 567 self.f_blocks.hash(state); 568 self.f_bfree.hash(state); 569 self.f_bavail.hash(state); 570 self.f_files.hash(state); 571 self.f_ffree.hash(state); 572 self.f_fsid.hash(state); 573 self.f_owner.hash(state); 574 self.f_type.hash(state); 575 self.f_flags.hash(state); 576 self.f_syncwrites.hash(state); 577 self.f_asyncwrites.hash(state); 578 self.f_fstypename.hash(state); 579 self.f_mntonname.hash(state); 580 self.f_syncreads.hash(state); 581 self.f_asyncreads.hash(state); 582 self.f_mntfromname.hash(state); 583 } 584 } 585 586 impl PartialEq for sigevent { 587 fn eq(&self, other: &sigevent) -> bool { 588 self.sigev_notify == other.sigev_notify 589 && self.sigev_signo == other.sigev_signo 590 && self.sigev_value == other.sigev_value 591 } 592 } 593 impl Eq for sigevent {} 594 impl ::fmt::Debug for sigevent { 595 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 596 f.debug_struct("sigevent") 597 .field("sigev_notify", &self.sigev_notify) 598 .field("sigev_signo", &self.sigev_signo) 599 .field("sigev_value", &self.sigev_value) 600 .finish() 601 } 602 } 603 impl ::hash::Hash for sigevent { 604 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 605 self.sigev_notify.hash(state); 606 self.sigev_signo.hash(state); 607 self.sigev_value.hash(state); 608 } 609 } 610 impl PartialEq for mcontext_t { 611 fn eq(&self, other: &mcontext_t) -> bool { 612 self.mc_onstack == other.mc_onstack && 613 self.mc_rdi == other.mc_rdi && 614 self.mc_rsi == other.mc_rsi && 615 self.mc_rdx == other.mc_rdx && 616 self.mc_rcx == other.mc_rcx && 617 self.mc_r8 == other.mc_r8 && 618 self.mc_r9 == other.mc_r9 && 619 self.mc_rax == other.mc_rax && 620 self.mc_rbx == other.mc_rbx && 621 self.mc_rbp == other.mc_rbp && 622 self.mc_r10 == other.mc_r10 && 623 self.mc_r11 == other.mc_r11 && 624 self.mc_r12 == other.mc_r12 && 625 self.mc_r13 == other.mc_r13 && 626 self.mc_r14 == other.mc_r14 && 627 self.mc_r15 == other.mc_r15 && 628 self.mc_xflags == other.mc_xflags && 629 self.mc_trapno == other.mc_trapno && 630 self.mc_addr == other.mc_addr && 631 self.mc_flags == other.mc_flags && 632 self.mc_err == other.mc_err && 633 self.mc_rip == other.mc_rip && 634 self.mc_cs == other.mc_cs && 635 self.mc_rflags == other.mc_rflags && 636 self.mc_rsp == other.mc_rsp && 637 self.mc_ss == other.mc_ss && 638 self.mc_len == other.mc_len && 639 self.mc_fpformat == other.mc_fpformat && 640 self.mc_ownedfp == other.mc_ownedfp && 641 self.mc_fpregs.iter().zip(other.mc_fpregs.iter()). 642 all(|(a, b)| a == b) 643 } 644 } 645 impl Eq for mcontext_t {} 646 impl ::fmt::Debug for mcontext_t { 647 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 648 f.debug_struct("mcontext_t") 649 .field("mc_onstack", &self.mc_onstack) 650 .field("mc_rdi", &self.mc_rdi) 651 .field("mc_rsi", &self.mc_rsi) 652 .field("mc_rdx", &self.mc_rdx) 653 .field("mc_rcx", &self.mc_rcx) 654 .field("mc_r8", &self.mc_r8) 655 .field("mc_r9", &self.mc_r9) 656 .field("mc_rax", &self.mc_rax) 657 .field("mc_rbx", &self.mc_rbx) 658 .field("mc_rbp", &self.mc_rbp) 659 .field("mc_r10", &self.mc_r10) 660 .field("mc_r11", &self.mc_r11) 661 .field("mc_r12", &self.mc_r12) 662 .field("mc_r13", &self.mc_r13) 663 .field("mc_r14", &self.mc_r14) 664 .field("mc_r15", &self.mc_r15) 665 .field("mc_xflags", &self.mc_xflags) 666 .field("mc_trapno", &self.mc_trapno) 667 .field("mc_addr", &self.mc_addr) 668 .field("mc_flags", &self.mc_flags) 669 .field("mc_err", &self.mc_err) 670 .field("mc_rip", &self.mc_rip) 671 .field("mc_cs", &self.mc_cs) 672 .field("mc_rflags", &self.mc_rflags) 673 .field("mc_rsp", &self.mc_rsp) 674 .field("mc_ss", &self.mc_ss) 675 .field("mc_len", &self.mc_len) 676 .field("mc_fpformat", &self.mc_fpformat) 677 .field("mc_ownedfp", &self.mc_ownedfp) 678 .field("mc_fpregs", &self.mc_fpregs) 679 .finish() 680 } 681 } 682 impl ::hash::Hash for mcontext_t { 683 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 684 self.mc_onstack.hash(state); 685 self.mc_rdi.hash(state); 686 self.mc_rsi.hash(state); 687 self.mc_rdx.hash(state); 688 self.mc_rcx.hash(state); 689 self.mc_r8.hash(state); 690 self.mc_r9.hash(state); 691 self.mc_rax.hash(state); 692 self.mc_rbx.hash(state); 693 self.mc_rbp.hash(state); 694 self.mc_r10.hash(state); 695 self.mc_r11.hash(state); 696 self.mc_r10.hash(state); 697 self.mc_r11.hash(state); 698 self.mc_r12.hash(state); 699 self.mc_r13.hash(state); 700 self.mc_r14.hash(state); 701 self.mc_r15.hash(state); 702 self.mc_xflags.hash(state); 703 self.mc_trapno.hash(state); 704 self.mc_addr.hash(state); 705 self.mc_flags.hash(state); 706 self.mc_err.hash(state); 707 self.mc_rip.hash(state); 708 self.mc_cs.hash(state); 709 self.mc_rflags.hash(state); 710 self.mc_rsp.hash(state); 711 self.mc_ss.hash(state); 712 self.mc_len.hash(state); 713 self.mc_fpformat.hash(state); 714 self.mc_ownedfp.hash(state); 715 self.mc_fpregs.hash(state); 716 } 717 } 718 impl PartialEq for ucontext_t { 719 fn eq(&self, other: &ucontext_t) -> bool { 720 self.uc_sigmask == other.uc_sigmask 721 && self.uc_mcontext == other.uc_mcontext 722 && self.uc_link == other.uc_link 723 && self.uc_stack == other.uc_stack 724 && self.uc_cofunc == other.uc_cofunc 725 && self.uc_arg == other.uc_arg 726 } 727 } 728 impl Eq for ucontext_t {} 729 impl ::fmt::Debug for ucontext_t { 730 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 731 f.debug_struct("ucontext_t") 732 .field("uc_sigmask", &self.uc_sigmask) 733 .field("uc_mcontext", &self.uc_mcontext) 734 .field("uc_link", &self.uc_link) 735 .field("uc_stack", &self.uc_stack) 736 .field("uc_cofunc", &self.uc_cofunc) 737 .field("uc_arg", &self.uc_arg) 738 .finish() 739 } 740 } 741 impl ::hash::Hash for ucontext_t { 742 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 743 self.uc_sigmask.hash(state); 744 self.uc_mcontext.hash(state); 745 self.uc_link.hash(state); 746 self.uc_stack.hash(state); 747 self.uc_cofunc.hash(state); 748 self.uc_arg.hash(state); 749 } 750 } 751 } 752 } 753 754 pub const RAND_MAX: ::c_int = 0x7fff_ffff; 755 pub const PTHREAD_STACK_MIN: ::size_t = 16384; 756 pub const SIGSTKSZ: ::size_t = 40960; 757 pub const SIGCKPT: ::c_int = 33; 758 pub const SIGCKPTEXIT: ::c_int = 34; 759 pub const CKPT_FREEZE: ::c_int = 0x1; 760 pub const CKPT_THAW: ::c_int = 0x2; 761 pub const MADV_INVAL: ::c_int = 10; 762 pub const MADV_SETMAP: ::c_int = 11; 763 pub const O_CLOEXEC: ::c_int = 0x00020000; 764 pub const O_DIRECTORY: ::c_int = 0x08000000; 765 pub const F_GETLK: ::c_int = 7; 766 pub const F_SETLK: ::c_int = 8; 767 pub const F_SETLKW: ::c_int = 9; 768 pub const ENOMEDIUM: ::c_int = 93; 769 pub const EASYNC: ::c_int = 99; 770 pub const ELAST: ::c_int = 99; 771 pub const RLIMIT_POSIXLOCKS: ::c_int = 11; 772 #[deprecated(since = "0.2.64", note = "Not stable across OS versions")] 773 pub const RLIM_NLIMITS: ::rlim_t = 12; 774 775 #[deprecated(since = "0.2.105", note = "Only exists on FreeBSD, not DragonFly BSD")] 776 pub const XU_NGROUPS: ::c_int = 16; 777 778 pub const Q_GETQUOTA: ::c_int = 0x300; 779 pub const Q_SETQUOTA: ::c_int = 0x400; 780 781 pub const CTL_UNSPEC: ::c_int = 0; 782 pub const CTL_KERN: ::c_int = 1; 783 pub const CTL_VM: ::c_int = 2; 784 pub const CTL_VFS: ::c_int = 3; 785 pub const CTL_NET: ::c_int = 4; 786 pub const CTL_DEBUG: ::c_int = 5; 787 pub const CTL_HW: ::c_int = 6; 788 pub const CTL_MACHDEP: ::c_int = 7; 789 pub const CTL_USER: ::c_int = 8; 790 pub const CTL_P1003_1B: ::c_int = 9; 791 pub const CTL_LWKT: ::c_int = 10; 792 pub const CTL_MAXID: ::c_int = 11; 793 pub const KERN_OSTYPE: ::c_int = 1; 794 pub const KERN_OSRELEASE: ::c_int = 2; 795 pub const KERN_OSREV: ::c_int = 3; 796 pub const KERN_VERSION: ::c_int = 4; 797 pub const KERN_MAXVNODES: ::c_int = 5; 798 pub const KERN_MAXPROC: ::c_int = 6; 799 pub const KERN_MAXFILES: ::c_int = 7; 800 pub const KERN_ARGMAX: ::c_int = 8; 801 pub const KERN_SECURELVL: ::c_int = 9; 802 pub const KERN_HOSTNAME: ::c_int = 10; 803 pub const KERN_HOSTID: ::c_int = 11; 804 pub const KERN_CLOCKRATE: ::c_int = 12; 805 pub const KERN_VNODE: ::c_int = 13; 806 pub const KERN_PROC: ::c_int = 14; 807 pub const KERN_FILE: ::c_int = 15; 808 pub const KERN_PROF: ::c_int = 16; 809 pub const KERN_POSIX1: ::c_int = 17; 810 pub const KERN_NGROUPS: ::c_int = 18; 811 pub const KERN_JOB_CONTROL: ::c_int = 19; 812 pub const KERN_SAVED_IDS: ::c_int = 20; 813 pub const KERN_BOOTTIME: ::c_int = 21; 814 pub const KERN_NISDOMAINNAME: ::c_int = 22; 815 pub const KERN_UPDATEINTERVAL: ::c_int = 23; 816 pub const KERN_OSRELDATE: ::c_int = 24; 817 pub const KERN_NTP_PLL: ::c_int = 25; 818 pub const KERN_BOOTFILE: ::c_int = 26; 819 pub const KERN_MAXFILESPERPROC: ::c_int = 27; 820 pub const KERN_MAXPROCPERUID: ::c_int = 28; 821 pub const KERN_DUMPDEV: ::c_int = 29; 822 pub const KERN_IPC: ::c_int = 30; 823 pub const KERN_DUMMY: ::c_int = 31; 824 pub const KERN_PS_STRINGS: ::c_int = 32; 825 pub const KERN_USRSTACK: ::c_int = 33; 826 pub const KERN_LOGSIGEXIT: ::c_int = 34; 827 pub const KERN_IOV_MAX: ::c_int = 35; 828 pub const KERN_MAXPOSIXLOCKSPERUID: ::c_int = 36; 829 pub const KERN_MAXID: ::c_int = 37; 830 pub const KERN_PROC_ALL: ::c_int = 0; 831 pub const KERN_PROC_PID: ::c_int = 1; 832 pub const KERN_PROC_PGRP: ::c_int = 2; 833 pub const KERN_PROC_SESSION: ::c_int = 3; 834 pub const KERN_PROC_TTY: ::c_int = 4; 835 pub const KERN_PROC_UID: ::c_int = 5; 836 pub const KERN_PROC_RUID: ::c_int = 6; 837 pub const KERN_PROC_ARGS: ::c_int = 7; 838 pub const KERN_PROC_CWD: ::c_int = 8; 839 pub const KERN_PROC_PATHNAME: ::c_int = 9; 840 pub const KERN_PROC_FLAGMASK: ::c_int = 0x10; 841 pub const KERN_PROC_FLAG_LWP: ::c_int = 0x10; 842 pub const KIPC_MAXSOCKBUF: ::c_int = 1; 843 pub const KIPC_SOCKBUF_WASTE: ::c_int = 2; 844 pub const KIPC_SOMAXCONN: ::c_int = 3; 845 pub const KIPC_MAX_LINKHDR: ::c_int = 4; 846 pub const KIPC_MAX_PROTOHDR: ::c_int = 5; 847 pub const KIPC_MAX_HDR: ::c_int = 6; 848 pub const KIPC_MAX_DATALEN: ::c_int = 7; 849 pub const KIPC_MBSTAT: ::c_int = 8; 850 pub const KIPC_NMBCLUSTERS: ::c_int = 9; 851 pub const HW_MACHINE: ::c_int = 1; 852 pub const HW_MODEL: ::c_int = 2; 853 pub const HW_NCPU: ::c_int = 3; 854 pub const HW_BYTEORDER: ::c_int = 4; 855 pub const HW_PHYSMEM: ::c_int = 5; 856 pub const HW_USERMEM: ::c_int = 6; 857 pub const HW_PAGESIZE: ::c_int = 7; 858 pub const HW_DISKNAMES: ::c_int = 8; 859 pub const HW_DISKSTATS: ::c_int = 9; 860 pub const HW_FLOATINGPT: ::c_int = 10; 861 pub const HW_MACHINE_ARCH: ::c_int = 11; 862 pub const HW_MACHINE_PLATFORM: ::c_int = 12; 863 pub const HW_SENSORS: ::c_int = 13; 864 pub const HW_MAXID: ::c_int = 14; 865 pub const USER_CS_PATH: ::c_int = 1; 866 pub const USER_BC_BASE_MAX: ::c_int = 2; 867 pub const USER_BC_DIM_MAX: ::c_int = 3; 868 pub const USER_BC_SCALE_MAX: ::c_int = 4; 869 pub const USER_BC_STRING_MAX: ::c_int = 5; 870 pub const USER_COLL_WEIGHTS_MAX: ::c_int = 6; 871 pub const USER_EXPR_NEST_MAX: ::c_int = 7; 872 pub const USER_LINE_MAX: ::c_int = 8; 873 pub const USER_RE_DUP_MAX: ::c_int = 9; 874 pub const USER_POSIX2_VERSION: ::c_int = 10; 875 pub const USER_POSIX2_C_BIND: ::c_int = 11; 876 pub const USER_POSIX2_C_DEV: ::c_int = 12; 877 pub const USER_POSIX2_CHAR_TERM: ::c_int = 13; 878 pub const USER_POSIX2_FORT_DEV: ::c_int = 14; 879 pub const USER_POSIX2_FORT_RUN: ::c_int = 15; 880 pub const USER_POSIX2_LOCALEDEF: ::c_int = 16; 881 pub const USER_POSIX2_SW_DEV: ::c_int = 17; 882 pub const USER_POSIX2_UPE: ::c_int = 18; 883 pub const USER_STREAM_MAX: ::c_int = 19; 884 pub const USER_TZNAME_MAX: ::c_int = 20; 885 pub const USER_MAXID: ::c_int = 21; 886 pub const CTL_P1003_1B_ASYNCHRONOUS_IO: ::c_int = 1; 887 pub const CTL_P1003_1B_MAPPED_FILES: ::c_int = 2; 888 pub const CTL_P1003_1B_MEMLOCK: ::c_int = 3; 889 pub const CTL_P1003_1B_MEMLOCK_RANGE: ::c_int = 4; 890 pub const CTL_P1003_1B_MEMORY_PROTECTION: ::c_int = 5; 891 pub const CTL_P1003_1B_MESSAGE_PASSING: ::c_int = 6; 892 pub const CTL_P1003_1B_PRIORITIZED_IO: ::c_int = 7; 893 pub const CTL_P1003_1B_PRIORITY_SCHEDULING: ::c_int = 8; 894 pub const CTL_P1003_1B_REALTIME_SIGNALS: ::c_int = 9; 895 pub const CTL_P1003_1B_SEMAPHORES: ::c_int = 10; 896 pub const CTL_P1003_1B_FSYNC: ::c_int = 11; 897 pub const CTL_P1003_1B_SHARED_MEMORY_OBJECTS: ::c_int = 12; 898 pub const CTL_P1003_1B_SYNCHRONIZED_IO: ::c_int = 13; 899 pub const CTL_P1003_1B_TIMERS: ::c_int = 14; 900 pub const CTL_P1003_1B_AIO_LISTIO_MAX: ::c_int = 15; 901 pub const CTL_P1003_1B_AIO_MAX: ::c_int = 16; 902 pub const CTL_P1003_1B_AIO_PRIO_DELTA_MAX: ::c_int = 17; 903 pub const CTL_P1003_1B_DELAYTIMER_MAX: ::c_int = 18; 904 pub const CTL_P1003_1B_UNUSED1: ::c_int = 19; 905 pub const CTL_P1003_1B_PAGESIZE: ::c_int = 20; 906 pub const CTL_P1003_1B_RTSIG_MAX: ::c_int = 21; 907 pub const CTL_P1003_1B_SEM_NSEMS_MAX: ::c_int = 22; 908 pub const CTL_P1003_1B_SEM_VALUE_MAX: ::c_int = 23; 909 pub const CTL_P1003_1B_SIGQUEUE_MAX: ::c_int = 24; 910 pub const CTL_P1003_1B_TIMER_MAX: ::c_int = 25; 911 pub const CTL_P1003_1B_MAXID: ::c_int = 26; 912 913 pub const CPUCTL_RSMSR: ::c_int = 0xc0106301; 914 pub const CPUCTL_WRMSR: ::c_int = 0xc0106302; 915 pub const CPUCTL_CPUID: ::c_int = 0xc0106303; 916 pub const CPUCTL_UPDATE: ::c_int = 0xc0106304; 917 pub const CPUCTL_MSRSBIT: ::c_int = 0xc0106305; 918 pub const CPUCTL_MSRCBIT: ::c_int = 0xc0106306; 919 pub const CPUCTL_CPUID_COUNT: ::c_int = 0xc0106307; 920 921 pub const EVFILT_READ: i16 = -1; 922 pub const EVFILT_WRITE: i16 = -2; 923 pub const EVFILT_AIO: i16 = -3; 924 pub const EVFILT_VNODE: i16 = -4; 925 pub const EVFILT_PROC: i16 = -5; 926 pub const EVFILT_SIGNAL: i16 = -6; 927 pub const EVFILT_TIMER: i16 = -7; 928 pub const EVFILT_EXCEPT: i16 = -8; 929 pub const EVFILT_USER: i16 = -9; 930 pub const EVFILT_FS: i16 = -10; 931 932 pub const EV_ADD: u16 = 0x1; 933 pub const EV_DELETE: u16 = 0x2; 934 pub const EV_ENABLE: u16 = 0x4; 935 pub const EV_DISABLE: u16 = 0x8; 936 pub const EV_ONESHOT: u16 = 0x10; 937 pub const EV_CLEAR: u16 = 0x20; 938 pub const EV_RECEIPT: u16 = 0x40; 939 pub const EV_DISPATCH: u16 = 0x80; 940 pub const EV_NODATA: u16 = 0x1000; 941 pub const EV_FLAG1: u16 = 0x2000; 942 pub const EV_ERROR: u16 = 0x4000; 943 pub const EV_EOF: u16 = 0x8000; 944 pub const EV_SYSFLAGS: u16 = 0xf000; 945 946 pub const FIODNAME: ::c_ulong = 0x80106678; 947 #[deprecated( 948 since = "0.2.106", 949 note = "FIODGNAME is not defined on DragonFly BSD. See FIODNAME." 950 )] 951 pub const FIODGNAME: ::c_ulong = 0x80106678; 952 953 pub const NOTE_TRIGGER: u32 = 0x01000000; 954 pub const NOTE_FFNOP: u32 = 0x00000000; 955 pub const NOTE_FFAND: u32 = 0x40000000; 956 pub const NOTE_FFOR: u32 = 0x80000000; 957 pub const NOTE_FFCOPY: u32 = 0xc0000000; 958 pub const NOTE_FFCTRLMASK: u32 = 0xc0000000; 959 pub const NOTE_FFLAGSMASK: u32 = 0x00ffffff; 960 pub const NOTE_LOWAT: u32 = 0x00000001; 961 pub const NOTE_OOB: u32 = 0x00000002; 962 pub const NOTE_DELETE: u32 = 0x00000001; 963 pub const NOTE_WRITE: u32 = 0x00000002; 964 pub const NOTE_EXTEND: u32 = 0x00000004; 965 pub const NOTE_ATTRIB: u32 = 0x00000008; 966 pub const NOTE_LINK: u32 = 0x00000010; 967 pub const NOTE_RENAME: u32 = 0x00000020; 968 pub const NOTE_REVOKE: u32 = 0x00000040; 969 pub const NOTE_EXIT: u32 = 0x80000000; 970 pub const NOTE_FORK: u32 = 0x40000000; 971 pub const NOTE_EXEC: u32 = 0x20000000; 972 pub const NOTE_PDATAMASK: u32 = 0x000fffff; 973 pub const NOTE_PCTRLMASK: u32 = 0xf0000000; 974 pub const NOTE_TRACK: u32 = 0x00000001; 975 pub const NOTE_TRACKERR: u32 = 0x00000002; 976 pub const NOTE_CHILD: u32 = 0x00000004; 977 978 pub const SO_SNDSPACE: ::c_int = 0x100a; 979 pub const SO_CPUHINT: ::c_int = 0x1030; 980 981 pub const PT_FIRSTMACH: ::c_int = 32; 982 983 pub const PROC_REAP_ACQUIRE: ::c_int = 0x0001; 984 pub const PROC_REAP_RELEASE: ::c_int = 0x0002; 985 pub const PROC_REAP_STATUS: ::c_int = 0x0003; 986 pub const PROC_PDEATHSIG_CTL: ::c_int = 0x0004; 987 pub const PROC_PDEATHSIG_STATUS: ::c_int = 0x0005; 988 989 // https://github.com/DragonFlyBSD/DragonFlyBSD/blob/master/sys/net/if.h#L101 990 pub const IFF_UP: ::c_int = 0x1; // interface is up 991 pub const IFF_BROADCAST: ::c_int = 0x2; // broadcast address valid 992 pub const IFF_DEBUG: ::c_int = 0x4; // turn on debugging 993 pub const IFF_LOOPBACK: ::c_int = 0x8; // is a loopback net 994 pub const IFF_POINTOPOINT: ::c_int = 0x10; // interface is point-to-point link 995 pub const IFF_SMART: ::c_int = 0x20; // interface manages own routes 996 pub const IFF_RUNNING: ::c_int = 0x40; // resources allocated 997 pub const IFF_NOARP: ::c_int = 0x80; // no address resolution protocol 998 pub const IFF_PROMISC: ::c_int = 0x100; // receive all packets 999 pub const IFF_ALLMULTI: ::c_int = 0x200; // receive all multicast packets 1000 pub const IFF_OACTIVE_COMPAT: ::c_int = 0x400; // was transmission in progress 1001 pub const IFF_SIMPLEX: ::c_int = 0x800; // can't hear own transmissions 1002 pub const IFF_LINK0: ::c_int = 0x1000; // per link layer defined bit 1003 pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit 1004 pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit 1005 pub const IFF_ALTPHYS: ::c_int = IFF_LINK2; // use alternate physical connection 1006 pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast 1007 // was interface is in polling mode 1008 pub const IFF_POLLING_COMPAT: ::c_int = 0x10000; 1009 pub const IFF_PPROMISC: ::c_int = 0x20000; // user-requested promisc mode 1010 pub const IFF_MONITOR: ::c_int = 0x40000; // user-requested monitor mode 1011 pub const IFF_STATICARP: ::c_int = 0x80000; // static ARP 1012 pub const IFF_NPOLLING: ::c_int = 0x100000; // interface is in polling mode 1013 pub const IFF_IDIRECT: ::c_int = 0x200000; // direct input 1014 1015 // 1016 // sys/netinet/in.h 1017 // Protocols (RFC 1700) 1018 // NOTE: These are in addition to the constants defined in src/unix/mod.rs 1019 1020 // IPPROTO_IP defined in src/unix/mod.rs 1021 /// IP6 hop-by-hop options 1022 pub const IPPROTO_HOPOPTS: ::c_int = 0; 1023 // IPPROTO_ICMP defined in src/unix/mod.rs 1024 /// group mgmt protocol 1025 pub const IPPROTO_IGMP: ::c_int = 2; 1026 /// gateway^2 (deprecated) 1027 pub const IPPROTO_GGP: ::c_int = 3; 1028 /// for compatibility 1029 pub const IPPROTO_IPIP: ::c_int = 4; 1030 // IPPROTO_TCP defined in src/unix/mod.rs 1031 /// Stream protocol II. 1032 pub const IPPROTO_ST: ::c_int = 7; 1033 /// exterior gateway protocol 1034 pub const IPPROTO_EGP: ::c_int = 8; 1035 /// private interior gateway 1036 pub const IPPROTO_PIGP: ::c_int = 9; 1037 /// BBN RCC Monitoring 1038 pub const IPPROTO_RCCMON: ::c_int = 10; 1039 /// network voice protocol 1040 pub const IPPROTO_NVPII: ::c_int = 11; 1041 /// pup 1042 pub const IPPROTO_PUP: ::c_int = 12; 1043 /// Argus 1044 pub const IPPROTO_ARGUS: ::c_int = 13; 1045 /// EMCON 1046 pub const IPPROTO_EMCON: ::c_int = 14; 1047 /// Cross Net Debugger 1048 pub const IPPROTO_XNET: ::c_int = 15; 1049 /// Chaos 1050 pub const IPPROTO_CHAOS: ::c_int = 16; 1051 // IPPROTO_UDP defined in src/unix/mod.rs 1052 /// Multiplexing 1053 pub const IPPROTO_MUX: ::c_int = 18; 1054 /// DCN Measurement Subsystems 1055 pub const IPPROTO_MEAS: ::c_int = 19; 1056 /// Host Monitoring 1057 pub const IPPROTO_HMP: ::c_int = 20; 1058 /// Packet Radio Measurement 1059 pub const IPPROTO_PRM: ::c_int = 21; 1060 /// xns idp 1061 pub const IPPROTO_IDP: ::c_int = 22; 1062 /// Trunk-1 1063 pub const IPPROTO_TRUNK1: ::c_int = 23; 1064 /// Trunk-2 1065 pub const IPPROTO_TRUNK2: ::c_int = 24; 1066 /// Leaf-1 1067 pub const IPPROTO_LEAF1: ::c_int = 25; 1068 /// Leaf-2 1069 pub const IPPROTO_LEAF2: ::c_int = 26; 1070 /// Reliable Data 1071 pub const IPPROTO_RDP: ::c_int = 27; 1072 /// Reliable Transaction 1073 pub const IPPROTO_IRTP: ::c_int = 28; 1074 /// tp-4 w/ class negotiation 1075 pub const IPPROTO_TP: ::c_int = 29; 1076 /// Bulk Data Transfer 1077 pub const IPPROTO_BLT: ::c_int = 30; 1078 /// Network Services 1079 pub const IPPROTO_NSP: ::c_int = 31; 1080 /// Merit Internodal 1081 pub const IPPROTO_INP: ::c_int = 32; 1082 /// Sequential Exchange 1083 pub const IPPROTO_SEP: ::c_int = 33; 1084 /// Third Party Connect 1085 pub const IPPROTO_3PC: ::c_int = 34; 1086 /// InterDomain Policy Routing 1087 pub const IPPROTO_IDPR: ::c_int = 35; 1088 /// XTP 1089 pub const IPPROTO_XTP: ::c_int = 36; 1090 /// Datagram Delivery 1091 pub const IPPROTO_DDP: ::c_int = 37; 1092 /// Control Message Transport 1093 pub const IPPROTO_CMTP: ::c_int = 38; 1094 /// TP++ Transport 1095 pub const IPPROTO_TPXX: ::c_int = 39; 1096 /// IL transport protocol 1097 pub const IPPROTO_IL: ::c_int = 40; 1098 // IPPROTO_IPV6 defined in src/unix/mod.rs 1099 /// Source Demand Routing 1100 pub const IPPROTO_SDRP: ::c_int = 42; 1101 /// IP6 routing header 1102 pub const IPPROTO_ROUTING: ::c_int = 43; 1103 /// IP6 fragmentation header 1104 pub const IPPROTO_FRAGMENT: ::c_int = 44; 1105 /// InterDomain Routing 1106 pub const IPPROTO_IDRP: ::c_int = 45; 1107 /// resource reservation 1108 pub const IPPROTO_RSVP: ::c_int = 46; 1109 /// General Routing Encap. 1110 pub const IPPROTO_GRE: ::c_int = 47; 1111 /// Mobile Host Routing 1112 pub const IPPROTO_MHRP: ::c_int = 48; 1113 /// BHA 1114 pub const IPPROTO_BHA: ::c_int = 49; 1115 /// IP6 Encap Sec. Payload 1116 pub const IPPROTO_ESP: ::c_int = 50; 1117 /// IP6 Auth Header 1118 pub const IPPROTO_AH: ::c_int = 51; 1119 /// Integ. Net Layer Security 1120 pub const IPPROTO_INLSP: ::c_int = 52; 1121 /// IP with encryption 1122 pub const IPPROTO_SWIPE: ::c_int = 53; 1123 /// Next Hop Resolution 1124 pub const IPPROTO_NHRP: ::c_int = 54; 1125 /// IP Mobility 1126 pub const IPPROTO_MOBILE: ::c_int = 55; 1127 /// Transport Layer Security 1128 pub const IPPROTO_TLSP: ::c_int = 56; 1129 /// SKIP 1130 pub const IPPROTO_SKIP: ::c_int = 57; 1131 // IPPROTO_ICMPV6 defined in src/unix/mod.rs 1132 /// IP6 no next header 1133 pub const IPPROTO_NONE: ::c_int = 59; 1134 /// IP6 destination option 1135 pub const IPPROTO_DSTOPTS: ::c_int = 60; 1136 /// any host internal protocol 1137 pub const IPPROTO_AHIP: ::c_int = 61; 1138 /// CFTP 1139 pub const IPPROTO_CFTP: ::c_int = 62; 1140 /// "hello" routing protocol 1141 pub const IPPROTO_HELLO: ::c_int = 63; 1142 /// SATNET/Backroom EXPAK 1143 pub const IPPROTO_SATEXPAK: ::c_int = 64; 1144 /// Kryptolan 1145 pub const IPPROTO_KRYPTOLAN: ::c_int = 65; 1146 /// Remote Virtual Disk 1147 pub const IPPROTO_RVD: ::c_int = 66; 1148 /// Pluribus Packet Core 1149 pub const IPPROTO_IPPC: ::c_int = 67; 1150 /// Any distributed FS 1151 pub const IPPROTO_ADFS: ::c_int = 68; 1152 /// Satnet Monitoring 1153 pub const IPPROTO_SATMON: ::c_int = 69; 1154 /// VISA Protocol 1155 pub const IPPROTO_VISA: ::c_int = 70; 1156 /// Packet Core Utility 1157 pub const IPPROTO_IPCV: ::c_int = 71; 1158 /// Comp. Prot. Net. Executive 1159 pub const IPPROTO_CPNX: ::c_int = 72; 1160 /// Comp. Prot. HeartBeat 1161 pub const IPPROTO_CPHB: ::c_int = 73; 1162 /// Wang Span Network 1163 pub const IPPROTO_WSN: ::c_int = 74; 1164 /// Packet Video Protocol 1165 pub const IPPROTO_PVP: ::c_int = 75; 1166 /// BackRoom SATNET Monitoring 1167 pub const IPPROTO_BRSATMON: ::c_int = 76; 1168 /// Sun net disk proto (temp.) 1169 pub const IPPROTO_ND: ::c_int = 77; 1170 /// WIDEBAND Monitoring 1171 pub const IPPROTO_WBMON: ::c_int = 78; 1172 /// WIDEBAND EXPAK 1173 pub const IPPROTO_WBEXPAK: ::c_int = 79; 1174 /// ISO cnlp 1175 pub const IPPROTO_EON: ::c_int = 80; 1176 /// VMTP 1177 pub const IPPROTO_VMTP: ::c_int = 81; 1178 /// Secure VMTP 1179 pub const IPPROTO_SVMTP: ::c_int = 82; 1180 /// Banyon VINES 1181 pub const IPPROTO_VINES: ::c_int = 83; 1182 /// TTP 1183 pub const IPPROTO_TTP: ::c_int = 84; 1184 /// NSFNET-IGP 1185 pub const IPPROTO_IGP: ::c_int = 85; 1186 /// dissimilar gateway prot. 1187 pub const IPPROTO_DGP: ::c_int = 86; 1188 /// TCF 1189 pub const IPPROTO_TCF: ::c_int = 87; 1190 /// Cisco/GXS IGRP 1191 pub const IPPROTO_IGRP: ::c_int = 88; 1192 /// OSPFIGP 1193 pub const IPPROTO_OSPFIGP: ::c_int = 89; 1194 /// Strite RPC protocol 1195 pub const IPPROTO_SRPC: ::c_int = 90; 1196 /// Locus Address Resoloution 1197 pub const IPPROTO_LARP: ::c_int = 91; 1198 /// Multicast Transport 1199 pub const IPPROTO_MTP: ::c_int = 92; 1200 /// AX.25 Frames 1201 pub const IPPROTO_AX25: ::c_int = 93; 1202 /// IP encapsulated in IP 1203 pub const IPPROTO_IPEIP: ::c_int = 94; 1204 /// Mobile Int.ing control 1205 pub const IPPROTO_MICP: ::c_int = 95; 1206 /// Semaphore Comm. security 1207 pub const IPPROTO_SCCSP: ::c_int = 96; 1208 /// Ethernet IP encapsulation 1209 pub const IPPROTO_ETHERIP: ::c_int = 97; 1210 /// encapsulation header 1211 pub const IPPROTO_ENCAP: ::c_int = 98; 1212 /// any private encr. scheme 1213 pub const IPPROTO_APES: ::c_int = 99; 1214 /// GMTP 1215 pub const IPPROTO_GMTP: ::c_int = 100; 1216 /// payload compression (IPComp) 1217 pub const IPPROTO_IPCOMP: ::c_int = 108; 1218 1219 /* 101-254: Partly Unassigned */ 1220 /// Protocol Independent Mcast 1221 pub const IPPROTO_PIM: ::c_int = 103; 1222 /// CARP 1223 pub const IPPROTO_CARP: ::c_int = 112; 1224 /// PGM 1225 pub const IPPROTO_PGM: ::c_int = 113; 1226 /// PFSYNC 1227 pub const IPPROTO_PFSYNC: ::c_int = 240; 1228 1229 /* 255: Reserved */ 1230 /* BSD Private, local use, namespace incursion, no longer used */ 1231 /// divert pseudo-protocol 1232 pub const IPPROTO_DIVERT: ::c_int = 254; 1233 pub const IPPROTO_MAX: ::c_int = 256; 1234 /// last return value of *_input(), meaning "all job for this pkt is done". 1235 pub const IPPROTO_DONE: ::c_int = 257; 1236 1237 /// Used by RSS: the layer3 protocol is unknown 1238 pub const IPPROTO_UNKNOWN: ::c_int = 258; 1239 1240 // sys/netinet/tcp.h 1241 pub const TCP_SIGNATURE_ENABLE: ::c_int = 16; 1242 pub const TCP_KEEPINIT: ::c_int = 32; 1243 pub const TCP_FASTKEEP: ::c_int = 128; 1244 1245 pub const AF_BLUETOOTH: ::c_int = 33; 1246 pub const AF_MPLS: ::c_int = 34; 1247 pub const AF_IEEE80211: ::c_int = 35; 1248 1249 pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH; 1250 1251 pub const NET_RT_DUMP: ::c_int = 1; 1252 pub const NET_RT_FLAGS: ::c_int = 2; 1253 pub const NET_RT_IFLIST: ::c_int = 3; 1254 pub const NET_RT_MAXID: ::c_int = 4; 1255 1256 pub const SOMAXOPT_SIZE: ::c_int = 65536; 1257 1258 pub const MSG_UNUSED09: ::c_int = 0x00000200; 1259 pub const MSG_NOSIGNAL: ::c_int = 0x00000400; 1260 pub const MSG_SYNC: ::c_int = 0x00000800; 1261 pub const MSG_CMSG_CLOEXEC: ::c_int = 0x00001000; 1262 pub const MSG_FBLOCKING: ::c_int = 0x00010000; 1263 pub const MSG_FNONBLOCKING: ::c_int = 0x00020000; 1264 pub const MSG_FMASK: ::c_int = 0xFFFF0000; 1265 1266 // utmpx entry types 1267 pub const EMPTY: ::c_short = 0; 1268 pub const RUN_LVL: ::c_short = 1; 1269 pub const BOOT_TIME: ::c_short = 2; 1270 pub const OLD_TIME: ::c_short = 3; 1271 pub const NEW_TIME: ::c_short = 4; 1272 pub const INIT_PROCESS: ::c_short = 5; 1273 pub const LOGIN_PROCESS: ::c_short = 6; 1274 pub const USER_PROCESS: ::c_short = 7; 1275 pub const DEAD_PROCESS: ::c_short = 8; 1276 pub const ACCOUNTING: ::c_short = 9; 1277 pub const SIGNATURE: ::c_short = 10; 1278 pub const DOWNTIME: ::c_short = 11; 1279 // utmpx database types 1280 pub const UTX_DB_UTMPX: ::c_uint = 0; 1281 pub const UTX_DB_WTMPX: ::c_uint = 1; 1282 pub const UTX_DB_LASTLOG: ::c_uint = 2; 1283 pub const _UTX_LINESIZE: usize = 32; 1284 pub const _UTX_USERSIZE: usize = 32; 1285 pub const _UTX_IDSIZE: usize = 4; 1286 pub const _UTX_HOSTSIZE: usize = 256; 1287 1288 pub const LC_COLLATE_MASK: ::c_int = 1 << 0; 1289 pub const LC_CTYPE_MASK: ::c_int = 1 << 1; 1290 pub const LC_MONETARY_MASK: ::c_int = 1 << 2; 1291 pub const LC_NUMERIC_MASK: ::c_int = 1 << 3; 1292 pub const LC_TIME_MASK: ::c_int = 1 << 4; 1293 pub const LC_MESSAGES_MASK: ::c_int = 1 << 5; 1294 pub const LC_ALL_MASK: ::c_int = LC_COLLATE_MASK 1295 | LC_CTYPE_MASK 1296 | LC_MESSAGES_MASK 1297 | LC_MONETARY_MASK 1298 | LC_NUMERIC_MASK 1299 | LC_TIME_MASK; 1300 1301 pub const TIOCSIG: ::c_uint = 0x2000745f; 1302 pub const BTUARTDISC: ::c_int = 0x7; 1303 pub const TIOCDCDTIMESTAMP: ::c_uint = 0x40107458; 1304 pub const TIOCISPTMASTER: ::c_uint = 0x20007455; 1305 pub const TIOCMODG: ::c_uint = 0x40047403; 1306 pub const TIOCMODS: ::c_ulong = 0x80047404; 1307 pub const TIOCREMOTE: ::c_ulong = 0x80047469; 1308 1309 // Constants used by "at" family of system calls. 1310 pub const AT_FDCWD: ::c_int = 0xFFFAFDCD; // invalid file descriptor 1311 pub const AT_SYMLINK_NOFOLLOW: ::c_int = 1; 1312 pub const AT_REMOVEDIR: ::c_int = 2; 1313 pub const AT_EACCESS: ::c_int = 4; 1314 pub const AT_SYMLINK_FOLLOW: ::c_int = 8; 1315 1316 pub const VCHECKPT: usize = 19; 1317 1318 pub const _PC_2_SYMLINKS: ::c_int = 22; 1319 pub const _PC_TIMESTAMP_RESOLUTION: ::c_int = 23; 1320 1321 pub const _SC_V7_ILP32_OFF32: ::c_int = 122; 1322 pub const _SC_V7_ILP32_OFFBIG: ::c_int = 123; 1323 pub const _SC_V7_LP64_OFF64: ::c_int = 124; 1324 pub const _SC_V7_LPBIG_OFFBIG: ::c_int = 125; 1325 pub const _SC_THREAD_ROBUST_PRIO_INHERIT: ::c_int = 126; 1326 pub const _SC_THREAD_ROBUST_PRIO_PROTECT: ::c_int = 127; 1327 1328 pub const WCONTINUED: ::c_int = 0x4; 1329 pub const WSTOPPED: ::c_int = 0x2; 1330 pub const WNOWAIT: ::c_int = 0x8; 1331 pub const WEXITED: ::c_int = 0x10; 1332 pub const WTRAPPED: ::c_int = 0x20; 1333 1334 // Similar to FreeBSD, only the standardized ones are exposed. 1335 // There are more. 1336 pub const P_PID: idtype_t = 0; 1337 pub const P_PGID: idtype_t = 2; 1338 pub const P_ALL: idtype_t = 7; 1339 1340 // Values for struct rtprio (type_ field) 1341 pub const RTP_PRIO_REALTIME: ::c_ushort = 0; 1342 pub const RTP_PRIO_NORMAL: ::c_ushort = 1; 1343 pub const RTP_PRIO_IDLE: ::c_ushort = 2; 1344 pub const RTP_PRIO_THREAD: ::c_ushort = 3; 1345 1346 // Flags for chflags(2) 1347 pub const UF_NOHISTORY: ::c_ulong = 0x00000040; 1348 pub const UF_CACHE: ::c_ulong = 0x00000080; 1349 pub const UF_XLINK: ::c_ulong = 0x00000100; 1350 pub const SF_NOHISTORY: ::c_ulong = 0x00400000; 1351 pub const SF_CACHE: ::c_ulong = 0x00800000; 1352 pub const SF_XLINK: ::c_ulong = 0x01000000; 1353 1354 // timespec constants 1355 pub const UTIME_OMIT: c_long = -2; 1356 pub const UTIME_NOW: c_long = -1; 1357 1358 pub const MINCORE_SUPER: ::c_int = 0x20; 1359 1360 const_fn! { 1361 {const} fn _CMSG_ALIGN(n: usize) -> usize { 1362 (n + 3) & !3 1363 } 1364 } 1365 1366 f! { 1367 pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar { 1368 (cmsg as *mut ::c_uchar) 1369 .offset(_CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) as isize) 1370 } 1371 1372 pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint { 1373 (_CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) + length as usize) 1374 as ::c_uint 1375 } 1376 1377 pub fn CMSG_NXTHDR(mhdr: *const ::msghdr, cmsg: *const ::cmsghdr) 1378 -> *mut ::cmsghdr 1379 { 1380 let next = cmsg as usize + _CMSG_ALIGN((*cmsg).cmsg_len as usize) 1381 + _CMSG_ALIGN(::mem::size_of::<::cmsghdr>()); 1382 let max = (*mhdr).msg_control as usize 1383 + (*mhdr).msg_controllen as usize; 1384 if next <= max { 1385 (cmsg as usize + _CMSG_ALIGN((*cmsg).cmsg_len as usize)) 1386 as *mut ::cmsghdr 1387 } else { 1388 0 as *mut ::cmsghdr 1389 } 1390 } 1391 1392 pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint { 1393 (_CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) + 1394 _CMSG_ALIGN(length as usize)) as ::c_uint 1395 } 1396 1397 pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () { 1398 for slot in cpuset.ary.iter_mut() { 1399 *slot = 0; 1400 } 1401 } 1402 1403 pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () { 1404 let (idx, offset) = ((cpu >> 6) & 3, cpu & 63); 1405 cpuset.ary[idx] |= 1 << offset; 1406 () 1407 } 1408 1409 pub fn CPU_CLR(cpu: usize, cpuset: &mut cpu_set_t) -> () { 1410 let (idx, offset) = ((cpu >> 6) & 3, cpu & 63); 1411 cpuset.ary[idx] &= !(1 << offset); 1412 () 1413 } 1414 1415 pub fn CPU_ISSET(cpu: usize, cpuset: &cpu_set_t) -> bool { 1416 let (idx, offset) = ((cpu >> 6) & 3, cpu & 63); 1417 0 != cpuset.ary[idx] & (1 << offset) 1418 } 1419 } 1420 1421 safe_f! { 1422 pub {const} fn WIFSIGNALED(status: ::c_int) -> bool { 1423 (status & 0o177) != 0o177 && (status & 0o177) != 0 1424 } 1425 } 1426 1427 extern "C" { __errno_location() -> *mut ::c_int1428 pub fn __errno_location() -> *mut ::c_int; setgrent()1429 pub fn setgrent(); mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int1430 pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int; 1431 setutxdb(_type: ::c_uint, file: *mut ::c_char) -> ::c_int1432 pub fn setutxdb(_type: ::c_uint, file: *mut ::c_char) -> ::c_int; 1433 aio_waitcomplete(iocbp: *mut *mut aiocb, timeout: *mut ::timespec) -> ::c_int1434 pub fn aio_waitcomplete(iocbp: *mut *mut aiocb, timeout: *mut ::timespec) -> ::c_int; 1435 1436 #[deprecated(since = "0.2.107", note = "len should be of type size_t")] devname_r( dev: ::dev_t, mode: ::mode_t, buf: *mut ::c_char, len: ::c_int, ) -> *mut ::c_char1437 pub fn devname_r( 1438 dev: ::dev_t, 1439 mode: ::mode_t, 1440 buf: *mut ::c_char, 1441 len: ::c_int, 1442 ) -> *mut ::c_char; 1443 waitid( idtype: idtype_t, id: ::id_t, infop: *mut ::siginfo_t, options: ::c_int, ) -> ::c_int1444 pub fn waitid( 1445 idtype: idtype_t, 1446 id: ::id_t, 1447 infop: *mut ::siginfo_t, 1448 options: ::c_int, 1449 ) -> ::c_int; 1450 freelocale(loc: ::locale_t)1451 pub fn freelocale(loc: ::locale_t); 1452 lwp_rtprio( function: ::c_int, pid: ::pid_t, lwpid: lwpid_t, rtp: *mut super::rtprio, ) -> ::c_int1453 pub fn lwp_rtprio( 1454 function: ::c_int, 1455 pid: ::pid_t, 1456 lwpid: lwpid_t, 1457 rtp: *mut super::rtprio, 1458 ) -> ::c_int; 1459 statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int1460 pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int; fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int1461 pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int; uname(buf: *mut ::utsname) -> ::c_int1462 pub fn uname(buf: *mut ::utsname) -> ::c_int; memmem( haystack: *const ::c_void, haystacklen: ::size_t, needle: *const ::c_void, needlelen: ::size_t, ) -> *mut ::c_void1463 pub fn memmem( 1464 haystack: *const ::c_void, 1465 haystacklen: ::size_t, 1466 needle: *const ::c_void, 1467 needlelen: ::size_t, 1468 ) -> *mut ::c_void; pthread_spin_init(lock: *mut pthread_spinlock_t, pshared: ::c_int) -> ::c_int1469 pub fn pthread_spin_init(lock: *mut pthread_spinlock_t, pshared: ::c_int) -> ::c_int; pthread_spin_destroy(lock: *mut pthread_spinlock_t) -> ::c_int1470 pub fn pthread_spin_destroy(lock: *mut pthread_spinlock_t) -> ::c_int; pthread_spin_lock(lock: *mut pthread_spinlock_t) -> ::c_int1471 pub fn pthread_spin_lock(lock: *mut pthread_spinlock_t) -> ::c_int; pthread_spin_trylock(lock: *mut pthread_spinlock_t) -> ::c_int1472 pub fn pthread_spin_trylock(lock: *mut pthread_spinlock_t) -> ::c_int; pthread_spin_unlock(lock: *mut pthread_spinlock_t) -> ::c_int1473 pub fn pthread_spin_unlock(lock: *mut pthread_spinlock_t) -> ::c_int; 1474 sched_getaffinity(pid: ::pid_t, cpusetsize: ::size_t, mask: *mut cpu_set_t) -> ::c_int1475 pub fn sched_getaffinity(pid: ::pid_t, cpusetsize: ::size_t, mask: *mut cpu_set_t) -> ::c_int; sched_setaffinity(pid: ::pid_t, cpusetsize: ::size_t, mask: *const cpu_set_t) -> ::c_int1476 pub fn sched_setaffinity(pid: ::pid_t, cpusetsize: ::size_t, mask: *const cpu_set_t) 1477 -> ::c_int; sched_getcpu() -> ::c_int1478 pub fn sched_getcpu() -> ::c_int; setproctitle(fmt: *const ::c_char, ...)1479 pub fn setproctitle(fmt: *const ::c_char, ...); 1480 shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int1481 pub fn shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int; shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void1482 pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void; shmdt(shmaddr: *const ::c_void) -> ::c_int1483 pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int; shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int1484 pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int; procctl(idtype: ::idtype_t, id: ::id_t, cmd: ::c_int, data: *mut ::c_void) -> ::c_int1485 pub fn procctl(idtype: ::idtype_t, id: ::id_t, cmd: ::c_int, data: *mut ::c_void) -> ::c_int; 1486 updwtmpx(file: *const ::c_char, ut: *const utmpx) -> ::c_int1487 pub fn updwtmpx(file: *const ::c_char, ut: *const utmpx) -> ::c_int; getlastlogx(fname: *const ::c_char, uid: ::uid_t, ll: *mut lastlogx) -> *mut lastlogx1488 pub fn getlastlogx(fname: *const ::c_char, uid: ::uid_t, ll: *mut lastlogx) -> *mut lastlogx; updlastlogx(fname: *const ::c_char, uid: ::uid_t, ll: *mut lastlogx) -> ::c_int1489 pub fn updlastlogx(fname: *const ::c_char, uid: ::uid_t, ll: *mut lastlogx) -> ::c_int; getutxuser(name: *const ::c_char) -> utmpx1490 pub fn getutxuser(name: *const ::c_char) -> utmpx; utmpxname(file: *const ::c_char) -> ::c_int1491 pub fn utmpxname(file: *const ::c_char) -> ::c_int; 1492 sys_checkpoint(tpe: ::c_int, fd: ::c_int, pid: ::pid_t, retval: ::c_int) -> ::c_int1493 pub fn sys_checkpoint(tpe: ::c_int, fd: ::c_int, pid: ::pid_t, retval: ::c_int) -> ::c_int; 1494 } 1495 1496 #[link(name = "rt")] 1497 extern "C" { aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int1498 pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int; aio_error(aiocbp: *const aiocb) -> ::c_int1499 pub fn aio_error(aiocbp: *const aiocb) -> ::c_int; aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int1500 pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int; aio_read(aiocbp: *mut aiocb) -> ::c_int1501 pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int; aio_return(aiocbp: *mut aiocb) -> ::ssize_t1502 pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t; aio_suspend( aiocb_list: *const *const aiocb, nitems: ::c_int, timeout: *const ::timespec, ) -> ::c_int1503 pub fn aio_suspend( 1504 aiocb_list: *const *const aiocb, 1505 nitems: ::c_int, 1506 timeout: *const ::timespec, 1507 ) -> ::c_int; aio_write(aiocbp: *mut aiocb) -> ::c_int1508 pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int; lio_listio( mode: ::c_int, aiocb_list: *const *mut aiocb, nitems: ::c_int, sevp: *mut sigevent, ) -> ::c_int1509 pub fn lio_listio( 1510 mode: ::c_int, 1511 aiocb_list: *const *mut aiocb, 1512 nitems: ::c_int, 1513 sevp: *mut sigevent, 1514 ) -> ::c_int; 1515 reallocf(ptr: *mut ::c_void, size: ::size_t) -> *mut ::c_void1516 pub fn reallocf(ptr: *mut ::c_void, size: ::size_t) -> *mut ::c_void; freezero(ptr: *mut ::c_void, size: ::size_t)1517 pub fn freezero(ptr: *mut ::c_void, size: ::size_t); 1518 } 1519 1520 cfg_if! { 1521 if #[cfg(libc_thread_local)] { 1522 mod errno; 1523 pub use self::errno::*; 1524 } 1525 } 1526