|
Description
|
When executing /usr/bin/ptree [-a] $pid, where $pid is invalid, /usr/bin/ptree will return 0 as if the call had succeded with no stderr or stdout generated.
Example output:
---------------
$ ps -A | grep 47824
$ /usr/bin/ptree 47824
$ echo $?
0
$
Below is some of the output of truss with ptree.
>
>
> on execution of ptree with invalid pid:
> -------------------------------------
> open("/proc/105371/psinfo", O_RDONLY) = 5
> read(5, "\0\0\0\0\0\0\001\0019B9B".., 416) = 416
> close(5) = 0
> getdents(3, 0x100103178, 8192) = 0
> close(3) = 0
> _exit(0) <--We just exit 0
> (not correct)
>
> On execution of ptree with valid pid:
> -------------------------------------
> open("/proc/105373/psinfo", O_RDONLY) = 5
> read(5, "\0\0\0\0\0\0\001\0019B9D".., 416) = 416
> close(5) = 0
> getdents(3, 0x100103178, 8192) = 0
> close(3) = 0
> ioctl(1, TCGETA, 0xFFFFFFFF7FFFD7E8) = 0
> fstat(1, 0xFFFFFFFF7FFFD778) = 0
> 100321 /usr/dt/bin/dtlogin -daemon
> write(1, " 1 0 0 3 2 1 / u s r /".., 35) = 35
> write(1, " ", 2) = 2
> 101805 /usr/dt/bin/dtlogin -daemon
> ....
|