From d99dc6b0dc0f4f096ebb93c827a0cea2fd4e09e2 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Sat, 31 Jan 2009 23:55:30 +0100 Subject: [PATCH] processes plugin: Make sure ARG_MAX is defined. Apparently the GNU libc 2.8 removed the macro for some unholy reason. We either use `sysconf(3)' transparently (if available) or 4kByte (the POSIX minimum). Thanks to dD0T for reporting the problem :) --- configure.in | 2 +- src/processes.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index a62b94a1..e54d87e0 100644 --- a/configure.in +++ b/configure.in @@ -400,7 +400,7 @@ AC_HEADER_TIME # Checks for library functions. # AC_PROG_GCC_TRADITIONAL -AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog) +AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf) AC_FUNC_STRERROR_R diff --git a/src/processes.c b/src/processes.c index 0d670f5b..5b244a6c 100644 --- a/src/processes.c +++ b/src/processes.c @@ -83,6 +83,13 @@ # ifndef CONFIG_HZ # define CONFIG_HZ 100 # endif +# ifndef ARG_MAX +# if defined(HAVE_SYSCONF) && HAVE_SYSCONF && defined(_SC_ARG_MAX) +# define ARG_MAX sysconf(_SC_ARG_MAX) +# else +# define ARG_MAX 4096 +# endif +# endif /* #endif KERNEL_LINUX */ #elif HAVE_LIBKVM_GETPROCS -- 2.30.2