Skip to content

Commit

Permalink
Add vxworks implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
biabbas committed Oct 7, 2024
1 parent 7c03fc9 commit e380a7a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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 {
Expand Down

0 comments on commit e380a7a

Please sign in to comment.