diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2010-01-12 16:18:14 +0200 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2010-01-12 16:18:14 +0200 |
commit | 153c7740c54b3c90129dbd3d6153ac1303c4d605 (patch) | |
tree | df4b8812a8b5c1cf71704134d87f667846b3a07c /src/common/tuklib_cpucores.c | |
parent | Fix _memconfig() functions. (diff) | |
download | xz-153c7740c54b3c90129dbd3d6153ac1303c4d605.tar.xz |
Add IRIX-specific code to tuklib_physmem and tuklib_cpucores.
This is untested but it will get tested soon and, if needed,
fixed before 5.0.0.
Thanks to Stuart Shelton.
Diffstat (limited to 'src/common/tuklib_cpucores.c')
-rw-r--r-- | src/common/tuklib_cpucores.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/common/tuklib_cpucores.c b/src/common/tuklib_cpucores.c index 0a8081ff..e35d9bc7 100644 --- a/src/common/tuklib_cpucores.c +++ b/src/common/tuklib_cpucores.c @@ -37,7 +37,13 @@ tuklib_cpucores(void) ret = (uint32_t)cpus; #elif defined(TUKLIB_CPUCORES_SYSCONF) +# ifdef _SC_NPROCESSORS_ONLN + // Most systems const long cpus = sysconf(_SC_NPROCESSORS_ONLN); +# else + // IRIX + const long cpus = sysconf(_SC_NPROC_ONLN); +# endif if (cpus > 0) ret = (uint32_t)cpus; #endif |