File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -182,8 +182,11 @@ impl Thread {
182
182
183
183
if let Some ( f) = pthread_setname_np. get ( ) {
184
184
#[ cfg( target_os = "nto" ) ]
185
- let name = truncate_cstr :: < { libc:: _NTO_THREAD_NAME_MAX as usize } > ( name) ;
185
+ 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 ;
186
188
189
+ let name = truncate_cstr :: < { THREAD_NAME_MAX } > ( name) ;
187
190
let res = unsafe { f ( libc:: pthread_self ( ) , name. as_ptr ( ) ) } ;
188
191
debug_assert_eq ! ( res, 0 ) ;
189
192
}
@@ -368,6 +371,8 @@ impl Drop for Thread {
368
371
target_os = "tvos" ,
369
372
target_os = "watchos" ,
370
373
target_os = "nto" ,
374
+ target_os = "solaris" ,
375
+ target_os = "illumos" ,
371
376
) ) ]
372
377
fn truncate_cstr < const MAX_WITH_NUL : usize > ( cstr : & CStr ) -> [ libc:: c_char ; MAX_WITH_NUL ] {
373
378
let mut result = [ 0 ; MAX_WITH_NUL ] ;
You can’t perform that action at this time.
0 commit comments