Skip to content

Commit c2e1182

Browse files
authored
Remove runtime::set_thread_name, which is obviated by thread::set_name. (#952)
1 parent 2a70730 commit c2e1182

File tree

2 files changed

+4
-31
lines changed

2 files changed

+4
-31
lines changed

src/backend/linux_raw/runtime/syscalls.rs

+4-15
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
88
use crate::backend::c;
99
#[cfg(target_arch = "x86")]
1010
use crate::backend::conv::by_mut;
11+
#[cfg(target_arch = "x86_64")]
12+
use crate::backend::conv::c_uint;
1113
use crate::backend::conv::{
12-
by_ref, c_int, c_uint, ret, ret_c_int, ret_c_int_infallible, ret_error, ret_infallible,
13-
ret_void_star, size_of, zero,
14+
by_ref, c_int, ret, ret_c_int, ret_c_int_infallible, ret_error, ret_infallible, ret_void_star,
15+
size_of, zero,
1416
};
1517
#[cfg(feature = "fs")]
1618
use crate::fd::BorrowedFd;
@@ -30,7 +32,6 @@ use linux_raw_sys::general::__kernel_old_timespec;
3032
use linux_raw_sys::general::kernel_sigset_t;
3133
#[cfg(target_arch = "x86_64")]
3234
use linux_raw_sys::general::ARCH_SET_FS;
33-
use linux_raw_sys::prctl::PR_SET_NAME;
3435

3536
#[inline]
3637
pub(crate) unsafe fn fork() -> io::Result<Fork> {
@@ -139,18 +140,6 @@ pub(crate) mod tls {
139140
Pid::from_raw_unchecked(tid)
140141
}
141142

142-
#[inline]
143-
pub(crate) unsafe fn set_thread_name(name: &CStr) -> io::Result<()> {
144-
ret(syscall_readonly!(
145-
__NR_prctl,
146-
c_uint(PR_SET_NAME),
147-
name,
148-
zero(),
149-
zero(),
150-
zero()
151-
))
152-
}
153-
154143
#[inline]
155144
pub(crate) fn exit_thread(code: c::c_int) -> ! {
156145
unsafe { syscall_noreturn!(__NR_exit, c_int(code)) }

src/runtime.rs

-16
Original file line numberDiff line numberDiff line change
@@ -112,22 +112,6 @@ pub unsafe fn set_tid_address(data: *mut c_void) -> Pid {
112112
backend::runtime::syscalls::tls::set_tid_address(data)
113113
}
114114

115-
/// `prctl(PR_SET_NAME, name)`
116-
///
117-
/// # References
118-
/// - [Linux]
119-
///
120-
/// # Safety
121-
///
122-
/// This is a very low-level feature for implementing threading libraries.
123-
/// See the references links above.
124-
///
125-
/// [Linux]: https://man7.org/linux/man-pages/man2/prctl.2.html
126-
#[inline]
127-
pub unsafe fn set_thread_name(name: &CStr) -> io::Result<()> {
128-
backend::runtime::syscalls::tls::set_thread_name(name)
129-
}
130-
131115
#[cfg(linux_raw)]
132116
#[cfg(target_arch = "x86")]
133117
pub use backend::runtime::tls::UserDesc;

0 commit comments

Comments
 (0)