diff options
author | Fábio Botelho <dev.fbotelho@gmail.com> | 2020-08-09 18:17:08 +0100 |
---|---|---|
committer | Fábio Botelho <dev.fbotelho@gmail.com> | 2020-08-09 18:17:08 +0100 |
commit | 8ced4c0a8cbc4ae1a50f8c55b137ed3982d73b71 (patch) | |
tree | 9811815bc598787bebc6dc5840b6746f91d4a37c | |
parent | ab3c229140cc6a609c52fd732ea76bf69f9a5855 (diff) | |
download | rust-libc-8ced4c0a8cbc4ae1a50f8c55b137ed3982d73b71.tar.gz |
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
-rw-r--r-- | src/unix/bsd/apple/mod.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index f130974728..39301ed4e9 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -35,6 +35,8 @@ pub type shmatt_t = ::c_ushort; pub type sae_associd_t = u32; pub type sae_connid_t = u32; +pub type mach_port_t = ::c_uint; + deprecated_mach! { pub type vm_prot_t = ::c_int; pub type vm_size_t = ::uintptr_t; @@ -3395,6 +3397,7 @@ extern "C" { name: *mut ::c_char, len: ::size_t, ) -> ::c_int; + pub fn pthread_from_mach_thread_np(port: ::mach_port_t) -> ::pthread_t; pub fn pthread_get_stackaddr_np(thread: ::pthread_t) -> *mut ::c_void; pub fn pthread_get_stacksize_np(thread: ::pthread_t) -> ::size_t; pub fn pthread_condattr_setpshared( |