From a13d90c2cdb17614ff31e6be23dbf5b33e481aba Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Sun, 9 Feb 2025 03:58:47 -0500 Subject: [PATCH] SystemInformation: use HW_NCPUONLINE on OpenBSD and NetBSD --- SystemInformation.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SystemInformation.cxx b/SystemInformation.cxx index 9ac30bc..c679c48 100644 --- a/SystemInformation.cxx +++ b/SystemInformation.cxx @@ -5131,7 +5131,11 @@ bool SystemInformationImplementation::QueryBSDProcessor() defined(__DragonFly__) int k; size_t sz = sizeof(k); +# ifdef HW_NCPUONLINE + int ctrl[2] = { CTL_HW, HW_NCPUONLINE }; +# else int ctrl[2] = { CTL_HW, HW_NCPU }; +# endif if (sysctl(ctrl, 2, &k, &sz, nullptr, 0) != 0) { return false; -- GitLab