Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
on files opened read-only, so revert last commit (force writeable logic).
|
|
These three are currently available in Android's ps but not in toybox ps.
|
|
|
|
|
|
|
|
(leading underscore version is 1<<NAME_TAG version, with 1LL for >31 shift),
suck lots of magic constants out of ps and use tag macros instead,
redo command line display so there's now 6 variants (CMD COMM ARGS from posix,
NAME CMDLINE from android, and COMMAND for completeness). Document more
cases where posix is nuts or widely ignored.
|
|
and slot numers into a structure. (Keeping multiple arrays in sync may have
been efficient but it was ugly.) Fix duplicate command name copying that
corrupted the name of kernel threads. Tighten up slot[] docs.
|
|
Valgrind complains that we add uninitalized memory to totals[] fields we never
read from. (If we didn't set it in entrylen() we don't use it during display,
they're testing the same flags), but valgrind doesn't understand that.
|
|
out.
Keep the low 32 bits of FLAG_x constants as 32 bit numbers so that at least
on little endian platforms it's still normal 32 bit math outside of lib/args.c.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Includes tests for the new feature, and a failure case for the minimal
perms test as well.
Also some typo fixing / massaging the help text so it fits in 80
columns.
|
|
|
|
move slot[] documentation into C code, add PR %VSZ VIRT RES SHR
|
|
Even though ext2 has a comment that it has to be at the start, I added swap
to the start of the array (oops). The test suite was also wrong (it was
matching the _incorrect_ output).
|
|
|
|
|
|
|
|
instead of carving up toybuf by hand. This makes breaking out the field
conversion logic into its own function less expensive.
|
|
Change readfileat() to pass back length of read.
|
|
1) It read st_dev instead of st_mode.
2) It reversed the semantics of absolute vs minimal ('-' prefixed) tests.
Add tests for these, and move the "unterminated -exec" test into the "Still
fails" section because it's still dumping core for me.
|
|
|
|
Four-digit years were being mangled by the code for two-digit years.
Move all the two-digit year code into the "we only saw two digits" case.
Add some new tests and fix existing tests.
|
|
functions to read major()/minor(), fix printf format warnings in error msg.
|
|
|
|
|
|
Both Android and GNU interpret -n to mean "show numeric users and groups",
despite what POSIX says.
|
|
This is equivalent to Android's historical "NAME" column, showing the
first element of /proc/pid/cmdline.
|
|
|
|
|
|
ticks _is_ 100...
|
|
|
|
Collate some repeated increments, remove some useless coments.
|
|
|
|
|
|
|
|
|
|
|
|
(The help infrastructure can collate and alphebetize short options,
long options haven't got a standardized help text format. Not a hard
requirement to have a short opt, but it's nice.)
|
|
"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.
|
|
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'
^
|
|
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".
|