diff --git a/src/lib.rs b/src/lib.rs index fa1267c..19ffbdc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -433,6 +433,13 @@ fn get_num_cpus() -> usize { unsafe { hermit_abi::get_processor_count() } } +#[cfg(target_os = "vxworks")] +fn get_num_cpus() -> usize { + unsafe { + libc::vxCpuEnabledGet().count_ones as usize + } +} + #[cfg(not(any( target_os = "nacl", target_os = "macos", @@ -449,6 +456,7 @@ fn get_num_cpus() -> usize { target_os = "netbsd", target_os = "haiku", target_os = "hermit", + target_os = "vxworks", windows, )))] fn get_num_cpus() -> usize {