1 pub type fflags_t = u32; 2 pub type clock_t = i32; 3 4 pub type lwpid_t = i32; 5 pub type blksize_t = i32; 6 pub type clockid_t = ::c_int; 7 pub type sem_t = _sem; 8 9 pub type fsblkcnt_t = u64; 10 pub type fsfilcnt_t = u64; 11 pub type idtype_t = ::c_uint; 12 13 pub type key_t = ::c_long; 14 pub type msglen_t = ::c_ulong; 15 pub type msgqnum_t = ::c_ulong; 16 17 pub type cpulevel_t = ::c_int; 18 pub type cpuwhich_t = ::c_int; 19 20 pub type mqd_t = *mut ::c_void; 21 pub type posix_spawnattr_t = *mut ::c_void; 22 pub type posix_spawn_file_actions_t = *mut ::c_void; 23 24 pub type pthread_spinlock_t = *mut __c_anonymous_pthread_spinlock; 25 pub type pthread_barrierattr_t = *mut __c_anonymous_pthread_barrierattr; 26 pub type pthread_barrier_t = *mut __c_anonymous_pthread_barrier; 27 28 s! { 29 pub struct aiocb { 30 pub aio_fildes: ::c_int, 31 pub aio_offset: ::off_t, 32 pub aio_buf: *mut ::c_void, 33 pub aio_nbytes: ::size_t, 34 __unused1: [::c_int; 2], 35 __unused2: *mut ::c_void, 36 pub aio_lio_opcode: ::c_int, 37 pub aio_reqprio: ::c_int, 38 // unused 3 through 5 are the __aiocb_private structure 39 __unused3: ::c_long, 40 __unused4: ::c_long, 41 __unused5: *mut ::c_void, 42 pub aio_sigevent: sigevent 43 } 44 45 pub struct jail { 46 pub version: u32, 47 pub path: *mut ::c_char, 48 pub hostname: *mut ::c_char, 49 pub jailname: *mut ::c_char, 50 pub ip4s: ::c_uint, 51 pub ip6s: ::c_uint, 52 pub ip4: *mut ::in_addr, 53 pub ip6: *mut ::in6_addr, 54 } 55 56 pub struct statvfs { 57 pub f_bavail: ::fsblkcnt_t, 58 pub f_bfree: ::fsblkcnt_t, 59 pub f_blocks: ::fsblkcnt_t, 60 pub f_favail: ::fsfilcnt_t, 61 pub f_ffree: ::fsfilcnt_t, 62 pub f_files: ::fsfilcnt_t, 63 pub f_bsize: ::c_ulong, 64 pub f_flag: ::c_ulong, 65 pub f_frsize: ::c_ulong, 66 pub f_fsid: ::c_ulong, 67 pub f_namemax: ::c_ulong, 68 } 69 70 // internal structure has changed over time 71 pub struct _sem { 72 data: [u32; 4], 73 } 74 75 pub struct ipc_perm { 76 pub cuid: ::uid_t, 77 pub cgid: ::gid_t, 78 pub uid: ::uid_t, 79 pub gid: ::gid_t, 80 pub mode: ::mode_t, 81 pub seq: ::c_ushort, 82 pub key: ::key_t, 83 } 84 85 pub struct msqid_ds { 86 pub msg_perm: ::ipc_perm, 87 __unused1: *mut ::c_void, 88 __unused2: *mut ::c_void, 89 pub msg_cbytes: ::msglen_t, 90 pub msg_qnum: ::msgqnum_t, 91 pub msg_qbytes: ::msglen_t, 92 pub msg_lspid: ::pid_t, 93 pub msg_lrpid: ::pid_t, 94 pub msg_stime: ::time_t, 95 pub msg_rtime: ::time_t, 96 pub msg_ctime: ::time_t, 97 } 98 99 pub struct stack_t { 100 pub ss_sp: *mut ::c_void, 101 pub ss_size: ::size_t, 102 pub ss_flags: ::c_int, 103 } 104 105 pub struct mmsghdr { 106 pub msg_hdr: ::msghdr, 107 pub msg_len: ::ssize_t, 108 } 109 110 pub struct sockcred { 111 pub sc_uid: ::uid_t, 112 pub sc_euid: ::uid_t, 113 pub sc_gid: ::gid_t, 114 pub sc_egid: ::gid_t, 115 pub sc_ngroups: ::c_int, 116 pub sc_groups: [::gid_t; 1], 117 } 118 119 pub struct accept_filter_arg { 120 pub af_name: [::c_char; 16], 121 af_arg: [[::c_char; 10]; 24], 122 } 123 124 pub struct ptrace_vm_entry { 125 pub pve_entry: ::c_int, 126 pub pve_timestamp: ::c_int, 127 pub pve_start: ::c_ulong, 128 pub pve_end: ::c_ulong, 129 pub pve_offset: ::c_ulong, 130 pub pve_prot: ::c_uint, 131 pub pve_pathlen: ::c_uint, 132 pub pve_fileid: ::c_long, 133 pub pve_fsid: u32, 134 pub pve_path: *mut ::c_char, 135 } 136 137 pub struct cpuset_t { 138 #[cfg(target_pointer_width = "64")] 139 __bits: [::c_long; 4], 140 #[cfg(target_pointer_width = "32")] 141 __bits: [::c_long; 8], 142 } 143 144 pub struct cap_rights_t { 145 cr_rights: [u64; 2], 146 } 147 148 pub struct umutex { 149 m_owner: ::lwpid_t, 150 m_flags: u32, 151 m_ceilings: [u32; 2], 152 m_rb_link: ::uintptr_t, 153 #[cfg(target_pointer_width = "32")] 154 m_pad: u32, 155 m_spare: [u32; 2], 156 157 } 158 159 pub struct ucond { 160 c_has_waiters: u32, 161 c_flags: u32, 162 c_clockid: u32, 163 c_spare: [u32; 1], 164 } 165 166 pub struct __c_anonymous_pthread_spinlock { 167 s_clock: umutex, 168 } 169 170 pub struct __c_anonymous_pthread_barrierattr { 171 pshared: ::c_int, 172 } 173 174 pub struct __c_anonymous_pthread_barrier { 175 b_lock: umutex, 176 b_cv: ucond, 177 b_cycle: i64, 178 b_count: ::c_int, 179 b_waiters: ::c_int, 180 b_refcount: ::c_int, 181 b_destroying: ::c_int, 182 } 183 } 184 185 s_no_extra_traits! { 186 pub struct utmpx { 187 pub ut_type: ::c_short, 188 pub ut_tv: ::timeval, 189 pub ut_id: [::c_char; 8], 190 pub ut_pid: ::pid_t, 191 pub ut_user: [::c_char; 32], 192 pub ut_line: [::c_char; 16], 193 pub ut_host: [::c_char; 128], 194 pub __ut_spare: [::c_char; 64], 195 } 196 197 #[cfg(libc_union)] 198 pub union __c_anonymous_cr_pid { 199 __cr_unused: *mut ::c_void, 200 pub cr_pid: ::pid_t, 201 } 202 203 pub struct xucred { 204 pub cr_version: ::c_uint, 205 pub cr_uid: ::uid_t, 206 pub cr_ngroups: ::c_short, 207 pub cr_groups: [::gid_t; 16], 208 #[cfg(libc_union)] 209 pub cr_pid__c_anonymous_union: __c_anonymous_cr_pid, 210 #[cfg(not(libc_union))] 211 __cr_unused1: *mut ::c_void, 212 } 213 214 pub struct sockaddr_dl { 215 pub sdl_len: ::c_uchar, 216 pub sdl_family: ::c_uchar, 217 pub sdl_index: ::c_ushort, 218 pub sdl_type: ::c_uchar, 219 pub sdl_nlen: ::c_uchar, 220 pub sdl_alen: ::c_uchar, 221 pub sdl_slen: ::c_uchar, 222 pub sdl_data: [::c_char; 46], 223 } 224 225 pub struct mq_attr { 226 pub mq_flags: ::c_long, 227 pub mq_maxmsg: ::c_long, 228 pub mq_msgsize: ::c_long, 229 pub mq_curmsgs: ::c_long, 230 __reserved: [::c_long; 4] 231 } 232 233 pub struct sigevent { 234 pub sigev_notify: ::c_int, 235 pub sigev_signo: ::c_int, 236 pub sigev_value: ::sigval, 237 //The rest of the structure is actually a union. We expose only 238 //sigev_notify_thread_id because it's the most useful union member. 239 pub sigev_notify_thread_id: ::lwpid_t, 240 #[cfg(target_pointer_width = "64")] 241 __unused1: ::c_int, 242 __unused2: [::c_long; 7] 243 } 244 } 245 246 cfg_if! { 247 if #[cfg(feature = "extra_traits")] { 248 impl PartialEq for utmpx { 249 fn eq(&self, other: &utmpx) -> bool { 250 self.ut_type == other.ut_type 251 && self.ut_tv == other.ut_tv 252 && self.ut_id == other.ut_id 253 && self.ut_pid == other.ut_pid 254 && self.ut_user == other.ut_user 255 && self.ut_line == other.ut_line 256 && self 257 .ut_host 258 .iter() 259 .zip(other.ut_host.iter()) 260 .all(|(a,b)| a == b) 261 && self 262 .__ut_spare 263 .iter() 264 .zip(other.__ut_spare.iter()) 265 .all(|(a,b)| a == b) 266 } 267 } 268 impl Eq for utmpx {} 269 impl ::fmt::Debug for utmpx { 270 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 271 f.debug_struct("utmpx") 272 .field("ut_type", &self.ut_type) 273 .field("ut_tv", &self.ut_tv) 274 .field("ut_id", &self.ut_id) 275 .field("ut_pid", &self.ut_pid) 276 .field("ut_user", &self.ut_user) 277 .field("ut_line", &self.ut_line) 278 // FIXME: .field("ut_host", &self.ut_host) 279 // FIXME: .field("__ut_spare", &self.__ut_spare) 280 .finish() 281 } 282 } 283 impl ::hash::Hash for utmpx { 284 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 285 self.ut_type.hash(state); 286 self.ut_tv.hash(state); 287 self.ut_id.hash(state); 288 self.ut_pid.hash(state); 289 self.ut_user.hash(state); 290 self.ut_line.hash(state); 291 self.ut_host.hash(state); 292 self.__ut_spare.hash(state); 293 } 294 } 295 296 #[cfg(libc_union)] 297 impl PartialEq for __c_anonymous_cr_pid { 298 fn eq(&self, other: &__c_anonymous_cr_pid) -> bool { 299 unsafe { self.cr_pid == other.cr_pid} 300 } 301 } 302 #[cfg(libc_union)] 303 impl Eq for __c_anonymous_cr_pid {} 304 #[cfg(libc_union)] 305 impl ::fmt::Debug for __c_anonymous_cr_pid { 306 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 307 f.debug_struct("cr_pid") 308 .field("cr_pid", unsafe { &self.cr_pid }) 309 .finish() 310 } 311 } 312 #[cfg(libc_union)] 313 impl ::hash::Hash for __c_anonymous_cr_pid { 314 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 315 unsafe { self.cr_pid.hash(state) }; 316 } 317 } 318 319 impl PartialEq for xucred { 320 fn eq(&self, other: &xucred) -> bool { 321 #[cfg(libc_union)] 322 let equal_cr_pid = self.cr_pid__c_anonymous_union 323 == other.cr_pid__c_anonymous_union; 324 #[cfg(not(libc_union))] 325 let equal_cr_pid = self.__cr_unused1 == other.__cr_unused1; 326 327 self.cr_version == other.cr_version 328 && self.cr_uid == other.cr_uid 329 && self.cr_ngroups == other.cr_ngroups 330 && self.cr_groups == other.cr_groups 331 && equal_cr_pid 332 } 333 } 334 impl Eq for xucred {} 335 impl ::fmt::Debug for xucred { 336 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 337 let mut struct_formatter = f.debug_struct("xucred"); 338 struct_formatter.field("cr_version", &self.cr_version); 339 struct_formatter.field("cr_uid", &self.cr_uid); 340 struct_formatter.field("cr_ngroups", &self.cr_ngroups); 341 struct_formatter.field("cr_groups", &self.cr_groups); 342 #[cfg(libc_union)] 343 struct_formatter.field( 344 "cr_pid__c_anonymous_union", 345 &self.cr_pid__c_anonymous_union 346 ); 347 struct_formatter.finish() 348 } 349 } 350 impl ::hash::Hash for xucred { 351 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 352 self.cr_version.hash(state); 353 self.cr_uid.hash(state); 354 self.cr_ngroups.hash(state); 355 self.cr_groups.hash(state); 356 #[cfg(libc_union)] 357 self.cr_pid__c_anonymous_union.hash(state); 358 #[cfg(not(libc_union))] 359 self.__cr_unused1.hash(state); 360 } 361 } 362 363 impl PartialEq for sockaddr_dl { 364 fn eq(&self, other: &sockaddr_dl) -> bool { 365 self.sdl_len == other.sdl_len 366 && self.sdl_family == other.sdl_family 367 && self.sdl_index == other.sdl_index 368 && self.sdl_type == other.sdl_type 369 && self.sdl_nlen == other.sdl_nlen 370 && self.sdl_alen == other.sdl_alen 371 && self.sdl_slen == other.sdl_slen 372 && self 373 .sdl_data 374 .iter() 375 .zip(other.sdl_data.iter()) 376 .all(|(a,b)| a == b) 377 } 378 } 379 impl Eq for sockaddr_dl {} 380 impl ::fmt::Debug for sockaddr_dl { 381 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 382 f.debug_struct("sockaddr_dl") 383 .field("sdl_len", &self.sdl_len) 384 .field("sdl_family", &self.sdl_family) 385 .field("sdl_index", &self.sdl_index) 386 .field("sdl_type", &self.sdl_type) 387 .field("sdl_nlen", &self.sdl_nlen) 388 .field("sdl_alen", &self.sdl_alen) 389 .field("sdl_slen", &self.sdl_slen) 390 // FIXME: .field("sdl_data", &self.sdl_data) 391 .finish() 392 } 393 } 394 impl ::hash::Hash for sockaddr_dl { 395 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 396 self.sdl_len.hash(state); 397 self.sdl_family.hash(state); 398 self.sdl_index.hash(state); 399 self.sdl_type.hash(state); 400 self.sdl_nlen.hash(state); 401 self.sdl_alen.hash(state); 402 self.sdl_slen.hash(state); 403 self.sdl_data.hash(state); 404 } 405 } 406 407 impl PartialEq for mq_attr { 408 fn eq(&self, other: &mq_attr) -> bool { 409 self.mq_flags == other.mq_flags && 410 self.mq_maxmsg == other.mq_maxmsg && 411 self.mq_msgsize == other.mq_msgsize && 412 self.mq_curmsgs == other.mq_curmsgs 413 } 414 } 415 impl Eq for mq_attr {} 416 impl ::fmt::Debug for mq_attr { 417 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 418 f.debug_struct("mq_attr") 419 .field("mq_flags", &self.mq_flags) 420 .field("mq_maxmsg", &self.mq_maxmsg) 421 .field("mq_msgsize", &self.mq_msgsize) 422 .field("mq_curmsgs", &self.mq_curmsgs) 423 .finish() 424 } 425 } 426 impl ::hash::Hash for mq_attr { 427 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 428 self.mq_flags.hash(state); 429 self.mq_maxmsg.hash(state); 430 self.mq_msgsize.hash(state); 431 self.mq_curmsgs.hash(state); 432 } 433 } 434 435 impl PartialEq for sigevent { 436 fn eq(&self, other: &sigevent) -> bool { 437 self.sigev_notify == other.sigev_notify 438 && self.sigev_signo == other.sigev_signo 439 && self.sigev_value == other.sigev_value 440 && self.sigev_notify_thread_id 441 == other.sigev_notify_thread_id 442 } 443 } 444 impl Eq for sigevent {} 445 impl ::fmt::Debug for sigevent { 446 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { 447 f.debug_struct("sigevent") 448 .field("sigev_notify", &self.sigev_notify) 449 .field("sigev_signo", &self.sigev_signo) 450 .field("sigev_value", &self.sigev_value) 451 .field("sigev_notify_thread_id", 452 &self.sigev_notify_thread_id) 453 .finish() 454 } 455 } 456 impl ::hash::Hash for sigevent { 457 fn hash<H: ::hash::Hasher>(&self, state: &mut H) { 458 self.sigev_notify.hash(state); 459 self.sigev_signo.hash(state); 460 self.sigev_value.hash(state); 461 self.sigev_notify_thread_id.hash(state); 462 } 463 } 464 } 465 } 466 467 pub const SIGEV_THREAD_ID: ::c_int = 4; 468 469 pub const EXTATTR_NAMESPACE_EMPTY: ::c_int = 0; 470 pub const EXTATTR_NAMESPACE_USER: ::c_int = 1; 471 pub const EXTATTR_NAMESPACE_SYSTEM: ::c_int = 2; 472 473 pub const PTHREAD_STACK_MIN: ::size_t = MINSIGSTKSZ; 474 pub const PTHREAD_MUTEX_ADAPTIVE_NP: ::c_int = 4; 475 pub const SIGSTKSZ: ::size_t = MINSIGSTKSZ + 32768; 476 pub const SF_NODISKIO: ::c_int = 0x00000001; 477 pub const SF_MNOWAIT: ::c_int = 0x00000002; 478 pub const SF_SYNC: ::c_int = 0x00000004; 479 pub const SF_USER_READAHEAD: ::c_int = 0x00000008; 480 pub const SF_NOCACHE: ::c_int = 0x00000010; 481 pub const O_CLOEXEC: ::c_int = 0x00100000; 482 pub const O_DIRECTORY: ::c_int = 0x00020000; 483 pub const O_EXEC: ::c_int = 0x00040000; 484 pub const O_TTY_INIT: ::c_int = 0x00080000; 485 pub const F_GETLK: ::c_int = 11; 486 pub const F_SETLK: ::c_int = 12; 487 pub const F_SETLKW: ::c_int = 13; 488 pub const ENOTCAPABLE: ::c_int = 93; 489 pub const ECAPMODE: ::c_int = 94; 490 pub const ENOTRECOVERABLE: ::c_int = 95; 491 pub const EOWNERDEAD: ::c_int = 96; 492 pub const RLIMIT_NPTS: ::c_int = 11; 493 pub const RLIMIT_SWAP: ::c_int = 12; 494 pub const RLIMIT_KQUEUES: ::c_int = 13; 495 pub const RLIMIT_UMTXP: ::c_int = 14; 496 #[deprecated(since = "0.2.64", note = "Not stable across OS versions")] 497 pub const RLIM_NLIMITS: ::rlim_t = 15; 498 499 pub const NI_NOFQDN: ::c_int = 0x00000001; 500 pub const NI_NUMERICHOST: ::c_int = 0x00000002; 501 pub const NI_NAMEREQD: ::c_int = 0x00000004; 502 pub const NI_NUMERICSERV: ::c_int = 0x00000008; 503 pub const NI_DGRAM: ::c_int = 0x00000010; 504 pub const NI_NUMERICSCOPE: ::c_int = 0x00000020; 505 506 pub const Q_GETQUOTA: ::c_int = 0x700; 507 pub const Q_SETQUOTA: ::c_int = 0x800; 508 509 pub const MAP_GUARD: ::c_int = 0x00002000; 510 pub const MAP_ALIGNED_SUPER: ::c_int = 1 << 24; 511 512 pub const POSIX_FADV_NORMAL: ::c_int = 0; 513 pub const POSIX_FADV_RANDOM: ::c_int = 1; 514 pub const POSIX_FADV_SEQUENTIAL: ::c_int = 2; 515 pub const POSIX_FADV_WILLNEED: ::c_int = 3; 516 pub const POSIX_FADV_DONTNEED: ::c_int = 4; 517 pub const POSIX_FADV_NOREUSE: ::c_int = 5; 518 519 pub const POLLINIGNEOF: ::c_short = 0x2000; 520 521 pub const EVFILT_READ: i16 = -1; 522 pub const EVFILT_WRITE: i16 = -2; 523 pub const EVFILT_AIO: i16 = -3; 524 pub const EVFILT_VNODE: i16 = -4; 525 pub const EVFILT_PROC: i16 = -5; 526 pub const EVFILT_SIGNAL: i16 = -6; 527 pub const EVFILT_TIMER: i16 = -7; 528 pub const EVFILT_PROCDESC: i16 = -8; 529 pub const EVFILT_FS: i16 = -9; 530 pub const EVFILT_LIO: i16 = -10; 531 pub const EVFILT_USER: i16 = -11; 532 pub const EVFILT_SENDFILE: i16 = -12; 533 pub const EVFILT_EMPTY: i16 = -13; 534 535 pub const EV_ADD: u16 = 0x1; 536 pub const EV_DELETE: u16 = 0x2; 537 pub const EV_ENABLE: u16 = 0x4; 538 pub const EV_DISABLE: u16 = 0x8; 539 pub const EV_ONESHOT: u16 = 0x10; 540 pub const EV_CLEAR: u16 = 0x20; 541 pub const EV_RECEIPT: u16 = 0x40; 542 pub const EV_DISPATCH: u16 = 0x80; 543 pub const EV_DROP: u16 = 0x1000; 544 pub const EV_FLAG1: u16 = 0x2000; 545 pub const EV_ERROR: u16 = 0x4000; 546 pub const EV_EOF: u16 = 0x8000; 547 pub const EV_SYSFLAGS: u16 = 0xf000; 548 549 pub const NOTE_TRIGGER: u32 = 0x01000000; 550 pub const NOTE_FFNOP: u32 = 0x00000000; 551 pub const NOTE_FFAND: u32 = 0x40000000; 552 pub const NOTE_FFOR: u32 = 0x80000000; 553 pub const NOTE_FFCOPY: u32 = 0xc0000000; 554 pub const NOTE_FFCTRLMASK: u32 = 0xc0000000; 555 pub const NOTE_FFLAGSMASK: u32 = 0x00ffffff; 556 pub const NOTE_LOWAT: u32 = 0x00000001; 557 pub const NOTE_DELETE: u32 = 0x00000001; 558 pub const NOTE_WRITE: u32 = 0x00000002; 559 pub const NOTE_EXTEND: u32 = 0x00000004; 560 pub const NOTE_ATTRIB: u32 = 0x00000008; 561 pub const NOTE_LINK: u32 = 0x00000010; 562 pub const NOTE_RENAME: u32 = 0x00000020; 563 pub const NOTE_REVOKE: u32 = 0x00000040; 564 pub const NOTE_EXIT: u32 = 0x80000000; 565 pub const NOTE_FORK: u32 = 0x40000000; 566 pub const NOTE_EXEC: u32 = 0x20000000; 567 pub const NOTE_PDATAMASK: u32 = 0x000fffff; 568 pub const NOTE_PCTRLMASK: u32 = 0xf0000000; 569 pub const NOTE_TRACK: u32 = 0x00000001; 570 pub const NOTE_TRACKERR: u32 = 0x00000002; 571 pub const NOTE_CHILD: u32 = 0x00000004; 572 pub const NOTE_SECONDS: u32 = 0x00000001; 573 pub const NOTE_MSECONDS: u32 = 0x00000002; 574 pub const NOTE_USECONDS: u32 = 0x00000004; 575 pub const NOTE_NSECONDS: u32 = 0x00000008; 576 577 pub const MADV_PROTECT: ::c_int = 10; 578 pub const RUSAGE_THREAD: ::c_int = 1; 579 580 #[doc(hidden)] 581 #[deprecated( 582 since = "0.2.72", 583 note = "CTL_UNSPEC is deprecated. Use CTL_SYSCTL instead" 584 )] 585 pub const CTL_UNSPEC: ::c_int = 0; 586 pub const CTL_SYSCTL: ::c_int = 0; 587 pub const CTL_KERN: ::c_int = 1; 588 pub const CTL_VM: ::c_int = 2; 589 pub const CTL_VFS: ::c_int = 3; 590 pub const CTL_NET: ::c_int = 4; 591 pub const CTL_DEBUG: ::c_int = 5; 592 pub const CTL_HW: ::c_int = 6; 593 pub const CTL_MACHDEP: ::c_int = 7; 594 pub const CTL_USER: ::c_int = 8; 595 pub const CTL_P1003_1B: ::c_int = 9; 596 pub const CTL_SYSCTL_DEBUG: ::c_int = 0; 597 pub const CTL_SYSCTL_NAME: ::c_int = 1; 598 pub const CTL_SYSCTL_NEXT: ::c_int = 2; 599 pub const CTL_SYSCTL_NAME2OID: ::c_int = 3; 600 pub const CTL_SYSCTL_OIDFMT: ::c_int = 4; 601 pub const CTL_SYSCTL_OIDDESCR: ::c_int = 5; 602 pub const CTL_SYSCTL_OIDLABEL: ::c_int = 6; 603 pub const KERN_OSTYPE: ::c_int = 1; 604 pub const KERN_OSRELEASE: ::c_int = 2; 605 pub const KERN_OSREV: ::c_int = 3; 606 pub const KERN_VERSION: ::c_int = 4; 607 pub const KERN_MAXVNODES: ::c_int = 5; 608 pub const KERN_MAXPROC: ::c_int = 6; 609 pub const KERN_MAXFILES: ::c_int = 7; 610 pub const KERN_ARGMAX: ::c_int = 8; 611 pub const KERN_SECURELVL: ::c_int = 9; 612 pub const KERN_HOSTNAME: ::c_int = 10; 613 pub const KERN_HOSTID: ::c_int = 11; 614 pub const KERN_CLOCKRATE: ::c_int = 12; 615 pub const KERN_VNODE: ::c_int = 13; 616 pub const KERN_PROC: ::c_int = 14; 617 pub const KERN_FILE: ::c_int = 15; 618 pub const KERN_PROF: ::c_int = 16; 619 pub const KERN_POSIX1: ::c_int = 17; 620 pub const KERN_NGROUPS: ::c_int = 18; 621 pub const KERN_JOB_CONTROL: ::c_int = 19; 622 pub const KERN_SAVED_IDS: ::c_int = 20; 623 pub const KERN_BOOTTIME: ::c_int = 21; 624 pub const KERN_NISDOMAINNAME: ::c_int = 22; 625 pub const KERN_UPDATEINTERVAL: ::c_int = 23; 626 pub const KERN_OSRELDATE: ::c_int = 24; 627 pub const KERN_NTP_PLL: ::c_int = 25; 628 pub const KERN_BOOTFILE: ::c_int = 26; 629 pub const KERN_MAXFILESPERPROC: ::c_int = 27; 630 pub const KERN_MAXPROCPERUID: ::c_int = 28; 631 pub const KERN_DUMPDEV: ::c_int = 29; 632 pub const KERN_IPC: ::c_int = 30; 633 pub const KERN_DUMMY: ::c_int = 31; 634 pub const KERN_PS_STRINGS: ::c_int = 32; 635 pub const KERN_USRSTACK: ::c_int = 33; 636 pub const KERN_LOGSIGEXIT: ::c_int = 34; 637 pub const KERN_IOV_MAX: ::c_int = 35; 638 pub const KERN_HOSTUUID: ::c_int = 36; 639 pub const KERN_ARND: ::c_int = 37; 640 pub const KERN_PROC_ALL: ::c_int = 0; 641 pub const KERN_PROC_PID: ::c_int = 1; 642 pub const KERN_PROC_PGRP: ::c_int = 2; 643 pub const KERN_PROC_SESSION: ::c_int = 3; 644 pub const KERN_PROC_TTY: ::c_int = 4; 645 pub const KERN_PROC_UID: ::c_int = 5; 646 pub const KERN_PROC_RUID: ::c_int = 6; 647 pub const KERN_PROC_ARGS: ::c_int = 7; 648 pub const KERN_PROC_PROC: ::c_int = 8; 649 pub const KERN_PROC_SV_NAME: ::c_int = 9; 650 pub const KERN_PROC_RGID: ::c_int = 10; 651 pub const KERN_PROC_GID: ::c_int = 11; 652 pub const KERN_PROC_PATHNAME: ::c_int = 12; 653 pub const KERN_PROC_OVMMAP: ::c_int = 13; 654 pub const KERN_PROC_OFILEDESC: ::c_int = 14; 655 pub const KERN_PROC_KSTACK: ::c_int = 15; 656 pub const KERN_PROC_INC_THREAD: ::c_int = 0x10; 657 pub const KERN_PROC_VMMAP: ::c_int = 32; 658 pub const KERN_PROC_FILEDESC: ::c_int = 33; 659 pub const KERN_PROC_GROUPS: ::c_int = 34; 660 pub const KERN_PROC_ENV: ::c_int = 35; 661 pub const KERN_PROC_AUXV: ::c_int = 36; 662 pub const KERN_PROC_RLIMIT: ::c_int = 37; 663 pub const KERN_PROC_PS_STRINGS: ::c_int = 38; 664 pub const KERN_PROC_UMASK: ::c_int = 39; 665 pub const KERN_PROC_OSREL: ::c_int = 40; 666 pub const KERN_PROC_SIGTRAMP: ::c_int = 41; 667 pub const KIPC_MAXSOCKBUF: ::c_int = 1; 668 pub const KIPC_SOCKBUF_WASTE: ::c_int = 2; 669 pub const KIPC_SOMAXCONN: ::c_int = 3; 670 pub const KIPC_MAX_LINKHDR: ::c_int = 4; 671 pub const KIPC_MAX_PROTOHDR: ::c_int = 5; 672 pub const KIPC_MAX_HDR: ::c_int = 6; 673 pub const KIPC_MAX_DATALEN: ::c_int = 7; 674 pub const HW_MACHINE: ::c_int = 1; 675 pub const HW_MODEL: ::c_int = 2; 676 pub const HW_NCPU: ::c_int = 3; 677 pub const HW_BYTEORDER: ::c_int = 4; 678 pub const HW_PHYSMEM: ::c_int = 5; 679 pub const HW_USERMEM: ::c_int = 6; 680 pub const HW_PAGESIZE: ::c_int = 7; 681 pub const HW_DISKNAMES: ::c_int = 8; 682 pub const HW_DISKSTATS: ::c_int = 9; 683 pub const HW_FLOATINGPT: ::c_int = 10; 684 pub const HW_MACHINE_ARCH: ::c_int = 11; 685 pub const HW_REALMEM: ::c_int = 12; 686 pub const USER_CS_PATH: ::c_int = 1; 687 pub const USER_BC_BASE_MAX: ::c_int = 2; 688 pub const USER_BC_DIM_MAX: ::c_int = 3; 689 pub const USER_BC_SCALE_MAX: ::c_int = 4; 690 pub const USER_BC_STRING_MAX: ::c_int = 5; 691 pub const USER_COLL_WEIGHTS_MAX: ::c_int = 6; 692 pub const USER_EXPR_NEST_MAX: ::c_int = 7; 693 pub const USER_LINE_MAX: ::c_int = 8; 694 pub const USER_RE_DUP_MAX: ::c_int = 9; 695 pub const USER_POSIX2_VERSION: ::c_int = 10; 696 pub const USER_POSIX2_C_BIND: ::c_int = 11; 697 pub const USER_POSIX2_C_DEV: ::c_int = 12; 698 pub const USER_POSIX2_CHAR_TERM: ::c_int = 13; 699 pub const USER_POSIX2_FORT_DEV: ::c_int = 14; 700 pub const USER_POSIX2_FORT_RUN: ::c_int = 15; 701 pub const USER_POSIX2_LOCALEDEF: ::c_int = 16; 702 pub const USER_POSIX2_SW_DEV: ::c_int = 17; 703 pub const USER_POSIX2_UPE: ::c_int = 18; 704 pub const USER_STREAM_MAX: ::c_int = 19; 705 pub const USER_TZNAME_MAX: ::c_int = 20; 706 pub const CTL_P1003_1B_ASYNCHRONOUS_IO: ::c_int = 1; 707 pub const CTL_P1003_1B_MAPPED_FILES: ::c_int = 2; 708 pub const CTL_P1003_1B_MEMLOCK: ::c_int = 3; 709 pub const CTL_P1003_1B_MEMLOCK_RANGE: ::c_int = 4; 710 pub const CTL_P1003_1B_MEMORY_PROTECTION: ::c_int = 5; 711 pub const CTL_P1003_1B_MESSAGE_PASSING: ::c_int = 6; 712 pub const CTL_P1003_1B_PRIORITIZED_IO: ::c_int = 7; 713 pub const CTL_P1003_1B_PRIORITY_SCHEDULING: ::c_int = 8; 714 pub const CTL_P1003_1B_REALTIME_SIGNALS: ::c_int = 9; 715 pub const CTL_P1003_1B_SEMAPHORES: ::c_int = 10; 716 pub const CTL_P1003_1B_FSYNC: ::c_int = 11; 717 pub const CTL_P1003_1B_SHARED_MEMORY_OBJECTS: ::c_int = 12; 718 pub const CTL_P1003_1B_SYNCHRONIZED_IO: ::c_int = 13; 719 pub const CTL_P1003_1B_TIMERS: ::c_int = 14; 720 pub const CTL_P1003_1B_AIO_LISTIO_MAX: ::c_int = 15; 721 pub const CTL_P1003_1B_AIO_MAX: ::c_int = 16; 722 pub const CTL_P1003_1B_AIO_PRIO_DELTA_MAX: ::c_int = 17; 723 pub const CTL_P1003_1B_DELAYTIMER_MAX: ::c_int = 18; 724 pub const CTL_P1003_1B_MQ_OPEN_MAX: ::c_int = 19; 725 pub const CTL_P1003_1B_PAGESIZE: ::c_int = 20; 726 pub const CTL_P1003_1B_RTSIG_MAX: ::c_int = 21; 727 pub const CTL_P1003_1B_SEM_NSEMS_MAX: ::c_int = 22; 728 pub const CTL_P1003_1B_SEM_VALUE_MAX: ::c_int = 23; 729 pub const CTL_P1003_1B_SIGQUEUE_MAX: ::c_int = 24; 730 pub const CTL_P1003_1B_TIMER_MAX: ::c_int = 25; 731 pub const TIOCGPTN: ::c_uint = 0x4004740f; 732 pub const TIOCPTMASTER: ::c_uint = 0x2000741c; 733 pub const TIOCSIG: ::c_uint = 0x2004745f; 734 pub const TIOCM_DCD: ::c_int = 0x40; 735 pub const H4DISC: ::c_int = 0x7; 736 737 pub const BIOCSETFNR: ::c_ulong = 0x80104282; 738 739 pub const FIONWRITE: ::c_ulong = 0x40046677; 740 pub const FIONSPACE: ::c_ulong = 0x40046676; 741 pub const FIOSEEKDATA: ::c_ulong = 0xc0086661; 742 pub const FIOSEEKHOLE: ::c_ulong = 0xc0086662; 743 744 pub const JAIL_API_VERSION: u32 = 2; 745 pub const JAIL_CREATE: ::c_int = 0x01; 746 pub const JAIL_UPDATE: ::c_int = 0x02; 747 pub const JAIL_ATTACH: ::c_int = 0x04; 748 pub const JAIL_DYING: ::c_int = 0x08; 749 pub const JAIL_SET_MASK: ::c_int = 0x0f; 750 pub const JAIL_GET_MASK: ::c_int = 0x08; 751 pub const JAIL_SYS_DISABLE: ::c_int = 0; 752 pub const JAIL_SYS_NEW: ::c_int = 1; 753 pub const JAIL_SYS_INHERIT: ::c_int = 2; 754 755 pub const MNT_ACLS: ::c_int = 0x08000000; 756 pub const MNT_BYFSID: ::c_int = 0x08000000; 757 pub const MNT_GJOURNAL: ::c_int = 0x02000000; 758 pub const MNT_MULTILABEL: ::c_int = 0x04000000; 759 pub const MNT_NFS4ACLS: ::c_int = 0x00000010; 760 pub const MNT_SNAPSHOT: ::c_int = 0x01000000; 761 pub const MNT_UNION: ::c_int = 0x00000020; 762 pub const MNT_EXPUBLIC: ::c_int = 0x20000000; 763 pub const MNT_NONBUSY: ::c_int = 0x04000000; 764 765 pub const SO_BINTIME: ::c_int = 0x2000; 766 pub const SO_NO_OFFLOAD: ::c_int = 0x4000; 767 pub const SO_NO_DDP: ::c_int = 0x8000; 768 pub const SO_REUSEPORT_LB: ::c_int = 0x10000; 769 pub const SO_LABEL: ::c_int = 0x1009; 770 pub const SO_PEERLABEL: ::c_int = 0x1010; 771 pub const SO_LISTENQLIMIT: ::c_int = 0x1011; 772 pub const SO_LISTENQLEN: ::c_int = 0x1012; 773 pub const SO_LISTENINCQLEN: ::c_int = 0x1013; 774 pub const SO_SETFIB: ::c_int = 0x1014; 775 pub const SO_USER_COOKIE: ::c_int = 0x1015; 776 pub const SO_PROTOCOL: ::c_int = 0x1016; 777 pub const SO_PROTOTYPE: ::c_int = SO_PROTOCOL; 778 pub const SO_VENDOR: ::c_int = 0x80000000; 779 780 pub const LOCAL_CREDS: ::c_int = 2; 781 pub const LOCAL_CONNWAIT: ::c_int = 4; 782 pub const LOCAL_VENDOR: ::c_int = SO_VENDOR; 783 784 pub const PT_LWPINFO: ::c_int = 13; 785 pub const PT_GETNUMLWPS: ::c_int = 14; 786 pub const PT_GETLWPLIST: ::c_int = 15; 787 pub const PT_CLEARSTEP: ::c_int = 16; 788 pub const PT_SETSTEP: ::c_int = 17; 789 pub const PT_SUSPEND: ::c_int = 18; 790 pub const PT_RESUME: ::c_int = 19; 791 pub const PT_TO_SCE: ::c_int = 20; 792 pub const PT_TO_SCX: ::c_int = 21; 793 pub const PT_SYSCALL: ::c_int = 22; 794 pub const PT_FOLLOW_FORK: ::c_int = 23; 795 pub const PT_LWP_EVENTS: ::c_int = 24; 796 pub const PT_GET_EVENT_MASK: ::c_int = 25; 797 pub const PT_SET_EVENT_MASK: ::c_int = 26; 798 pub const PT_GETREGS: ::c_int = 33; 799 pub const PT_SETREGS: ::c_int = 34; 800 pub const PT_GETFPREGS: ::c_int = 35; 801 pub const PT_SETFPREGS: ::c_int = 36; 802 pub const PT_GETDBREGS: ::c_int = 37; 803 pub const PT_SETDBREGS: ::c_int = 38; 804 pub const PT_VM_TIMESTAMP: ::c_int = 40; 805 pub const PT_VM_ENTRY: ::c_int = 41; 806 pub const PT_FIRSTMACH: ::c_int = 64; 807 808 pub const PTRACE_EXEC: ::c_int = 0x0001; 809 pub const PTRACE_SCE: ::c_int = 0x0002; 810 pub const PTRACE_SCX: ::c_int = 0x0004; 811 pub const PTRACE_SYSCALL: ::c_int = PTRACE_SCE | PTRACE_SCX; 812 pub const PTRACE_FORK: ::c_int = 0x0008; 813 pub const PTRACE_LWP: ::c_int = 0x0010; 814 pub const PTRACE_VFORK: ::c_int = 0x0020; 815 pub const PTRACE_DEFAULT: ::c_int = PTRACE_EXEC; 816 817 pub const AF_SLOW: ::c_int = 33; 818 pub const AF_SCLUSTER: ::c_int = 34; 819 pub const AF_ARP: ::c_int = 35; 820 pub const AF_BLUETOOTH: ::c_int = 36; 821 pub const AF_IEEE80211: ::c_int = 37; 822 pub const AF_INET_SDP: ::c_int = 40; 823 pub const AF_INET6_SDP: ::c_int = 42; 824 825 // https://github.com/freebsd/freebsd/blob/master/sys/net/if.h#L140 826 pub const IFF_UP: ::c_int = 0x1; // (n) interface is up 827 pub const IFF_BROADCAST: ::c_int = 0x2; // (i) broadcast address valid 828 pub const IFF_DEBUG: ::c_int = 0x4; // (n) turn on debugging 829 pub const IFF_LOOPBACK: ::c_int = 0x8; // (i) is a loopback net 830 pub const IFF_POINTOPOINT: ::c_int = 0x10; // (i) is a point-to-point link 831 // 0x20 was IFF_SMART 832 pub const IFF_RUNNING: ::c_int = 0x40; // (d) resources allocated 833 #[doc(hidden)] 834 #[deprecated( 835 since = "0.2.54", 836 note = "IFF_DRV_RUNNING is deprecated. Use the portable IFF_RUNNING instead" 837 )] 838 pub const IFF_DRV_RUNNING: ::c_int = 0x40; 839 pub const IFF_NOARP: ::c_int = 0x80; // (n) no address resolution protocol 840 pub const IFF_PROMISC: ::c_int = 0x100; // (n) receive all packets 841 pub const IFF_ALLMULTI: ::c_int = 0x200; // (n) receive all multicast packets 842 pub const IFF_OACTIVE: ::c_int = 0x400; // (d) tx hardware queue is full 843 #[doc(hidden)] 844 #[deprecated(since = "0.2.54", note = "Use the portable `IFF_OACTIVE` instead")] 845 pub const IFF_DRV_OACTIVE: ::c_int = 0x400; 846 pub const IFF_SIMPLEX: ::c_int = 0x800; // (i) can't hear own transmissions 847 pub const IFF_LINK0: ::c_int = 0x1000; // per link layer defined bit 848 pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit 849 pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit 850 pub const IFF_ALTPHYS: ::c_int = IFF_LINK2; // use alternate physical connection 851 pub const IFF_MULTICAST: ::c_int = 0x8000; // (i) supports multicast 852 // (i) unconfigurable using ioctl(2) 853 pub const IFF_CANTCONFIG: ::c_int = 0x10000; 854 pub const IFF_PPROMISC: ::c_int = 0x20000; // (n) user-requested promisc mode 855 pub const IFF_MONITOR: ::c_int = 0x40000; // (n) user-requested monitor mode 856 pub const IFF_STATICARP: ::c_int = 0x80000; // (n) static ARP 857 pub const IFF_DYING: ::c_int = 0x200000; // (n) interface is winding down 858 pub const IFF_RENAMING: ::c_int = 0x400000; // (n) interface is being renamed 859 860 // sys/netinet/in.h 861 // Protocols (RFC 1700) 862 // NOTE: These are in addition to the constants defined in src/unix/mod.rs 863 864 // IPPROTO_IP defined in src/unix/mod.rs 865 /// IP6 hop-by-hop options 866 pub const IPPROTO_HOPOPTS: ::c_int = 0; 867 // IPPROTO_ICMP defined in src/unix/mod.rs 868 /// group mgmt protocol 869 pub const IPPROTO_IGMP: ::c_int = 2; 870 /// gateway^2 (deprecated) 871 pub const IPPROTO_GGP: ::c_int = 3; 872 /// for compatibility 873 pub const IPPROTO_IPIP: ::c_int = 4; 874 // IPPROTO_TCP defined in src/unix/mod.rs 875 /// Stream protocol II. 876 pub const IPPROTO_ST: ::c_int = 7; 877 /// exterior gateway protocol 878 pub const IPPROTO_EGP: ::c_int = 8; 879 /// private interior gateway 880 pub const IPPROTO_PIGP: ::c_int = 9; 881 /// BBN RCC Monitoring 882 pub const IPPROTO_RCCMON: ::c_int = 10; 883 /// network voice protocol 884 pub const IPPROTO_NVPII: ::c_int = 11; 885 /// pup 886 pub const IPPROTO_PUP: ::c_int = 12; 887 /// Argus 888 pub const IPPROTO_ARGUS: ::c_int = 13; 889 /// EMCON 890 pub const IPPROTO_EMCON: ::c_int = 14; 891 /// Cross Net Debugger 892 pub const IPPROTO_XNET: ::c_int = 15; 893 /// Chaos 894 pub const IPPROTO_CHAOS: ::c_int = 16; 895 // IPPROTO_UDP defined in src/unix/mod.rs 896 /// Multiplexing 897 pub const IPPROTO_MUX: ::c_int = 18; 898 /// DCN Measurement Subsystems 899 pub const IPPROTO_MEAS: ::c_int = 19; 900 /// Host Monitoring 901 pub const IPPROTO_HMP: ::c_int = 20; 902 /// Packet Radio Measurement 903 pub const IPPROTO_PRM: ::c_int = 21; 904 /// xns idp 905 pub const IPPROTO_IDP: ::c_int = 22; 906 /// Trunk-1 907 pub const IPPROTO_TRUNK1: ::c_int = 23; 908 /// Trunk-2 909 pub const IPPROTO_TRUNK2: ::c_int = 24; 910 /// Leaf-1 911 pub const IPPROTO_LEAF1: ::c_int = 25; 912 /// Leaf-2 913 pub const IPPROTO_LEAF2: ::c_int = 26; 914 /// Reliable Data 915 pub const IPPROTO_RDP: ::c_int = 27; 916 /// Reliable Transaction 917 pub const IPPROTO_IRTP: ::c_int = 28; 918 /// tp-4 w/ class negotiation 919 pub const IPPROTO_TP: ::c_int = 29; 920 /// Bulk Data Transfer 921 pub const IPPROTO_BLT: ::c_int = 30; 922 /// Network Services 923 pub const IPPROTO_NSP: ::c_int = 31; 924 /// Merit Internodal 925 pub const IPPROTO_INP: ::c_int = 32; 926 #[doc(hidden)] 927 #[deprecated( 928 since = "0.2.72", 929 note = "IPPROTO_SEP is deprecated. Use IPPROTO_DCCP instead" 930 )] 931 pub const IPPROTO_SEP: ::c_int = 33; 932 /// Datagram Congestion Control Protocol 933 pub const IPPROTO_DCCP: ::c_int = 33; 934 /// Third Party Connect 935 pub const IPPROTO_3PC: ::c_int = 34; 936 /// InterDomain Policy Routing 937 pub const IPPROTO_IDPR: ::c_int = 35; 938 /// XTP 939 pub const IPPROTO_XTP: ::c_int = 36; 940 /// Datagram Delivery 941 pub const IPPROTO_DDP: ::c_int = 37; 942 /// Control Message Transport 943 pub const IPPROTO_CMTP: ::c_int = 38; 944 /// TP++ Transport 945 pub const IPPROTO_TPXX: ::c_int = 39; 946 /// IL transport protocol 947 pub const IPPROTO_IL: ::c_int = 40; 948 // IPPROTO_IPV6 defined in src/unix/mod.rs 949 /// Source Demand Routing 950 pub const IPPROTO_SDRP: ::c_int = 42; 951 /// IP6 routing header 952 pub const IPPROTO_ROUTING: ::c_int = 43; 953 /// IP6 fragmentation header 954 pub const IPPROTO_FRAGMENT: ::c_int = 44; 955 /// InterDomain Routing 956 pub const IPPROTO_IDRP: ::c_int = 45; 957 /// resource reservation 958 pub const IPPROTO_RSVP: ::c_int = 46; 959 /// General Routing Encap. 960 pub const IPPROTO_GRE: ::c_int = 47; 961 /// Mobile Host Routing 962 pub const IPPROTO_MHRP: ::c_int = 48; 963 /// BHA 964 pub const IPPROTO_BHA: ::c_int = 49; 965 /// IP6 Encap Sec. Payload 966 pub const IPPROTO_ESP: ::c_int = 50; 967 /// IP6 Auth Header 968 pub const IPPROTO_AH: ::c_int = 51; 969 /// Integ. Net Layer Security 970 pub const IPPROTO_INLSP: ::c_int = 52; 971 /// IP with encryption 972 pub const IPPROTO_SWIPE: ::c_int = 53; 973 /// Next Hop Resolution 974 pub const IPPROTO_NHRP: ::c_int = 54; 975 /// IP Mobility 976 pub const IPPROTO_MOBILE: ::c_int = 55; 977 /// Transport Layer Security 978 pub const IPPROTO_TLSP: ::c_int = 56; 979 /// SKIP 980 pub const IPPROTO_SKIP: ::c_int = 57; 981 // IPPROTO_ICMPV6 defined in src/unix/mod.rs 982 /// IP6 no next header 983 pub const IPPROTO_NONE: ::c_int = 59; 984 /// IP6 destination option 985 pub const IPPROTO_DSTOPTS: ::c_int = 60; 986 /// any host internal protocol 987 pub const IPPROTO_AHIP: ::c_int = 61; 988 /// CFTP 989 pub const IPPROTO_CFTP: ::c_int = 62; 990 /// "hello" routing protocol 991 pub const IPPROTO_HELLO: ::c_int = 63; 992 /// SATNET/Backroom EXPAK 993 pub const IPPROTO_SATEXPAK: ::c_int = 64; 994 /// Kryptolan 995 pub const IPPROTO_KRYPTOLAN: ::c_int = 65; 996 /// Remote Virtual Disk 997 pub const IPPROTO_RVD: ::c_int = 66; 998 /// Pluribus Packet Core 999 pub const IPPROTO_IPPC: ::c_int = 67; 1000 /// Any distributed FS 1001 pub const IPPROTO_ADFS: ::c_int = 68; 1002 /// Satnet Monitoring 1003 pub const IPPROTO_SATMON: ::c_int = 69; 1004 /// VISA Protocol 1005 pub const IPPROTO_VISA: ::c_int = 70; 1006 /// Packet Core Utility 1007 pub const IPPROTO_IPCV: ::c_int = 71; 1008 /// Comp. Prot. Net. Executive 1009 pub const IPPROTO_CPNX: ::c_int = 72; 1010 /// Comp. Prot. HeartBeat 1011 pub const IPPROTO_CPHB: ::c_int = 73; 1012 /// Wang Span Network 1013 pub const IPPROTO_WSN: ::c_int = 74; 1014 /// Packet Video Protocol 1015 pub const IPPROTO_PVP: ::c_int = 75; 1016 /// BackRoom SATNET Monitoring 1017 pub const IPPROTO_BRSATMON: ::c_int = 76; 1018 /// Sun net disk proto (temp.) 1019 pub const IPPROTO_ND: ::c_int = 77; 1020 /// WIDEBAND Monitoring 1021 pub const IPPROTO_WBMON: ::c_int = 78; 1022 /// WIDEBAND EXPAK 1023 pub const IPPROTO_WBEXPAK: ::c_int = 79; 1024 /// ISO cnlp 1025 pub const IPPROTO_EON: ::c_int = 80; 1026 /// VMTP 1027 pub const IPPROTO_VMTP: ::c_int = 81; 1028 /// Secure VMTP 1029 pub const IPPROTO_SVMTP: ::c_int = 82; 1030 /// Banyon VINES 1031 pub const IPPROTO_VINES: ::c_int = 83; 1032 /// TTP 1033 pub const IPPROTO_TTP: ::c_int = 84; 1034 /// NSFNET-IGP 1035 pub const IPPROTO_IGP: ::c_int = 85; 1036 /// dissimilar gateway prot. 1037 pub const IPPROTO_DGP: ::c_int = 86; 1038 /// TCF 1039 pub const IPPROTO_TCF: ::c_int = 87; 1040 /// Cisco/GXS IGRP 1041 pub const IPPROTO_IGRP: ::c_int = 88; 1042 /// OSPFIGP 1043 pub const IPPROTO_OSPFIGP: ::c_int = 89; 1044 /// Strite RPC protocol 1045 pub const IPPROTO_SRPC: ::c_int = 90; 1046 /// Locus Address Resoloution 1047 pub const IPPROTO_LARP: ::c_int = 91; 1048 /// Multicast Transport 1049 pub const IPPROTO_MTP: ::c_int = 92; 1050 /// AX.25 Frames 1051 pub const IPPROTO_AX25: ::c_int = 93; 1052 /// IP encapsulated in IP 1053 pub const IPPROTO_IPEIP: ::c_int = 94; 1054 /// Mobile Int.ing control 1055 pub const IPPROTO_MICP: ::c_int = 95; 1056 /// Semaphore Comm. security 1057 pub const IPPROTO_SCCSP: ::c_int = 96; 1058 /// Ethernet IP encapsulation 1059 pub const IPPROTO_ETHERIP: ::c_int = 97; 1060 /// encapsulation header 1061 pub const IPPROTO_ENCAP: ::c_int = 98; 1062 /// any private encr. scheme 1063 pub const IPPROTO_APES: ::c_int = 99; 1064 /// GMTP 1065 pub const IPPROTO_GMTP: ::c_int = 100; 1066 /// payload compression (IPComp) 1067 pub const IPPROTO_IPCOMP: ::c_int = 108; 1068 /// SCTP 1069 pub const IPPROTO_SCTP: ::c_int = 132; 1070 /// IPv6 Mobility Header 1071 pub const IPPROTO_MH: ::c_int = 135; 1072 /// UDP-Lite 1073 pub const IPPROTO_UDPLITE: ::c_int = 136; 1074 /// IP6 Host Identity Protocol 1075 pub const IPPROTO_HIP: ::c_int = 139; 1076 /// IP6 Shim6 Protocol 1077 pub const IPPROTO_SHIM6: ::c_int = 140; 1078 1079 /* 101-254: Partly Unassigned */ 1080 /// Protocol Independent Mcast 1081 pub const IPPROTO_PIM: ::c_int = 103; 1082 /// CARP 1083 pub const IPPROTO_CARP: ::c_int = 112; 1084 /// PGM 1085 pub const IPPROTO_PGM: ::c_int = 113; 1086 /// MPLS-in-IP 1087 pub const IPPROTO_MPLS: ::c_int = 137; 1088 /// PFSYNC 1089 pub const IPPROTO_PFSYNC: ::c_int = 240; 1090 1091 /* 255: Reserved */ 1092 /* BSD Private, local use, namespace incursion, no longer used */ 1093 /// OLD divert pseudo-proto 1094 pub const IPPROTO_OLD_DIVERT: ::c_int = 254; 1095 pub const IPPROTO_MAX: ::c_int = 256; 1096 /// last return value of *_input(), meaning "all job for this pkt is done". 1097 pub const IPPROTO_DONE: ::c_int = 257; 1098 1099 /* Only used internally, so can be outside the range of valid IP protocols. */ 1100 /// divert pseudo-protocol 1101 pub const IPPROTO_DIVERT: ::c_int = 258; 1102 /// SeND pseudo-protocol 1103 pub const IPPROTO_SEND: ::c_int = 259; 1104 1105 // sys/netinet/TCP.h 1106 pub const TCP_MD5SIG: ::c_int = 16; 1107 pub const TCP_INFO: ::c_int = 32; 1108 pub const TCP_CONGESTION: ::c_int = 64; 1109 pub const TCP_CCALGOOPT: ::c_int = 65; 1110 pub const TCP_KEEPINIT: ::c_int = 128; 1111 pub const TCP_FASTOPEN: ::c_int = 1025; 1112 pub const TCP_PCAP_OUT: ::c_int = 2048; 1113 pub const TCP_PCAP_IN: ::c_int = 4096; 1114 1115 pub const IP_BINDANY: ::c_int = 24; 1116 pub const IP_BINDMULTI: ::c_int = 25; 1117 pub const IP_RSS_LISTEN_BUCKET: ::c_int = 26; 1118 pub const IP_ORIGDSTADDR: ::c_int = 27; 1119 pub const IP_RECVORIGDSTADDR: ::c_int = IP_ORIGDSTADDR; 1120 1121 pub const IP_RECVTOS: ::c_int = 68; 1122 1123 pub const IPV6_BINDANY: ::c_int = 64; 1124 pub const IPV6_ORIGDSTADDR: ::c_int = 72; 1125 pub const IPV6_RECVORIGDSTADDR: ::c_int = IPV6_ORIGDSTADDR; 1126 1127 pub const PF_SLOW: ::c_int = AF_SLOW; 1128 pub const PF_SCLUSTER: ::c_int = AF_SCLUSTER; 1129 pub const PF_ARP: ::c_int = AF_ARP; 1130 pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH; 1131 pub const PF_IEEE80211: ::c_int = AF_IEEE80211; 1132 pub const PF_INET_SDP: ::c_int = AF_INET_SDP; 1133 pub const PF_INET6_SDP: ::c_int = AF_INET6_SDP; 1134 1135 pub const NET_RT_DUMP: ::c_int = 1; 1136 pub const NET_RT_FLAGS: ::c_int = 2; 1137 pub const NET_RT_IFLIST: ::c_int = 3; 1138 pub const NET_RT_IFMALIST: ::c_int = 4; 1139 pub const NET_RT_IFLISTL: ::c_int = 5; 1140 1141 // System V IPC 1142 pub const IPC_PRIVATE: ::key_t = 0; 1143 pub const IPC_CREAT: ::c_int = 0o1000; 1144 pub const IPC_EXCL: ::c_int = 0o2000; 1145 pub const IPC_NOWAIT: ::c_int = 0o4000; 1146 pub const IPC_RMID: ::c_int = 0; 1147 pub const IPC_SET: ::c_int = 1; 1148 pub const IPC_STAT: ::c_int = 2; 1149 pub const IPC_INFO: ::c_int = 3; 1150 pub const IPC_R: ::c_int = 0o400; 1151 pub const IPC_W: ::c_int = 0o200; 1152 pub const IPC_M: ::c_int = 0o10000; 1153 pub const MSG_NOERROR: ::c_int = 0o10000; 1154 pub const SHM_RDONLY: ::c_int = 0o10000; 1155 pub const SHM_RND: ::c_int = 0o20000; 1156 pub const SHM_R: ::c_int = 0o400; 1157 pub const SHM_W: ::c_int = 0o200; 1158 pub const SHM_LOCK: ::c_int = 11; 1159 pub const SHM_UNLOCK: ::c_int = 12; 1160 pub const SHM_STAT: ::c_int = 13; 1161 pub const SHM_INFO: ::c_int = 14; 1162 pub const SHM_ANON: *mut ::c_char = 1 as *mut ::c_char; 1163 1164 // The *_MAXID constants never should've been used outside of the 1165 // FreeBSD base system. And with the exception of CTL_P1003_1B_MAXID, 1166 // they were all removed in svn r262489. They remain here for backwards 1167 // compatibility only, and are scheduled to be removed in libc 1.0.0. 1168 #[doc(hidden)] 1169 #[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")] 1170 pub const CTL_MAXID: ::c_int = 10; 1171 #[doc(hidden)] 1172 #[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")] 1173 pub const KERN_MAXID: ::c_int = 38; 1174 #[doc(hidden)] 1175 #[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")] 1176 pub const HW_MAXID: ::c_int = 13; 1177 #[doc(hidden)] 1178 #[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")] 1179 pub const USER_MAXID: ::c_int = 21; 1180 #[doc(hidden)] 1181 #[deprecated(since = "0.2.74", note = "Removed in FreeBSD 13")] 1182 pub const CTL_P1003_1B_MAXID: ::c_int = 26; 1183 1184 pub const MSG_NOTIFICATION: ::c_int = 0x00002000; 1185 pub const MSG_NBIO: ::c_int = 0x00004000; 1186 pub const MSG_COMPAT: ::c_int = 0x00008000; 1187 pub const MSG_CMSG_CLOEXEC: ::c_int = 0x00040000; 1188 pub const MSG_NOSIGNAL: ::c_int = 0x20000; 1189 1190 // utmpx entry types 1191 pub const EMPTY: ::c_short = 0; 1192 pub const BOOT_TIME: ::c_short = 1; 1193 pub const OLD_TIME: ::c_short = 2; 1194 pub const NEW_TIME: ::c_short = 3; 1195 pub const USER_PROCESS: ::c_short = 4; 1196 pub const INIT_PROCESS: ::c_short = 5; 1197 pub const LOGIN_PROCESS: ::c_short = 6; 1198 pub const DEAD_PROCESS: ::c_short = 7; 1199 pub const SHUTDOWN_TIME: ::c_short = 8; 1200 // utmp database types 1201 pub const UTXDB_ACTIVE: ::c_int = 0; 1202 pub const UTXDB_LASTLOGIN: ::c_int = 1; 1203 pub const UTXDB_LOG: ::c_int = 2; 1204 1205 pub const LC_COLLATE_MASK: ::c_int = 1 << 0; 1206 pub const LC_CTYPE_MASK: ::c_int = 1 << 1; 1207 pub const LC_MONETARY_MASK: ::c_int = 1 << 2; 1208 pub const LC_NUMERIC_MASK: ::c_int = 1 << 3; 1209 pub const LC_TIME_MASK: ::c_int = 1 << 4; 1210 pub const LC_MESSAGES_MASK: ::c_int = 1 << 5; 1211 pub const LC_ALL_MASK: ::c_int = LC_COLLATE_MASK 1212 | LC_CTYPE_MASK 1213 | LC_MESSAGES_MASK 1214 | LC_MONETARY_MASK 1215 | LC_NUMERIC_MASK 1216 | LC_TIME_MASK; 1217 1218 pub const WSTOPPED: ::c_int = 2; // same as WUNTRACED 1219 pub const WCONTINUED: ::c_int = 4; 1220 pub const WNOWAIT: ::c_int = 8; 1221 pub const WEXITED: ::c_int = 16; 1222 pub const WTRAPPED: ::c_int = 32; 1223 1224 // FreeBSD defines a great many more of these, we only expose the 1225 // standardized ones. 1226 pub const P_PID: idtype_t = 0; 1227 pub const P_PGID: idtype_t = 2; 1228 pub const P_ALL: idtype_t = 7; 1229 1230 pub const UTIME_OMIT: c_long = -2; 1231 pub const UTIME_NOW: c_long = -1; 1232 1233 pub const B460800: ::speed_t = 460800; 1234 pub const B921600: ::speed_t = 921600; 1235 1236 pub const AT_FDCWD: ::c_int = -100; 1237 pub const AT_EACCESS: ::c_int = 0x100; 1238 pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x200; 1239 pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400; 1240 pub const AT_REMOVEDIR: ::c_int = 0x800; 1241 1242 pub const TABDLY: ::tcflag_t = 0x00000004; 1243 pub const TAB0: ::tcflag_t = 0x00000000; 1244 pub const TAB3: ::tcflag_t = 0x00000004; 1245 1246 pub const _PC_ACL_NFS4: ::c_int = 64; 1247 1248 pub const _SC_CPUSET_SIZE: ::c_int = 122; 1249 1250 // Flags which can be passed to pdfork(2) 1251 pub const PD_DAEMON: ::c_int = 0x00000001; 1252 pub const PD_CLOEXEC: ::c_int = 0x00000002; 1253 pub const PD_ALLOWED_AT_FORK: ::c_int = PD_DAEMON | PD_CLOEXEC; 1254 1255 // Values for struct rtprio (type_ field) 1256 pub const RTP_PRIO_REALTIME: ::c_ushort = 2; 1257 pub const RTP_PRIO_NORMAL: ::c_ushort = 3; 1258 pub const RTP_PRIO_IDLE: ::c_ushort = 4; 1259 1260 pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x01; 1261 pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x02; 1262 pub const POSIX_SPAWN_SETSCHEDPARAM: ::c_int = 0x04; 1263 pub const POSIX_SPAWN_SETSCHEDULER: ::c_int = 0x08; 1264 pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x10; 1265 pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x20; 1266 1267 // Flags for chflags(2) 1268 pub const UF_SYSTEM: ::c_ulong = 0x00000080; 1269 pub const UF_SPARSE: ::c_ulong = 0x00000100; 1270 pub const UF_OFFLINE: ::c_ulong = 0x00000200; 1271 pub const UF_REPARSE: ::c_ulong = 0x00000400; 1272 pub const UF_ARCHIVE: ::c_ulong = 0x00000800; 1273 pub const UF_READONLY: ::c_ulong = 0x00001000; 1274 pub const UF_HIDDEN: ::c_ulong = 0x00008000; 1275 pub const SF_SNAPSHOT: ::c_ulong = 0x00200000; 1276 1277 pub const F_OGETLK: ::c_int = 7; 1278 pub const F_OSETLK: ::c_int = 8; 1279 pub const F_OSETLKW: ::c_int = 9; 1280 pub const F_DUP2FD: ::c_int = 10; 1281 pub const F_SETLK_REMOTE: ::c_int = 14; 1282 pub const F_READAHEAD: ::c_int = 15; 1283 pub const F_RDAHEAD: ::c_int = 16; 1284 pub const F_DUP2FD_CLOEXEC: ::c_int = 18; 1285 1286 // For realhostname* api 1287 pub const HOSTNAME_FOUND: ::c_int = 0; 1288 pub const HOSTNAME_INCORRECTNAME: ::c_int = 1; 1289 pub const HOSTNAME_INVALIDADDR: ::c_int = 2; 1290 pub const HOSTNAME_INVALIDNAME: ::c_int = 3; 1291 1292 // For rfork 1293 pub const RFFDG: ::c_int = 4; 1294 pub const RFPROC: ::c_int = 16; 1295 pub const RFMEM: ::c_int = 32; 1296 pub const RFNOWAIT: ::c_int = 64; 1297 pub const RFCFDG: ::c_int = 4096; 1298 pub const RFTHREAD: ::c_int = 8192; 1299 pub const RFLINUXTHPN: ::c_int = 65536; 1300 pub const RFTSIGZMB: ::c_int = 524288; 1301 pub const RFSPAWN: ::c_int = 2147483648; 1302 1303 const_fn! { 1304 {const} fn _ALIGN(p: usize) -> usize { 1305 (p + _ALIGNBYTES) & !_ALIGNBYTES 1306 } 1307 } 1308 1309 f! { 1310 pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar { 1311 (cmsg as *mut ::c_uchar) 1312 .offset(_ALIGN(::mem::size_of::<::cmsghdr>()) as isize) 1313 } 1314 1315 pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint { 1316 _ALIGN(::mem::size_of::<::cmsghdr>()) as ::c_uint + length 1317 } 1318 1319 pub fn CMSG_NXTHDR(mhdr: *const ::msghdr, cmsg: *const ::cmsghdr) 1320 -> *mut ::cmsghdr 1321 { 1322 if cmsg.is_null() { 1323 return ::CMSG_FIRSTHDR(mhdr); 1324 }; 1325 let next = cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize) 1326 + _ALIGN(::mem::size_of::<::cmsghdr>()); 1327 let max = (*mhdr).msg_control as usize 1328 + (*mhdr).msg_controllen as usize; 1329 if next > max { 1330 0 as *mut ::cmsghdr 1331 } else { 1332 (cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize)) 1333 as *mut ::cmsghdr 1334 } 1335 } 1336 1337 pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint { 1338 (_ALIGN(::mem::size_of::<::cmsghdr>()) + _ALIGN(length as usize)) 1339 as ::c_uint 1340 } 1341 1342 pub fn SOCKCREDSIZE(ngrps: usize) -> usize { 1343 let ngrps = if ngrps > 0 { 1344 ngrps - 1 1345 } else { 1346 0 1347 }; 1348 ::mem::size_of::<sockcred>() + ::mem::size_of::<::gid_t>() * ngrps 1349 } 1350 1351 pub fn uname(buf: *mut ::utsname) -> ::c_int { 1352 __xuname(256, buf as *mut ::c_void) 1353 } 1354 1355 pub fn CPU_ZERO(cpuset: &mut cpuset_t) -> () { 1356 for slot in cpuset.__bits.iter_mut() { 1357 *slot = 0; 1358 } 1359 } 1360 1361 pub fn CPU_FILL(cpuset: &mut cpuset_t) -> () { 1362 for slot in cpuset.__bits.iter_mut() { 1363 *slot = !0; 1364 } 1365 } 1366 1367 pub fn CPU_SET(cpu: usize, cpuset: &mut cpuset_t) -> () { 1368 let bitset_bits = ::mem::size_of::<::c_long>(); 1369 let (idx, offset) = (cpu / bitset_bits, cpu % bitset_bits); 1370 cpuset.__bits[idx] |= 1 << offset; 1371 () 1372 } 1373 1374 pub fn CPU_CLR(cpu: usize, cpuset: &mut cpuset_t) -> () { 1375 let bitset_bits = ::mem::size_of::<::c_long>(); 1376 let (idx, offset) = (cpu / bitset_bits, cpu % bitset_bits); 1377 cpuset.__bits[idx] &= !(1 << offset); 1378 () 1379 } 1380 1381 pub fn CPU_ISSET(cpu: usize, cpuset: &mut cpuset_t) -> bool { 1382 let bitset_bits = ::mem::size_of::<::c_long>(); 1383 let (idx, offset) = (cpu / bitset_bits, cpu % bitset_bits); 1384 0 != cpuset.__bits[idx] & (1 << offset) 1385 } 1386 } 1387 1388 safe_f! { 1389 pub {const} fn WIFSIGNALED(status: ::c_int) -> bool { 1390 (status & 0o177) != 0o177 && (status & 0o177) != 0 && status != 0x13 1391 } 1392 } 1393 1394 extern "C" { __error() -> *mut ::c_int1395 pub fn __error() -> *mut ::c_int; 1396 aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int1397 pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int; aio_error(aiocbp: *const aiocb) -> ::c_int1398 pub fn aio_error(aiocbp: *const aiocb) -> ::c_int; aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int1399 pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int; aio_read(aiocbp: *mut aiocb) -> ::c_int1400 pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int; aio_return(aiocbp: *mut aiocb) -> ::ssize_t1401 pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t; aio_suspend( aiocb_list: *const *const aiocb, nitems: ::c_int, timeout: *const ::timespec, ) -> ::c_int1402 pub fn aio_suspend( 1403 aiocb_list: *const *const aiocb, 1404 nitems: ::c_int, 1405 timeout: *const ::timespec, 1406 ) -> ::c_int; aio_write(aiocbp: *mut aiocb) -> ::c_int1407 pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int; 1408 extattr_delete_fd( fd: ::c_int, attrnamespace: ::c_int, attrname: *const ::c_char, ) -> ::c_int1409 pub fn extattr_delete_fd( 1410 fd: ::c_int, 1411 attrnamespace: ::c_int, 1412 attrname: *const ::c_char, 1413 ) -> ::c_int; extattr_delete_file( path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char, ) -> ::c_int1414 pub fn extattr_delete_file( 1415 path: *const ::c_char, 1416 attrnamespace: ::c_int, 1417 attrname: *const ::c_char, 1418 ) -> ::c_int; extattr_delete_link( path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char, ) -> ::c_int1419 pub fn extattr_delete_link( 1420 path: *const ::c_char, 1421 attrnamespace: ::c_int, 1422 attrname: *const ::c_char, 1423 ) -> ::c_int; extattr_get_fd( fd: ::c_int, attrnamespace: ::c_int, attrname: *const ::c_char, data: *mut ::c_void, nbytes: ::size_t, ) -> ::ssize_t1424 pub fn extattr_get_fd( 1425 fd: ::c_int, 1426 attrnamespace: ::c_int, 1427 attrname: *const ::c_char, 1428 data: *mut ::c_void, 1429 nbytes: ::size_t, 1430 ) -> ::ssize_t; extattr_get_file( path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char, data: *mut ::c_void, nbytes: ::size_t, ) -> ::ssize_t1431 pub fn extattr_get_file( 1432 path: *const ::c_char, 1433 attrnamespace: ::c_int, 1434 attrname: *const ::c_char, 1435 data: *mut ::c_void, 1436 nbytes: ::size_t, 1437 ) -> ::ssize_t; extattr_get_link( path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char, data: *mut ::c_void, nbytes: ::size_t, ) -> ::ssize_t1438 pub fn extattr_get_link( 1439 path: *const ::c_char, 1440 attrnamespace: ::c_int, 1441 attrname: *const ::c_char, 1442 data: *mut ::c_void, 1443 nbytes: ::size_t, 1444 ) -> ::ssize_t; extattr_list_fd( fd: ::c_int, attrnamespace: ::c_int, data: *mut ::c_void, nbytes: ::size_t, ) -> ::ssize_t1445 pub fn extattr_list_fd( 1446 fd: ::c_int, 1447 attrnamespace: ::c_int, 1448 data: *mut ::c_void, 1449 nbytes: ::size_t, 1450 ) -> ::ssize_t; extattr_list_file( path: *const ::c_char, attrnamespace: ::c_int, data: *mut ::c_void, nbytes: ::size_t, ) -> ::ssize_t1451 pub fn extattr_list_file( 1452 path: *const ::c_char, 1453 attrnamespace: ::c_int, 1454 data: *mut ::c_void, 1455 nbytes: ::size_t, 1456 ) -> ::ssize_t; extattr_list_link( path: *const ::c_char, attrnamespace: ::c_int, data: *mut ::c_void, nbytes: ::size_t, ) -> ::ssize_t1457 pub fn extattr_list_link( 1458 path: *const ::c_char, 1459 attrnamespace: ::c_int, 1460 data: *mut ::c_void, 1461 nbytes: ::size_t, 1462 ) -> ::ssize_t; extattr_set_fd( fd: ::c_int, attrnamespace: ::c_int, attrname: *const ::c_char, data: *const ::c_void, nbytes: ::size_t, ) -> ::ssize_t1463 pub fn extattr_set_fd( 1464 fd: ::c_int, 1465 attrnamespace: ::c_int, 1466 attrname: *const ::c_char, 1467 data: *const ::c_void, 1468 nbytes: ::size_t, 1469 ) -> ::ssize_t; extattr_set_file( path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char, data: *const ::c_void, nbytes: ::size_t, ) -> ::ssize_t1470 pub fn extattr_set_file( 1471 path: *const ::c_char, 1472 attrnamespace: ::c_int, 1473 attrname: *const ::c_char, 1474 data: *const ::c_void, 1475 nbytes: ::size_t, 1476 ) -> ::ssize_t; extattr_set_link( path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char, data: *const ::c_void, nbytes: ::size_t, ) -> ::ssize_t1477 pub fn extattr_set_link( 1478 path: *const ::c_char, 1479 attrnamespace: ::c_int, 1480 attrname: *const ::c_char, 1481 data: *const ::c_void, 1482 nbytes: ::size_t, 1483 ) -> ::ssize_t; 1484 jail(jail: *mut ::jail) -> ::c_int1485 pub fn jail(jail: *mut ::jail) -> ::c_int; jail_attach(jid: ::c_int) -> ::c_int1486 pub fn jail_attach(jid: ::c_int) -> ::c_int; jail_remove(jid: ::c_int) -> ::c_int1487 pub fn jail_remove(jid: ::c_int) -> ::c_int; jail_get(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int1488 pub fn jail_get(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int; jail_set(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int1489 pub fn jail_set(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int; 1490 lio_listio( mode: ::c_int, aiocb_list: *const *mut aiocb, nitems: ::c_int, sevp: *mut sigevent, ) -> ::c_int1491 pub fn lio_listio( 1492 mode: ::c_int, 1493 aiocb_list: *const *mut aiocb, 1494 nitems: ::c_int, 1495 sevp: *mut sigevent, 1496 ) -> ::c_int; 1497 posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int1498 pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int; posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, advise: ::c_int) -> ::c_int1499 pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, advise: ::c_int) -> ::c_int; mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int1500 pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int; mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int1501 pub fn mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int; 1502 getutxuser(user: *const ::c_char) -> *mut utmpx1503 pub fn getutxuser(user: *const ::c_char) -> *mut utmpx; setutxdb(_type: ::c_int, file: *const ::c_char) -> ::c_int1504 pub fn setutxdb(_type: ::c_int, file: *const ::c_char) -> ::c_int; 1505 aio_waitcomplete(iocbp: *mut *mut aiocb, timeout: *mut ::timespec) -> ::ssize_t1506 pub fn aio_waitcomplete(iocbp: *mut *mut aiocb, timeout: *mut ::timespec) -> ::ssize_t; mq_getfd_np(mqd: ::mqd_t) -> ::c_int1507 pub fn mq_getfd_np(mqd: ::mqd_t) -> ::c_int; 1508 waitid( idtype: idtype_t, id: ::id_t, infop: *mut ::siginfo_t, options: ::c_int, ) -> ::c_int1509 pub fn waitid( 1510 idtype: idtype_t, 1511 id: ::id_t, 1512 infop: *mut ::siginfo_t, 1513 options: ::c_int, 1514 ) -> ::c_int; 1515 ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t1516 pub fn ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t; shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int1517 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_void1518 pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void; shmdt(shmaddr: *const ::c_void) -> ::c_int1519 pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int; shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int1520 pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int; msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut ::msqid_ds) -> ::c_int1521 pub fn msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut ::msqid_ds) -> ::c_int; msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int1522 pub fn msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int; msgsnd( msqid: ::c_int, msgp: *const ::c_void, msgsz: ::size_t, msgflg: ::c_int, ) -> ::c_int1523 pub fn msgsnd( 1524 msqid: ::c_int, 1525 msgp: *const ::c_void, 1526 msgsz: ::size_t, 1527 msgflg: ::c_int, 1528 ) -> ::c_int; cfmakesane(termios: *mut ::termios)1529 pub fn cfmakesane(termios: *mut ::termios); fexecve( fd: ::c_int, argv: *const *const ::c_char, envp: *const *const ::c_char, ) -> ::c_int1530 pub fn fexecve( 1531 fd: ::c_int, 1532 argv: *const *const ::c_char, 1533 envp: *const *const ::c_char, 1534 ) -> ::c_int; 1535 pdfork(fdp: *mut ::c_int, flags: ::c_int) -> ::pid_t1536 pub fn pdfork(fdp: *mut ::c_int, flags: ::c_int) -> ::pid_t; pdgetpid(fd: ::c_int, pidp: *mut ::pid_t) -> ::c_int1537 pub fn pdgetpid(fd: ::c_int, pidp: *mut ::pid_t) -> ::c_int; pdkill(fd: ::c_int, signum: ::c_int) -> ::c_int1538 pub fn pdkill(fd: ::c_int, signum: ::c_int) -> ::c_int; 1539 rtprio_thread(function: ::c_int, lwpid: ::lwpid_t, rtp: *mut super::rtprio) -> ::c_int1540 pub fn rtprio_thread(function: ::c_int, lwpid: ::lwpid_t, rtp: *mut super::rtprio) -> ::c_int; 1541 posix_spawn( pid: *mut ::pid_t, path: *const ::c_char, file_actions: *const ::posix_spawn_file_actions_t, attrp: *const ::posix_spawnattr_t, argv: *const *mut ::c_char, envp: *const *mut ::c_char, ) -> ::c_int1542 pub fn posix_spawn( 1543 pid: *mut ::pid_t, 1544 path: *const ::c_char, 1545 file_actions: *const ::posix_spawn_file_actions_t, 1546 attrp: *const ::posix_spawnattr_t, 1547 argv: *const *mut ::c_char, 1548 envp: *const *mut ::c_char, 1549 ) -> ::c_int; posix_spawnp( pid: *mut ::pid_t, file: *const ::c_char, file_actions: *const ::posix_spawn_file_actions_t, attrp: *const ::posix_spawnattr_t, argv: *const *mut ::c_char, envp: *const *mut ::c_char, ) -> ::c_int1550 pub fn posix_spawnp( 1551 pid: *mut ::pid_t, 1552 file: *const ::c_char, 1553 file_actions: *const ::posix_spawn_file_actions_t, 1554 attrp: *const ::posix_spawnattr_t, 1555 argv: *const *mut ::c_char, 1556 envp: *const *mut ::c_char, 1557 ) -> ::c_int; posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int1558 pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int; posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int1559 pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int; posix_spawnattr_getsigdefault( attr: *const posix_spawnattr_t, default: *mut ::sigset_t, ) -> ::c_int1560 pub fn posix_spawnattr_getsigdefault( 1561 attr: *const posix_spawnattr_t, 1562 default: *mut ::sigset_t, 1563 ) -> ::c_int; posix_spawnattr_setsigdefault( attr: *mut posix_spawnattr_t, default: *const ::sigset_t, ) -> ::c_int1564 pub fn posix_spawnattr_setsigdefault( 1565 attr: *mut posix_spawnattr_t, 1566 default: *const ::sigset_t, 1567 ) -> ::c_int; posix_spawnattr_getsigmask( attr: *const posix_spawnattr_t, default: *mut ::sigset_t, ) -> ::c_int1568 pub fn posix_spawnattr_getsigmask( 1569 attr: *const posix_spawnattr_t, 1570 default: *mut ::sigset_t, 1571 ) -> ::c_int; posix_spawnattr_setsigmask( attr: *mut posix_spawnattr_t, default: *const ::sigset_t, ) -> ::c_int1572 pub fn posix_spawnattr_setsigmask( 1573 attr: *mut posix_spawnattr_t, 1574 default: *const ::sigset_t, 1575 ) -> ::c_int; posix_spawnattr_getflags( attr: *const posix_spawnattr_t, flags: *mut ::c_short, ) -> ::c_int1576 pub fn posix_spawnattr_getflags( 1577 attr: *const posix_spawnattr_t, 1578 flags: *mut ::c_short, 1579 ) -> ::c_int; posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int1580 pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int; posix_spawnattr_getpgroup( attr: *const posix_spawnattr_t, flags: *mut ::pid_t, ) -> ::c_int1581 pub fn posix_spawnattr_getpgroup( 1582 attr: *const posix_spawnattr_t, 1583 flags: *mut ::pid_t, 1584 ) -> ::c_int; posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int1585 pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int; posix_spawnattr_getschedpolicy( attr: *const posix_spawnattr_t, flags: *mut ::c_int, ) -> ::c_int1586 pub fn posix_spawnattr_getschedpolicy( 1587 attr: *const posix_spawnattr_t, 1588 flags: *mut ::c_int, 1589 ) -> ::c_int; posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: ::c_int) -> ::c_int1590 pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: ::c_int) -> ::c_int; posix_spawnattr_getschedparam( attr: *const posix_spawnattr_t, param: *mut ::sched_param, ) -> ::c_int1591 pub fn posix_spawnattr_getschedparam( 1592 attr: *const posix_spawnattr_t, 1593 param: *mut ::sched_param, 1594 ) -> ::c_int; posix_spawnattr_setschedparam( attr: *mut posix_spawnattr_t, param: *const ::sched_param, ) -> ::c_int1595 pub fn posix_spawnattr_setschedparam( 1596 attr: *mut posix_spawnattr_t, 1597 param: *const ::sched_param, 1598 ) -> ::c_int; 1599 posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> ::c_int1600 pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> ::c_int; posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> ::c_int1601 pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> ::c_int; posix_spawn_file_actions_addopen( actions: *mut posix_spawn_file_actions_t, fd: ::c_int, path: *const ::c_char, oflag: ::c_int, mode: ::mode_t, ) -> ::c_int1602 pub fn posix_spawn_file_actions_addopen( 1603 actions: *mut posix_spawn_file_actions_t, 1604 fd: ::c_int, 1605 path: *const ::c_char, 1606 oflag: ::c_int, 1607 mode: ::mode_t, 1608 ) -> ::c_int; posix_spawn_file_actions_addclose( actions: *mut posix_spawn_file_actions_t, fd: ::c_int, ) -> ::c_int1609 pub fn posix_spawn_file_actions_addclose( 1610 actions: *mut posix_spawn_file_actions_t, 1611 fd: ::c_int, 1612 ) -> ::c_int; posix_spawn_file_actions_adddup2( actions: *mut posix_spawn_file_actions_t, fd: ::c_int, newfd: ::c_int, ) -> ::c_int1613 pub fn posix_spawn_file_actions_adddup2( 1614 actions: *mut posix_spawn_file_actions_t, 1615 fd: ::c_int, 1616 newfd: ::c_int, 1617 ) -> ::c_int; 1618 pthread_getthreadid_np() -> ::c_int1619 pub fn pthread_getthreadid_np() -> ::c_int; pthread_getaffinity_np( td: ::pthread_t, cpusetsize: ::size_t, cpusetp: *mut cpuset_t, ) -> ::c_int1620 pub fn pthread_getaffinity_np( 1621 td: ::pthread_t, 1622 cpusetsize: ::size_t, 1623 cpusetp: *mut cpuset_t, 1624 ) -> ::c_int; pthread_setaffinity_np( td: ::pthread_t, cpusetsize: ::size_t, cpusetp: *const cpuset_t, ) -> ::c_int1625 pub fn pthread_setaffinity_np( 1626 td: ::pthread_t, 1627 cpusetsize: ::size_t, 1628 cpusetp: *const cpuset_t, 1629 ) -> ::c_int; 1630 pthread_spin_init(lock: *mut pthread_spinlock_t, pshared: ::c_int) -> ::c_int1631 pub fn pthread_spin_init(lock: *mut pthread_spinlock_t, pshared: ::c_int) -> ::c_int; pthread_spin_destroy(lock: *mut pthread_spinlock_t) -> ::c_int1632 pub fn pthread_spin_destroy(lock: *mut pthread_spinlock_t) -> ::c_int; pthread_spin_lock(lock: *mut pthread_spinlock_t) -> ::c_int1633 pub fn pthread_spin_lock(lock: *mut pthread_spinlock_t) -> ::c_int; pthread_spin_trylock(lock: *mut pthread_spinlock_t) -> ::c_int1634 pub fn pthread_spin_trylock(lock: *mut pthread_spinlock_t) -> ::c_int; pthread_spin_unlock(lock: *mut pthread_spinlock_t) -> ::c_int1635 pub fn pthread_spin_unlock(lock: *mut pthread_spinlock_t) -> ::c_int; 1636 1637 #[cfg_attr(all(target_os = "freebsd", freebsd11), link_name = "statfs@FBSD_1.0")] statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int1638 pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int; 1639 #[cfg_attr(all(target_os = "freebsd", freebsd11), link_name = "fstatfs@FBSD_1.0")] fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int1640 pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int; 1641 dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int1642 pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int; __xuname(nmln: ::c_int, buf: *mut ::c_void) -> ::c_int1643 pub fn __xuname(nmln: ::c_int, buf: *mut ::c_void) -> ::c_int; 1644 sendmmsg( sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::size_t, flags: ::c_int, ) -> ::ssize_t1645 pub fn sendmmsg( 1646 sockfd: ::c_int, 1647 msgvec: *mut ::mmsghdr, 1648 vlen: ::size_t, 1649 flags: ::c_int, 1650 ) -> ::ssize_t; recvmmsg( sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::size_t, flags: ::c_int, timeout: *const ::timespec, ) -> ::ssize_t1651 pub fn recvmmsg( 1652 sockfd: ::c_int, 1653 msgvec: *mut ::mmsghdr, 1654 vlen: ::size_t, 1655 flags: ::c_int, 1656 timeout: *const ::timespec, 1657 ) -> ::ssize_t; memmem( haystack: *const ::c_void, haystacklen: ::size_t, needle: *const ::c_void, needlelen: ::size_t, ) -> *mut ::c_void1658 pub fn memmem( 1659 haystack: *const ::c_void, 1660 haystacklen: ::size_t, 1661 needle: *const ::c_void, 1662 needlelen: ::size_t, 1663 ) -> *mut ::c_void; 1664 nmount(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int1665 pub fn nmount(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int; setproctitle(fmt: *const ::c_char, ...)1666 pub fn setproctitle(fmt: *const ::c_char, ...); rfork(flags: ::c_int) -> ::c_int1667 pub fn rfork(flags: ::c_int) -> ::c_int; cpuset_getaffinity( level: cpulevel_t, which: cpuwhich_t, id: ::id_t, setsize: ::size_t, mask: *mut cpuset_t, ) -> ::c_int1668 pub fn cpuset_getaffinity( 1669 level: cpulevel_t, 1670 which: cpuwhich_t, 1671 id: ::id_t, 1672 setsize: ::size_t, 1673 mask: *mut cpuset_t, 1674 ) -> ::c_int; cpuset_setaffinity( level: cpulevel_t, which: cpuwhich_t, id: ::id_t, setsize: ::size_t, mask: *const cpuset_t, ) -> ::c_int1675 pub fn cpuset_setaffinity( 1676 level: cpulevel_t, 1677 which: cpuwhich_t, 1678 id: ::id_t, 1679 setsize: ::size_t, 1680 mask: *const cpuset_t, 1681 ) -> ::c_int; cap_enter() -> ::c_int1682 pub fn cap_enter() -> ::c_int; cap_getmode(modep: *mut ::c_uint) -> ::c_int1683 pub fn cap_getmode(modep: *mut ::c_uint) -> ::c_int; __cap_rights_init(version: ::c_int, rights: *mut cap_rights_t, ...) -> *mut cap_rights_t1684 pub fn __cap_rights_init(version: ::c_int, rights: *mut cap_rights_t, ...) 1685 -> *mut cap_rights_t; __cap_rights_set(rights: *mut cap_rights_t, ...) -> *mut cap_rights_t1686 pub fn __cap_rights_set(rights: *mut cap_rights_t, ...) -> *mut cap_rights_t; __cap_rights_clear(rights: *mut cap_rights_t, ...) -> *mut cap_rights_t1687 pub fn __cap_rights_clear(rights: *mut cap_rights_t, ...) -> *mut cap_rights_t; __cap_rights_is_set(rights: *const cap_rights_t, ...) -> bool1688 pub fn __cap_rights_is_set(rights: *const cap_rights_t, ...) -> bool; cap_rights_is_valid(rights: *const cap_rights_t) -> bool1689 pub fn cap_rights_is_valid(rights: *const cap_rights_t) -> bool; cap_rights_limit(fd: ::c_int, rights: *const cap_rights_t) -> ::c_int1690 pub fn cap_rights_limit(fd: ::c_int, rights: *const cap_rights_t) -> ::c_int; cap_rights_merge(dst: *mut cap_rights_t, src: *const cap_rights_t) -> *mut cap_rights_t1691 pub fn cap_rights_merge(dst: *mut cap_rights_t, src: *const cap_rights_t) -> *mut cap_rights_t; cap_rights_remove(dst: *mut cap_rights_t, src: *const cap_rights_t) -> *mut cap_rights_t1692 pub fn cap_rights_remove(dst: *mut cap_rights_t, src: *const cap_rights_t) 1693 -> *mut cap_rights_t; cap_rights_contains(big: *const cap_rights_t, little: *const cap_rights_t) -> bool1694 pub fn cap_rights_contains(big: *const cap_rights_t, little: *const cap_rights_t) -> bool; 1695 reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void1696 pub fn reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void; 1697 } 1698 1699 #[link(name = "util")] 1700 extern "C" { extattr_namespace_to_string( attrnamespace: ::c_int, string: *mut *mut ::c_char, ) -> ::c_int1701 pub fn extattr_namespace_to_string( 1702 attrnamespace: ::c_int, 1703 string: *mut *mut ::c_char, 1704 ) -> ::c_int; extattr_string_to_namespace( string: *const ::c_char, attrnamespace: *mut ::c_int, ) -> ::c_int1705 pub fn extattr_string_to_namespace( 1706 string: *const ::c_char, 1707 attrnamespace: *mut ::c_int, 1708 ) -> ::c_int; realhostname(host: *mut ::c_char, hsize: ::size_t, ip: *const ::in_addr) -> ::c_int1709 pub fn realhostname(host: *mut ::c_char, hsize: ::size_t, ip: *const ::in_addr) -> ::c_int; realhostname_sa( host: *mut ::c_char, hsize: ::size_t, addr: *mut ::sockaddr, addrlen: ::c_int, ) -> ::c_int1710 pub fn realhostname_sa( 1711 host: *mut ::c_char, 1712 hsize: ::size_t, 1713 addr: *mut ::sockaddr, 1714 addrlen: ::c_int, 1715 ) -> ::c_int; 1716 } 1717 1718 cfg_if! { 1719 if #[cfg(freebsd13)] { 1720 mod freebsd13; 1721 pub use self::freebsd13::*; 1722 } else if #[cfg(freebsd12)] { 1723 mod freebsd12; 1724 pub use self::freebsd12::*; 1725 } else if #[cfg(any(freebsd10, freebsd11))] { 1726 mod freebsd11; 1727 pub use self::freebsd11::*; 1728 } else { 1729 // Unknown freebsd version 1730 } 1731 } 1732 1733 cfg_if! { 1734 if #[cfg(target_arch = "x86")] { 1735 mod x86; 1736 pub use self::x86::*; 1737 } else if #[cfg(target_arch = "x86_64")] { 1738 mod x86_64; 1739 pub use self::x86_64::*; 1740 } else if #[cfg(target_arch = "aarch64")] { 1741 mod aarch64; 1742 pub use self::aarch64::*; 1743 } else if #[cfg(target_arch = "arm")] { 1744 mod arm; 1745 pub use self::arm::*; 1746 } else if #[cfg(target_arch = "powerpc64")] { 1747 mod powerpc64; 1748 pub use self::powerpc64::*; 1749 } else if #[cfg(target_arch = "powerpc")] { 1750 mod powerpc; 1751 pub use self::powerpc::*; 1752 } else { 1753 // Unknown target_arch 1754 } 1755 } 1756