Skip to content

Commit 7ade8cc

Browse files
Rollup merge of #157002 - willnode:redox-nproc, r=bjorn3
std: Fix thread::available_parallelism on Redox targets This brings support to `thread::available_parallelism` on Redox targets via `sysconf`. It has been available since `libc 0.2.177` and tested for months. References: - [libc implementation](rust-lang/libc#4728) - [downstream patch](https://gitlab.redox-os.org/redox-os/rust/-/merge_requests/27)
2 parents e8d970b + 1f02e4d commit 7ade8cc

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ pub fn available_parallelism() -> io::Result<NonZero<usize>> {
155155
target_os = "aix",
156156
target_vendor = "apple",
157157
target_os = "cygwin",
158+
target_os = "redox",
158159
target_os = "wasi",
159160
) => {
160161
#[allow(unused_assignments)]
@@ -316,7 +317,7 @@ pub fn available_parallelism() -> io::Result<NonZero<usize>> {
316317
}
317318
}
318319
_ => {
319-
// FIXME: implement on Redox, l4re
320+
// FIXME: implement on l4re
320321
Err(io::const_error!(io::ErrorKind::Unsupported, "getting the number of hardware threads is not supported on the target platform"))
321322
}
322323
}

0 commit comments

Comments
 (0)