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.
This commit is contained in:
Alastair Poole 2019-11-17 17:52:25 +00:00
parent f472733f06
commit 5f76337553
1 changed files with 4 additions and 3 deletions

View File

@ -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