summaryrefslogtreecommitdiff
path: root/m4/tuklib_cpucores.m4
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2010-01-12 16:18:14 +0200
committerLasse Collin <lasse.collin@tukaani.org>2010-01-12 16:18:14 +0200
commit153c7740c54b3c90129dbd3d6153ac1303c4d605 (patch)
treedf4b8812a8b5c1cf71704134d87f667846b3a07c /m4/tuklib_cpucores.m4
parent8ea8dc754a7a5bc2d60db1eac201839cabdab6a1 (diff)
downloadxz-153c7740c54b3c90129dbd3d6153ac1303c4d605.tar.gz
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 'm4/tuklib_cpucores.m4')
-rw-r--r--m4/tuklib_cpucores.m411
1 files changed, 9 insertions, 2 deletions
diff --git a/m4/tuklib_cpucores.m4 b/m4/tuklib_cpucores.m4
index bb33c6f..d48f2e5 100644
--- a/m4/tuklib_cpucores.m4
+++ b/m4/tuklib_cpucores.m4
@@ -9,7 +9,7 @@
# This information is used by tuklib_cpucores.c.
#
# Currently this supports sysctl() (BSDs, OS/2) and sysconf() (GNU/Linux,
-# Solaris, Cygwin).
+# Solaris, IRIX, Cygwin).
#
# COPYING
#
@@ -54,7 +54,13 @@ int
main(void)
{
long i;
+#ifdef _SC_NPROCESSORS_ONLN
+ /* Many systems using sysconf() */
i = sysconf(_SC_NPROCESSORS_ONLN);
+#else
+ /* IRIX */
+ i = sysconf(_SC_NPROC_ONLN);
+#endif
return 0;
}
]])], [
@@ -71,7 +77,8 @@ case $tuklib_cv_cpucores_method in
sysconf)
AC_DEFINE([TUKLIB_CPUCORES_SYSCONF], [1],
[Define to 1 if the number of available CPU cores
- can be detected with sysconf(_SC_NPROCESSORS_ONLN).])
+ can be detected with sysconf(_SC_NPROCESSORS_ONLN)
+ or sysconf(_SC_NPROC_ONLN).])
;;
esac
])dnl