Skip to content

Commit 8ced4c0

Browse files
committed
Add mac/ios pthread_from_mach_thread_np
Allows us to get a pthread id from a match thread id. From pthread.h [1]: ``` __API_AVAILABLE(macos(10.5), ios(2.0)) _Nullable pthread_t pthread_from_mach_thread_np(mach_port_t); ``` [1] - https://opensource.apple.com/source/libpthread/libpthread-416.40.3/pthread/pthread.h.auto.html
1 parent ab3c229 commit 8ced4c0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/unix/bsd/apple/mod.rs

+3
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ pub type shmatt_t = ::c_ushort;
3535
pub type sae_associd_t = u32;
3636
pub type sae_connid_t = u32;
3737

38+
pub type mach_port_t = ::c_uint;
39+
3840
deprecated_mach! {
3941
pub type vm_prot_t = ::c_int;
4042
pub type vm_size_t = ::uintptr_t;
@@ -3395,6 +3397,7 @@ extern "C" {
33953397
name: *mut ::c_char,
33963398
len: ::size_t,
33973399
) -> ::c_int;
3400+
pub fn pthread_from_mach_thread_np(port: ::mach_port_t) -> ::pthread_t;
33983401
pub fn pthread_get_stackaddr_np(thread: ::pthread_t) -> *mut ::c_void;
33993402
pub fn pthread_get_stacksize_np(thread: ::pthread_t) -> ::size_t;
34003403
pub fn pthread_condattr_setpshared(

0 commit comments

Comments
 (0)