Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
|
|
(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".
|
|
Used by Android.
|
|
(Matches beginning and EOF at once.)
|
|
|
|
This lets '(x)\1' match, as reported by Isabella Parakiss.
|
|
an extra newline because the test for whether we have an existing string to
append a newline to was checking if struct step had data appended to it,
and the /x/ regex is data appended to it. Change test to check for null
terminator at ->arg1 offset.
|
|
|
|
Tempted to convert the struct arg_list and ptr_len stuff to arrays and
make the parsing table driven, but there's enough direct usages of each
field it's not a net win.
|
|
and vmlck into slot[18], pass error message to comma_args(), collate -stuUgG
callbacks into parse_rest().
|
|
inspired by:
https://android-review.googlesource.com/#/c/152663/4/libc/bionic/fgetxattr.cpp
|
|
Also, if you mkdir "$(echo -e "one\ntwo"); chmod -r one*; ls -q one*
it honors -q.
|
|
the global so "install -g 0" doesn't alias to "cp --preserve 0" and error out.
through to --preserve 0"
|
|
|
|
|
|
Fix FLAG_w.
|
|
rather than bitfields.
|
|
Fix more l/r justification, implement uname vsz vsize and stat.
|
|
Fixes two instances of "warning: use of logical '&&' with constant operand".
Change-Id: I2bb1ba4e389f8a9e54af8ee3ab23d8849fc329f0
|
|
plus tty detection fix from Elliott Hughes.
|
|
|
|
On Android, the filesystem column is pretty wide. Actually measure the widths.
|
|
(Assignment has spaces around operator, comparison doesn't.)
|
|
|
|
|
|
|
|
|
|
|
|
unify some TT.signame tests checking constant value variable initialized to.
|
|
|
|
Refactor the /proc/net parsing so this only adds 7 lines overall.
Also clear the DEVICE field for sockets and fix alignment for long
usernames (until someone implements the two-pass output that measures
columns).
|
|
The brillo folks wanted this in a shell script they're porting over
(so I've only implemented the fd style they wanted, not the named file
style).
|
|
|
|
|
|
|
|
|
|
|
|
Adds XVFORK() macro, teaches xpopen_both() to call /proc/self/exe with NULL
argv (and converts cpio -p to use that), adds TOYBOX_FORK guards to some
unconverted commands.
|
|
|
|
Note: vfork(), like fork(), can return -1 if too many processes, and
we should notice and fail loudly.
|
|
|
|
Elliott Hughes found a bug https://android-review.googlesource.com/#/c/170020/
and Daniel K. Levy worked out the problem: the user/group/newer arguments
to find weren't consuming their arguments when not checking the results of
their comparison (because an earlier test had already caused their
parenthetical group to fail). This confused the argument parsing logic
and could lead to segfaults.
I applied a different fix that reorganized the existing tests instead of
adding a new test. (Looks like a big commit but it's mostly whitespace
due to extra curly brackets changing indendentation levels.)
|
|
|