Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promote pthread_getname_np and pthread_setname_np from glibc to linux #2768

Merged
merged 1 commit into from May 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions libc-test/build.rs
Expand Up @@ -3401,6 +3401,9 @@ fn test_linux(target: &str) {
// Not defined in uclibc as of 1.0.34
"gettid" if uclibc => true,

// Needs musl 1.2.3 or later.
"pthread_getname_np" if musl => true,

_ => false,
}
});
Expand Down
2 changes: 0 additions & 2 deletions libc-test/semver/linux-gnu.txt
Expand Up @@ -624,11 +624,9 @@ process_vm_readv
process_vm_writev
pthread_attr_getaffinity_np
pthread_attr_setaffinity_np
pthread_getname_np
pthread_rwlockattr_getkind_np
pthread_rwlockattr_getpshared
pthread_rwlockattr_setkind_np
pthread_setname_np
ptrace_peeksiginfo_args
ptrace_syscall_info
pututxline
Expand Down
2 changes: 2 additions & 0 deletions libc-test/semver/linux.txt
Expand Up @@ -2950,6 +2950,7 @@ pthread_condattr_setpshared
pthread_getaffinity_np
pthread_getattr_np
pthread_getcpuclockid
pthread_getname_np
pthread_getschedparam
pthread_kill
pthread_mutex_consistent
Expand All @@ -2962,6 +2963,7 @@ pthread_mutexattr_getrobust
pthread_mutexattr_setrobust
pthread_rwlockattr_setpshared
pthread_setaffinity_np
pthread_setname_np
pthread_setschedparam
pthread_setschedprio
pthread_spin_destroy
Expand Down
2 changes: 0 additions & 2 deletions src/unix/linux_like/linux/gnu/mod.rs
Expand Up @@ -1301,8 +1301,6 @@ extern "C" {
buflen: ::size_t,
result: *mut *mut ::group,
) -> ::c_int;
pub fn pthread_getname_np(thread: ::pthread_t, name: *mut ::c_char, len: ::size_t) -> ::c_int;
pub fn pthread_setname_np(thread: ::pthread_t, name: *const ::c_char) -> ::c_int;

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

Expand Down
3 changes: 3 additions & 0 deletions src/unix/linux_like/linux/mod.rs
Expand Up @@ -4097,6 +4097,9 @@ extern "C" {
needlelen: ::size_t,
) -> *mut ::c_void;
pub fn sched_getcpu() -> ::c_int;

pub fn pthread_getname_np(thread: ::pthread_t, name: *mut ::c_char, len: ::size_t) -> ::c_int;
pub fn pthread_setname_np(thread: ::pthread_t, name: *const ::c_char) -> ::c_int;
}

cfg_if! {
Expand Down