mirror of
https://git.tukaani.org/xz.git
synced 2024-04-04 12:36:23 +02:00
CMake: Sync tuklib_cpucores.cmake with tuklib_cpucores.m4.
This was forgotten from commit 2611c4d905
.
This commit is contained in:
parent
fa9efb729b
commit
1c8cbb5be3
1 changed files with 5 additions and 0 deletions
|
@ -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 a new issue