From fae3648010bb02dae9e13ec3dba5cd3d746e81d1 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Mon, 3 Apr 2006 17:27:06 +0000 Subject: [PATCH] fix proc_args on FreeBSD 6.0 --- src/os/darwin/darwin_sigar.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/os/darwin/darwin_sigar.c b/src/os/darwin/darwin_sigar.c index b8dd7a92..5655341f 100644 --- a/src/os/darwin/darwin_sigar.c +++ b/src/os/darwin/darwin_sigar.c @@ -963,7 +963,9 @@ int sigar_proc_args_get(sigar_t *sigar, sigar_pid_t pid, return SIGAR_OK; #else - char buffer[ARG_MAX+1], *ptr=buffer; + /* ARG_MAX in FreeBSD 6.0 == 262144, which blows up the stack */ +#define SIGAR_ARG_MAX 65536 + char buffer[SIGAR_ARG_MAX+1], *ptr=buffer; size_t len = sizeof(buffer); int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_ARGS, 0 };