From 1f1dbb51e31b3d691cf1c14ced3f6ee3d246c05e Mon Sep 17 00:00:00 2001 From: B I Mohammed Abbas Date: Wed, 7 Aug 2024 16:27:02 +0530 Subject: [PATCH] try fix for setname --- library/std/src/sys/pal/unix/thread.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/library/std/src/sys/pal/unix/thread.rs b/library/std/src/sys/pal/unix/thread.rs index 7d29d9a517210..826d0ae9132e7 100644 --- a/library/std/src/sys/pal/unix/thread.rs +++ b/library/std/src/sys/pal/unix/thread.rs @@ -235,7 +235,7 @@ impl Thread { let name = truncate_cstr::<{ VX_TASK_NAME_LEN }>(name); let status = unsafe { f(libc::taskIdSelf(), name.as_mut_ptr()) }; - debug_assert_eq!(res, libc::OK); + debug_assert_eq!(status, libc::OK); } } @@ -491,7 +491,9 @@ pub fn available_parallelism() -> io::Result> { // always fetches a valid bitmask let set = unsafe { vxCpuEnabledGet() }; - Ok(NonZero::new_unchecked(set.count_ones() as usize)) + Ok(unsafe{ + NonZero::new_unchecked(set.count_ones() as usize) + }) } else { // FIXME: implement on Redox, l4re Err(io::const_io_error!(io::ErrorKind::Unsupported, "Getting the number of hardware threads is not supported on the target platform"))