summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.in16
-rw-r--r--plugins/common.h12
2 files changed, 13 insertions, 15 deletions
diff --git a/configure.in b/configure.in
index 2be2a1c6..bbcbb71c 100644
--- a/configure.in
+++ b/configure.in
@@ -1268,21 +1268,21 @@ if test -n "$ac_cv_nslookup_command"; then
1268 AC_DEFINE_UNQUOTED(NSLOOKUP_COMMAND,"$ac_cv_nslookup_command", [path and args for nslookup]) 1268 AC_DEFINE_UNQUOTED(NSLOOKUP_COMMAND,"$ac_cv_nslookup_command", [path and args for nslookup])
1269fi 1269fi
1270 1270
1271AC_MSG_CHECKING([for number of cpus]) 1271AC_MSG_CHECKING([for number of online cpus])
1272AC_TRY_COMPILE([#include <unistd.h>], 1272AC_TRY_COMPILE([#include <unistd.h>],
1273 [sysconf(_SC_NPROCESSORS_ONLN) > 0;], 1273 [sysconf(_SC_NPROCESSORS_ONLN) > 0;],
1274 AC_DEFINE(HAVE_SYSCONF__SC_NPROCESSORS_ONLN,1,[Define if sysconf returns number of cpus]) 1274 AC_DEFINE(HAVE_SYSCONF__SC_NPROCESSORS_ONLN,1,[Define if sysconf returns number of online cpus])
1275 AC_MSG_RESULT([sysconf(_SC_NPROCESSORS_ONLN)]), 1275 AC_MSG_RESULT([sysconf(_SC_NPROCESSORS_ONLN)]),
1276 AC_MSG_RESULT([cannot calculate]) 1276 AC_MSG_RESULT([cannot calculate])
1277 ) 1277 )
1278 1278
1279AC_MSG_CHECKING([for number of available cpus])
1279AC_TRY_COMPILE([#include <unistd.h>], 1280AC_TRY_COMPILE([#include <unistd.h>],
1280 [sysconf(_SC_NPROCESSORS_CONF) > 0;], 1281 [sysconf(_SC_NPROCESSORS_CONF) > 0;],
1281 AC_DEFINE(HAVE_SYSCONF__SC_NPROCESSORS_CONF,1,[Define if sysconf returns number of cpus]) 1282 AC_DEFINE(HAVE_SYSCONF__SC_NPROCESSORS_CONF,1,[Define if sysconf returns number of available cpus])
1282 AC_MSG_RESULT([sysconf(_SC_NPROCESSORS_CONF)]), 1283 AC_MSG_RESULT([sysconf(_SC_NPROCESSORS_CONF)]),
1283 AC_MSG_RESULT([cannot calculate]) 1284 AC_MSG_RESULT([cannot calculate])
1284 ) 1285 )
1285
1286 1286
1287AC_PATH_PROG(PATH_TO_UPTIME,uptime) 1287AC_PATH_PROG(PATH_TO_UPTIME,uptime)
1288AC_ARG_WITH(uptime_command, 1288AC_ARG_WITH(uptime_command,
diff --git a/plugins/common.h b/plugins/common.h
index 858329fd..8f05c158 100644
--- a/plugins/common.h
+++ b/plugins/common.h
@@ -82,14 +82,12 @@
82 getting that data 82 getting that data
83 Will return -1 if cannot get data 83 Will return -1 if cannot get data
84*/ 84*/
85#ifdef HAVE_SYSCONF__SC_NPROCESSORS_ONLN 85#if defined(HAVE_SYSCONF__SC_NPROCESSORS_ONLN)
86#define GET_NUMBER_OF_CPUS() sysconf(_SC_NPROCESSORS_ONLN) 86# define GET_NUMBER_OF_CPUS() sysconf(_SC_NPROCESSORS_ONLN)
87#elif defined (HAVE_SYSCONF__SC_NPROCESSORS_CONF)
88# define GET_NUMBER_OF_CPUS() sysconf(_SC_NPROCESSORS_CONF)
87#else 89#else
88# ifdef HAVE_SYSCONF__SC_NPROCESSORS_CONF 90# define GET_NUMBER_OF_CPUS() -1
89# define GET_NUMBER_OF_CPUS() sysconf(_SC_NPROCESSORS_CONF)
90# else
91# define GET_NUMBER_OF_CPUS() -1
92# endif
93#endif 91#endif
94 92
95#ifdef TIME_WITH_SYS_TIME 93#ifdef TIME_WITH_SYS_TIME