Pstree is a clone of the standard Linux pstree command, which displays
process information in a heirarchical fashion. It builds and runs on
SLS linux, RedHat linux (tested rhel3), FreeBSD
(tested on 4.4 & 4.8,)
and MacOS 10.0.4. Unlike the
standard pstree, it uses either sysctl() [macOS], kvm_getprocs()
[FreeBSD 4.?] or /proc [SLS linux] as needed.
pstree is free software; it is released under a BSD-style license that allows you to do as you wish with it as long as you don’t attempt to claim it as your own work.
To install pstree, do
$ ./configure.sh
$ make
then become root and do
# make install
If pstree needs to use sysctl() or kvm_getprocs() to read process
information, it will be installed as a setuid process to allow
it to read all of the process data.
basename() on the BSDs uses a static buffer to hold the new
basename. This makes it pretty much impossible to use basename()
for anything non-trivial unless you surround it with a strdup()
wrapper. The 0.5 release corrects this misfeature by replacing
basename() with a local function.-A
option (like -a, except it shows, if possible, the full
pathname to the program name.)/proc or use
sysctl() or kvm_getprocs().-l
option, automatic window width detection, more work on sysctl()
vs kvm_getprocs() so that it will work on FreeBSD versions that
don’t support kvm_getprocs() anymore.