diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2009-08-29 13:39:21 +0300 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2009-08-29 13:39:21 +0300 |
commit | 27414daadf5727e8ab942374b5ec1c8990122878 (patch) | |
tree | f0c214fa98ef24f296e288529e2aefb456a75794 /src/common/cpucores.h | |
parent | Fix x86 assembler on GCC 3. (diff) | |
download | xz-27414daadf5727e8ab942374b5ec1c8990122878.tar.xz |
Fix sysctl() usage.
This fixes build on *BSDs and Darwin.
Thanks to Jukka Salmi for the patches.
Richard Koch reported the problem too.
Diffstat (limited to 'src/common/cpucores.h')
-rw-r--r-- | src/common/cpucores.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/cpucores.h b/src/common/cpucores.h index 704d8a26..330cd9c9 100644 --- a/src/common/cpucores.h +++ b/src/common/cpucores.h @@ -40,7 +40,7 @@ cpucores(void) int name[2] = { CTL_HW, HW_NCPU }; int cpus; size_t cpus_size = sizeof(cpus); - if (!sysctl(name, &cpus, &cpus_size, NULL, NULL) + if (!sysctl(name, 2, &cpus, &cpus_size, NULL, 0) && cpus_size == sizeof(cpus) && cpus > 0) ret = (uint32_t)(cpus); #endif |