aboutsummaryrefslogtreecommitdiff
path: root/src/common/tuklib_cpucores.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/tuklib_cpucores.c')
-rw-r--r--src/common/tuklib_cpucores.c6
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