We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents b48576b + e5fc7d6 commit 927cc54Copy full SHA for 927cc54
library/std/src/sys/pal/unix/thread.rs
@@ -143,8 +143,8 @@ impl Thread {
143
pub fn set_name(name: &CStr) {
144
unsafe {
145
cfg_if::cfg_if! {
146
- if #[cfg(target_os = "linux")] {
147
- // Linux limits the allowed length of the name.
+ if #[cfg(any(target_os = "linux", target_os = "cygwin"))] {
+ // Linux and Cygwin limits the allowed length of the name.
148
const TASK_COMM_LEN: usize = 16;
149
let name = truncate_cstr::<{ TASK_COMM_LEN }>(name);
150
} else {
@@ -346,6 +346,7 @@ impl Drop for Thread {
346
target_os = "solaris",
347
target_os = "illumos",
348
target_os = "vxworks",
349
+ target_os = "cygwin",
350
target_vendor = "apple",
351
))]
352
fn truncate_cstr<const MAX_WITH_NUL: usize>(cstr: &CStr) -> [libc::c_char; MAX_WITH_NUL] {
0 commit comments