Skip to content

Commit dba2e20

Browse files
committed
std library thread.rs: fix NetBSD code for ILP32 CPUs.
1 parent af98101 commit dba2e20

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,8 @@ pub fn available_parallelism() -> io::Result<NonZero<usize>> {
424424
if !set.is_null() {
425425
let mut count: usize = 0;
426426
if libc::pthread_getaffinity_np(libc::pthread_self(), libc::_cpuset_size(set), set) == 0 {
427-
for i in 0..u64::MAX {
428-
match libc::_cpuset_isset(i, set) {
427+
for i in 0..u32::MAX {
428+
match libc::_cpuset_isset(i.into(), set) {
429429
-1 => break,
430430
0 => continue,
431431
_ => count = count + 1,

0 commit comments

Comments
 (0)