Skip to content

Commit cd47b46

Browse files
committed
Auto merge of #1599 - YangKeao:macos, r=gnzlbg
add pthread_getname_np for mac os In macos's `pthread.h` ```c /*SPI to set and get pthread name*/ __API_AVAILABLE(macos(10.6), ios(3.2)) int pthread_getname_np(pthread_t,char*,size_t); __API_AVAILABLE(macos(10.6), ios(3.2)) int pthread_setname_np(const char*); ``` I believe `pthread_getname_np` is usable in macos after 10.6. Signed-off-by: Yang Keao <keao.yang@yahoo.com>
2 parents f992fd4 + 7022df3 commit cd47b46

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/unix/bsd/apple/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3237,6 +3237,11 @@ extern "C" {
32373237
#[allow(deprecated)]
32383238
pub fn mach_timebase_info(info: *mut ::mach_timebase_info) -> ::c_int;
32393239
pub fn pthread_setname_np(name: *const ::c_char) -> ::c_int;
3240+
pub fn pthread_getname_np(
3241+
thread: ::pthread_t,
3242+
name: *mut ::c_char,
3243+
len: ::size_t,
3244+
) -> ::c_int;
32403245
pub fn pthread_get_stackaddr_np(thread: ::pthread_t) -> *mut ::c_void;
32413246
pub fn pthread_get_stacksize_np(thread: ::pthread_t) -> ::size_t;
32423247
pub fn pthread_condattr_setpshared(

0 commit comments

Comments
 (0)