Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions library/std/src/sys/thread/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,13 +314,10 @@ pub fn available_parallelism() -> io::Result<NonZero<usize>> {
target_os = "vxworks" => {
// Note: there is also `vxCpuConfiguredGet`, closer to _SC_NPROCESSORS_CONF
// expectations than the actual cores availability.
unsafe extern "C" {
fn vxCpuEnabledGet() -> libc::cpuset_t;
}

// SAFETY: `vxCpuEnabledGet` always fetches a mask with at least one bit set
unsafe{
let set = vxCpuEnabledGet();
let set = libc::vxCpuEnabledGet();
Ok(NonZero::new_unchecked(set.count_ones() as usize))
}
}
Expand Down
Loading