openbsd: use actual number of cpus being used

This commit is contained in:
Jasper Lievisse Adriaanse 2019-12-02 14:06:38 +01:00
parent 67657e6312
commit 2107ea84f1

@ -27,7 +27,7 @@
uint8_t get_cpu_count() uint8_t get_cpu_count()
{ {
int cpu_count = 1; // default to 1 int cpu_count = 1; // default to 1
int mib[2] = { CTL_HW, HW_NCPU }; int mib[2] = { CTL_HW, HW_NCPUONLINE };
size_t len = sizeof( cpu_count ); size_t len = sizeof( cpu_count );
if( sysctl( mib, 2, &cpu_count, &len, NULL, 0 ) < 0 ) if( sysctl( mib, 2, &cpu_count, &len, NULL, 0 ) < 0 )