diff options
Diffstat (limited to 'thread-utils.c')
-rw-r--r-- | thread-utils.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/thread-utils.c b/thread-utils.c index 1f89ffab4c..374890e6b0 100644 --- a/thread-utils.c +++ b/thread-utils.c @@ -46,11 +46,11 @@ int online_cpus(void) mib[0] = CTL_HW; # ifdef HW_AVAILCPU mib[1] = HW_AVAILCPU; - len = sizeof(cpucount); - if (!sysctl(mib, 2, &cpucount, &len, NULL, 0)) - return cpucount; -# endif /* HW_AVAILCPU */ +# elif defined(HW_NCPUONLINE) + mib[1] = HW_NCPUONLINE; +# else mib[1] = HW_NCPU; +# endif /* HW_AVAILCPU */ len = sizeof(cpucount); if (!sysctl(mib, 2, &cpucount, &len, NULL, 0)) return cpucount; |