aboutsummaryrefslogtreecommitdiff
path: root/toys/posix/ps.c
AgeCommit message (Collapse)Author
2015-11-02Fix the ps -o CMD vs COMM distinction.Elliott Hughes
"comm" is the command name without arguments, and "cmd" the command line including arguments. Confusingly, "command" is a synonym for the *latter*, not the former. This implementation of "comm" matches the GNU ps behavior where the names are truncated, but Android historically used the full name from /proc/pid/cmdline instead, so this patch isn't sufficient to let us match the Android behavior.
2015-11-02Make ps -o error reporting intelligible.Elliott Hughes
I actually thought ps was segfaulting, and it wasn't until I was in gdb that I even noticed there was an error message at all, and even then I had to read the source to work out what it was trying to tell me. Before: $ ps -o user,pid,ppid,vsize,rss,nice,wchan,addr,unknown,stat,cmd ps: -o 'user,pid,ppid,vsize,rss,nice,wchan,addr,unknown,stat,cmd'@41 USER PID PPID VSZ RSS NI WCHAN ADDR$ After: $ ps -o user,pid,ppid,vsize,rss,nice,wchan,addr,unknown,stat,cmd ps: bad -o field 'user,pid,ppid,vsize,rss,nice,wchan,addr,unknown,stat,cmd' ^
2015-11-02Add ps -Z.Elliott Hughes
As with ls, it doesn't seem like -Z should be guarded behind LSM availability. On a non-SELinux system, the label is always "unconfined".
2015-11-02Add ps --ppid.Elliott Hughes
Used by Android.
2015-10-28Promote ps to posix.Rob Landley