diff options
author | rwatson <rwatson@FreeBSD.org> | 2007-12-10 20:55:43 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2007-12-10 20:55:43 +0000 |
commit | 8bc41fcc02ff4a03b29c2a776d0866b0030bcdc2 (patch) | |
tree | d45a0b2693d7dfd7613ff915d2c1cc46c6ca0e8d /usr.bin/procstat/procstat_bin.c | |
parent | 95c502771082069b023dca6ea4367751107e3d52 (diff) | |
download | FreeBSD-src-8bc41fcc02ff4a03b29c2a776d0866b0030bcdc2.zip FreeBSD-src-8bc41fcc02ff4a03b29c2a776d0866b0030bcdc2.tar.gz |
Add 'COMM' column to a few more output modes of procstat(1). The only
one it's missing from is the VM display, where there's really not room,
and the file output display is looking quite cramped.
Diffstat (limited to 'usr.bin/procstat/procstat_bin.c')
-rw-r--r-- | usr.bin/procstat/procstat_bin.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/procstat/procstat_bin.c b/usr.bin/procstat/procstat_bin.c index a6757eb..178d0a4 100644 --- a/usr.bin/procstat/procstat_bin.c +++ b/usr.bin/procstat/procstat_bin.c @@ -28,6 +28,7 @@ #include <sys/types.h> #include <sys/sysctl.h> +#include <sys/user.h> #include <err.h> #include <errno.h> @@ -45,7 +46,7 @@ procstat_bin(pid_t pid, struct kinfo_proc *kipp) size_t len; if (!hflag) - printf("%5s %-70s\n", "PID", "PATH"); + printf("%5s %-16s %-53s\n", "PID", "COMM", "PATH"); name[0] = CTL_KERN; name[1] = KERN_PROC; @@ -64,5 +65,6 @@ procstat_bin(pid_t pid, struct kinfo_proc *kipp) strcpy(pathname, "-"); printf("%5d ", pid); + printf("%-16s ", kipp->ki_comm); printf("%s\n", pathname); } |