Skip to content

Commit 7994bd5

Browse files
authored
Unrolled build for #147870
Rollup merge of #147870 - devnexen:vxworks_simpl_cpu_detect, r=joboet `std::thread::available_parallelism()` vxworks libc symbol usage.
2 parents f04e3df + 4333e72 commit 7994bd5

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

library/std/src/sys/thread/unix.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,13 +314,10 @@ pub fn available_parallelism() -> io::Result<NonZero<usize>> {
314314
target_os = "vxworks" => {
315315
// Note: there is also `vxCpuConfiguredGet`, closer to _SC_NPROCESSORS_CONF
316316
// expectations than the actual cores availability.
317-
unsafe extern "C" {
318-
fn vxCpuEnabledGet() -> libc::cpuset_t;
319-
}
320317

321318
// SAFETY: `vxCpuEnabledGet` always fetches a mask with at least one bit set
322319
unsafe{
323-
let set = vxCpuEnabledGet();
320+
let set = libc::vxCpuEnabledGet();
324321
Ok(NonZero::new_unchecked(set.count_ones() as usize))
325322
}
326323
}

0 commit comments

Comments
 (0)