From 5f763375533dde181f1b60788ce07047a41a8a90 Mon Sep 17 00:00:00 2001 From: Alastair Poole Date: Sun, 17 Nov 2019 17:52:25 +0000 Subject: [PATCH] system: HW_NCPUONLINE is OpenBSD-specific. Seems this was added to mitigate spectre and does not exist for FreeBSD. No other means of testing other platforms so enable this only with OpenBSD for now. --- src/system.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/system.c b/src/system.c index 42ff2d3..d5a330a 100644 --- a/src/system.c +++ b/src/system.c @@ -209,9 +209,7 @@ cpu_count(void) int system_cpu_online_count_get(void) { -#if defined(__linux__) - return cpu_count(); -#endif +#if defined(__OpenBSD__) static int cores = 0; if (cores != 0) return cores; @@ -224,6 +222,9 @@ system_cpu_online_count_get(void) return cpu_count(); return cores; +#else + return cpu_count(); +#endif } static void