Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libc-test/semver/apple.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1786,6 +1786,7 @@ __PTHREAD_RWLOCKATTR_SIZE__
__PTHREAD_RWLOCK_SIZE__
__darwin_mcontext64
__error
_opaque_pthread_t
abs
acct
aio_cancel
Expand Down
16 changes: 15 additions & 1 deletion src/unix/bsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,21 @@ pub type useconds_t = u32;
pub type blkcnt_t = i64;
pub type socklen_t = u32;
pub type sa_family_t = u8;
pub type pthread_t = crate::uintptr_t;

cfg_if! {
if #[cfg(target_vendor = "apple")] {
extern_ty! {
pub enum _opaque_pthread_t {}
}

type __darwin_pthread_t = *mut _opaque_pthread_t;
pub type pthread_t = __darwin_pthread_t;
} else {
// FIXME(1.0): verify other BSDs? Glancing around, other BSDs also look like a pointer
pub type pthread_t = crate::uintptr_t;
}
}

pub type nfds_t = c_uint;
pub type regoff_t = off_t;

Expand Down