On Tue Dec 05 02:16:31 2006, henry.gao@ubs.com wrote:
Show quoted text> Looks like the proc::processTable Solaris implementation is the same
> as /usr/bin/ps - using psinfo->pr_psargs, which truncate CMD field to
> 80 chars. Is it possible to change it the same way as /usr/ucb/ps
> which uses /proc/<pid>/as? and doesn't have limitation
/usr/bin/ps and Proc::ProcessTable just read /proc, which gets all the
data out of the kernel. The kernel on Solaris only stores the first 80
chars of the command line, so the whole command line is simply not
available.
What /usr/ucb/ps and (on 5.9 and later) pargs do to get the whole
command line is to open up the address space of the process, grovel
around for the pointer stored at argv, and then read that. It's a bit
of ugly code, but it can be done -- but only for those processes that
are running under the same uid as yourself.
(/usr/ucb/ps used to be setuid root to allow it to show the whole
command line of any process, but that changed in a security patch to
Solaris 5.8)