aboutsummaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4')
-rw-r--r--m4/tuklib_cpucores.m45
1 files changed, 5 insertions, 0 deletions
diff --git a/m4/tuklib_cpucores.m4 b/m4/tuklib_cpucores.m4
index 63063982..873812d6 100644
--- a/m4/tuklib_cpucores.m4
+++ b/m4/tuklib_cpucores.m4
@@ -102,7 +102,12 @@ compile error
int
main(void)
{
+#ifdef HW_NCPUONLINE
+ /* This is preferred on OpenBSD, see tuklib_cpucores.c. */
+ int name[2] = { CTL_HW, HW_NCPUONLINE };
+#else
int name[2] = { CTL_HW, HW_NCPU };
+#endif
int cpus;
size_t cpus_size = sizeof(cpus);
sysctl(name, 2, &cpus, &cpus_size, NULL, 0);