processes plugin: Make sure ARG_MAX is defined.
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sat, 31 Jan 2009 22:55:30 +0000 (23:55 +0100)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sat, 31 Jan 2009 22:55:30 +0000 (23:55 +0100)
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
src/processes.c

index a62b94a..e54d87e 100644 (file)
@@ -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
 
index 0d670f5..5b244a6 100644 (file)
 #  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