We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3d5528c commit 61289a0Copy full SHA for 61289a0
library/std/src/sys/pal/unix/thread.rs
@@ -182,8 +182,11 @@ impl Thread {
182
183
if let Some(f) = pthread_setname_np.get() {
184
#[cfg(target_os = "nto")]
185
- let name = truncate_cstr::<{ libc::_NTO_THREAD_NAME_MAX as usize }>(name);
+ const THREAD_NAME_MAX: usize = libc::_NTO_THREAD_NAME_MAX as usize;
186
+ #[cfg(any(target_os = "solaris", target_os = "illumos"))]
187
+ const THREAD_NAME_MAX: usize = 32;
188
189
+ let name = truncate_cstr::<{ THREAD_NAME_MAX }>(name);
190
let res = unsafe { f(libc::pthread_self(), name.as_ptr()) };
191
debug_assert_eq!(res, 0);
192
}
0 commit comments