We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 030e4d3 + f58b254 commit 9d311f9Copy full SHA for 9d311f9
library/std/src/sys/unix/thread.rs
@@ -182,6 +182,9 @@ impl Thread {
182
}
183
184
if let Some(f) = pthread_setname_np.get() {
185
+ #[cfg(target_os = "nto")]
186
+ let name = truncate_cstr::<{ libc::_NTO_THREAD_NAME_MAX as usize }>(name);
187
+
188
let res = unsafe { f(libc::pthread_self(), name.as_ptr()) };
189
debug_assert_eq!(res, 0);
190
@@ -290,6 +293,7 @@ impl Drop for Thread {
290
293
target_os = "ios",
291
294
target_os = "tvos",
292
295
target_os = "watchos",
296
+ target_os = "nto",
297
))]
298
fn truncate_cstr<const MAX_WITH_NUL: usize>(cstr: &CStr) -> [libc::c_char; MAX_WITH_NUL] {
299
let mut result = [0; MAX_WITH_NUL];
0 commit comments