From: Florian Forster Date: Sat, 31 Jan 2009 23:32:12 +0000 (+0100) Subject: processes plugin: Fix the ARG_MAX stuff yet again. X-Git-Tag: collectd-4.6.0~90 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=42f7cda0cc181fb90bbe7c8c892c451914b72fd4;p=collectd.git processes plugin: Fix the ARG_MAX stuff yet again. 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! ;) --- diff --git a/src/processes.c b/src/processes.c index 5b244a6c..0b824821 100644 --- a/src/processes.c +++ b/src/processes.c @@ -83,13 +83,6 @@ # 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 @@ -109,6 +102,10 @@ # include #endif +#ifndef ARG_MAX +# define ARG_MAX 4096 +#endif + #define BUFSIZE 256 static const char *config_keys[] =