fix proc_args on FreeBSD 6.0

This commit is contained in:
Doug MacEachern 2006-04-03 17:27:06 +00:00
parent db0622d030
commit fae3648010
1 changed files with 3 additions and 1 deletions

View File

@ -963,7 +963,9 @@ int sigar_proc_args_get(sigar_t *sigar, sigar_pid_t pid,
return SIGAR_OK; return SIGAR_OK;
#else #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); size_t len = sizeof(buffer);
int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_ARGS, 0 }; int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_ARGS, 0 };