make use_ucb_ps default on to get around proc_pargs permissions

This commit is contained in:
Doug MacEachern 2006-10-13 13:07:31 +00:00
parent 59fddd3f7c
commit 2fd03a2fde
1 changed files with 13 additions and 4 deletions

View File

@ -67,9 +67,12 @@ int sigar_os_open(sigar_t **sig)
sigar->solaris_version = 6; sigar->solaris_version = 6;
} }
/* experimental, use /usr/ucb/ps for proc_args */ if ((ptr = getenv("SIGAR_USE_UCB_PS"))) {
sigar->use_ucb_ps = sigar->use_ucb_ps = strEQ(ptr, "true");
getenv("SIGAR_USE_UCB_PS") ? 1 : 0; }
else {
sigar->use_ucb_ps = 1;
}
sigar->pagesize = 0; sigar->pagesize = 0;
i = sysconf(_SC_PAGESIZE); i = sysconf(_SC_PAGESIZE);
@ -867,7 +870,13 @@ int sigar_proc_args_get(sigar_t *sigar, sigar_pid_t pid,
* punt any 64bit native process, * punt any 64bit native process,
* sizeof our structures can't handle. * sizeof our structures can't handle.
*/ */
return EINVAL; if (sigar->use_ucb_ps) {
return ucb_ps_args_get(sigar, pid, procargs,
pinfo->pr_start.tv_sec);
}
else {
return ENOTSUP;
}
} }
argv_size = sizeof(*argvp) * pinfo->pr_argc; argv_size = sizeof(*argvp) * pinfo->pr_argc;