processes plugin: Fix the ARG_MAX stuff yet again.
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sat, 31 Jan 2009 23:32:12 +0000 (00:32 +0100)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sat, 31 Jan 2009 23:32:12 +0000 (00:32 +0100)
The `sysconf' approach does not work when doing something like
  char cmdline[ARG_MAX];
which is exactly what was done in the processes plugin.

Just use 4k whenever the define is not available - ought to be enough
for anybody! ;)

src/processes.c

index 5b244a6..0b82482 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
 # include <regex.h>
 #endif
 
+#ifndef ARG_MAX
+#  define ARG_MAX 4096
+#endif
+
 #define BUFSIZE 256
 
 static const char *config_keys[] =