mirror of https://git.tukaani.org/xz.git
CMake: Sync tuklib_cpucores.cmake with tuklib_cpucores.m4.
This was forgotten from commit 2611c4d905
.
This commit is contained in:
parent
fa9efb729b
commit
1c8cbb5be3
|
@ -89,7 +89,12 @@ function(tuklib_cpucores_internal_check)
|
|||
#include <sys/sysctl.h>
|
||||
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);
|
||||
|
|
Loading…
Reference in New Issue