Hopefully this will let us remove the empty file from bionic. It shouldn't
be there because -- unlike BSD -- we don't actually have a libutil.
Change-Id: I7e3042ca120aafa877709797866b52ac62675870
Insert a space between 'if'/'while' and their clause.
Also insert a space after ',' for arguments.
This was done with clang-format.
Bug: None
Change-Id: I5315eba3d5d8ac68996a373dc7c8e1bc45165824
Currently, 'ps' will segfault when called with '--ppid' and no argument.
Make it return an error instead.
Bug: 28383024
Change-Id: I71f2d1ba9502996ae75b17605234eb99ebb589f2
It's nothing like the real iftop, and there's no evidence anyone uses it.
In particular, it hasn't been touched since it was first checked in, back
in 2008. So it's either perfect or unused. Let's find out...
Change-Id: I941adbb67f0166b9b3bd796291060bd67eafa867
Remove the weird @command syntax, and make toolbox itself list the available
commands, like toybox does. Also stop special-casing toolbox itself.
Change-Id: I77dfaaf0cf42e375d866b77362dd8afa717fb2e1
Also cleans up two instances of open() with useless mode params, and
changes a few uses of snprintf to use sizeof(buffer) instead of
hardcoded buffer sizes.
Change-Id: If11591003d910c995e72ad8f75afd072c255a3c5
The use of PR to mean PSR rather than PR was confusing, so let's just
use PR and NI the same way everyone else does.
Also remove bogus blank lines and unnecessary delays (both before first
showing anything and after having shown the final iteration).
Bug: http://b/27447491
Change-Id: I676131956facf2167abb5d0852c55b0670b5eaa6
Allow the scripts to run with both python 2.x and 3.x
Change-Id: I911118bcf370d09bdb2fb46afa21af64257f1ffb
Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
The recent uapi header update moved all the interesting constants
out into another file. Track that, and add the missing makefile
dependency.
Bug: http://b/27073568
Change-Id: I8ac1dd1122865479f69a76cbf427d4aacdf7b790
There is at least one app that assumes that you will always get at least
one line of output in stdout from ps.
To fix this, move error output to stdout, and move the check of whether
/proc can be opened until after the ps header is printed.
Bug: 26554285
Change-Id: I6d9342aafd5c6f728735507cdd87a48a8e0373ac
The toolbox -t option is really the standard -H option. Add -H so
I can switch dumpstate over.
We should also flush after each run so we don't arbitrarily truncate
at the stdio buffer size. (I'm pretty sure no one uses toolbox top
interactively, but it annoyed me while testing -H.)
Change-Id: Ib87cb541d1b21c48468614b2ef60b0cc62694c95
This is another step towards being able to swap toolbox ps out for
a more complete ps. This should also let us fix dumpstate to not
need a separate "ps -Z" run --- we can just add -Z to the previous
run of ps instead.
Change-Id: I0b96dff51988edd2b33879f8c31faccebeeffddd
Regular ps doesn't have this, and at least in our tree everyone
seems to actually pipe to grep instead of using this anyway. But
since the switch to a more full-featured ps is going to be a nightmare
anyway, let's dip a toe in the water by removing something we don't plan
on supporting.
Change-Id: Id220ae0cfdad8368341730f643a2bfbaad3c9716
Since watchprops would have to be rewritten anyway in the upcoming properties
rewrite, there seems little point in rewriting it for toybox first. Let's
see how many people actually use watchprops and decide whether it's worth
the effort...
Change-Id: I996e7209bc81633ee66602f09f130226336d9987
None of our tools -- except for top, which I'd fixed previously --
handles SIGPIE correctly. Let's just handle SIGPIPE in the driver.
Bug: https://code.google.com/p/android/issues/detail?id=157920
Change-Id: I322ea411f53c71585a64118c217d54389f675d4e
Also remove the unused generality, and remove a dependency on a linux/
header file when there's a sys/ one that's even better.
Change-Id: If07608cc9ae2b7c2928ee2a9e33d20d63a9a8f45
ioctl_nr is passed signed to the kernel, but many users refer
to ioctl's in unsigned 32 bit notation.
Let's use stroll to set it, to let people specify either
negative numbers or large positive numbers.
Also improve error reporting.
Reported-By: Alex Piliev <ktnr74@motorola.com>
Change-Id: I789434895b70b051d4d5c1a5db566a1925478ef0