Skip to content

Commit cd99f68

Browse files
committed
Auto merge of #2768 - colincross:pthread_setname_np, r=Amanieu
Promote pthread_getname_np and pthread_setname_np from glibc to linux musl libc added pthread_setname_np in 1.1.16 and pthread_getname_np in 1.2.3, and uClibc has had them since v1.0.20.
2 parents 454fb0e + af887f0 commit cd99f68

File tree

5 files changed

+8
-4
lines changed

5 files changed

+8
-4
lines changed

libc-test/build.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3413,6 +3413,9 @@ fn test_linux(target: &str) {
34133413
// Not defined in uclibc as of 1.0.34
34143414
"gettid" if uclibc => true,
34153415

3416+
// Needs musl 1.2.3 or later.
3417+
"pthread_getname_np" if musl => true,
3418+
34163419
_ => false,
34173420
}
34183421
});

libc-test/semver/linux-gnu.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -624,11 +624,9 @@ process_vm_readv
624624
process_vm_writev
625625
pthread_attr_getaffinity_np
626626
pthread_attr_setaffinity_np
627-
pthread_getname_np
628627
pthread_rwlockattr_getkind_np
629628
pthread_rwlockattr_getpshared
630629
pthread_rwlockattr_setkind_np
631-
pthread_setname_np
632630
ptrace_peeksiginfo_args
633631
ptrace_syscall_info
634632
pututxline

libc-test/semver/linux.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2953,6 +2953,7 @@ pthread_condattr_setpshared
29532953
pthread_getaffinity_np
29542954
pthread_getattr_np
29552955
pthread_getcpuclockid
2956+
pthread_getname_np
29562957
pthread_getschedparam
29572958
pthread_kill
29582959
pthread_mutex_consistent
@@ -2965,6 +2966,7 @@ pthread_mutexattr_getrobust
29652966
pthread_mutexattr_setrobust
29662967
pthread_rwlockattr_setpshared
29672968
pthread_setaffinity_np
2969+
pthread_setname_np
29682970
pthread_setschedparam
29692971
pthread_setschedprio
29702972
pthread_spin_destroy

src/unix/linux_like/linux/gnu/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,8 +1305,6 @@ extern "C" {
13051305
buflen: ::size_t,
13061306
result: *mut *mut ::group,
13071307
) -> ::c_int;
1308-
pub fn pthread_getname_np(thread: ::pthread_t, name: *mut ::c_char, len: ::size_t) -> ::c_int;
1309-
pub fn pthread_setname_np(thread: ::pthread_t, name: *const ::c_char) -> ::c_int;
13101308

13111309
pub fn sethostid(hostid: ::c_long) -> ::c_int;
13121310

src/unix/linux_like/linux/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4090,6 +4090,9 @@ extern "C" {
40904090
needlelen: ::size_t,
40914091
) -> *mut ::c_void;
40924092
pub fn sched_getcpu() -> ::c_int;
4093+
4094+
pub fn pthread_getname_np(thread: ::pthread_t, name: *mut ::c_char, len: ::size_t) -> ::c_int;
4095+
pub fn pthread_setname_np(thread: ::pthread_t, name: *const ::c_char) -> ::c_int;
40934096
}
40944097

40954098
cfg_if! {

0 commit comments

Comments
 (0)