about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-12-30 15:37:26 +0000
committerbors <bors@rust-lang.org>2023-12-30 15:37:26 +0000
commita2541e861e74cd1fe6454df02c843ad1ec592589 (patch)
treef093b3d61bd0d8e32aa08ab77a533adb05a500df /compiler/rustc_codegen_llvm/src
parente45a937a117cdbe9cd69ed47e03f7ad28cc6ef29 (diff)
parent3633f8ba1cc5d1853e2768e5a9516574ed7d31e1 (diff)
downloadrust-a2541e861e74cd1fe6454df02c843ad1ec592589.tar.gz
rust-a2541e861e74cd1fe6454df02c843ad1ec592589.zip
Auto merge of #119436 - semarie:openbsd-available_parallelism, r=Mark-Simulacrum
openbsd: available_parallelism: use the right API

use the standard `sysconf(_SC_NPROCESSORS_ONLN)` way to get the number of  available processors (capable of running processes), and fallback to `sysctl([CTL_HW, HW_NCPU])` (number of CPUs configured) only on error.

it permits to differenciate CPUs online (capable of running processes) vs CPUs configured (not necessary  capable of running processes).

while here, use the common code path for BSDs for doing that, and avoid code  duplication.

Problem initially reported to me by Jiri Navratil.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions