aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-07-03Improve file(1)'s ELF support.Elliott Hughes
Read any PT_NOTE sections to look for NT_GNU_BUILD_ID or Android API level notes. I deliberately didn't NT_GNU_ABI_TAG because it's noisy -- every Linux executable has one -- but not something most command-line users will have any use for. (And you can ask readelf(1) anyway.) Also read the section headers to implement "stripped"/"not stripped". This patch removes "uses %d libs" because it was actually just counting dynamic sections in the ELF file, and there are only 0 or 1 of those in a valid ELF flie. (If you really want this functionality, you have to *parse* the dynamic section looking for the DT_NEEDED entries. But that's more of a job for readelf(1) than file(1).)
2016-07-03Promote netsat, and move ifconfig, netcat, and rfkill to new toys/net directory.Rob Landley
2016-07-03More netstat cleanup (inline display_data)Rob Landley
2016-07-02Next round of netstat cleanup.Rob Landley
2016-06-30Add patch -d and --dry-runRob Landley
2016-06-30Fix option parsing infrastructure bug.Rob Landley
In main.c: used adjusted string with placeholers for removed options (so flag values don't move based on config, allowing FORCE_FLAGS to work). In scripts/mkflags.c: test was wrong, a bare longopt never matches a single letter command, but it was treated as always matching when comparing allyesconfig vs current config to determine which options were disabled, so there was a corner case that got the flag values wrong.
2016-06-30Teach wc to do -cm together. Fix testsuite so TEST_HOST passes too.Rob Landley
2016-06-30Add NOSPACE=1 to allow tests to pass with diff -bRob Landley
2016-06-30Use libbuf instead of stack buffer.Rob Landley
2016-06-29Remove unused argument from do_lines()Rob Landley
2016-06-29Remove 'start' and 'stop' from the Android roadmap.Elliott Hughes
2016-06-29Update Android section of roadmap.Elliott Hughes
nandread was MTD-only, and we don't support MTD any more.
2016-06-28Fix iteration for start/stop without arguments.Elliott Hughes
2016-06-28Fix a "may be used uninitialized".Rob Landley
2016-06-27Fix start.c build and add error reporting.Elliott Hughes
2016-06-25Code style pass.Rob Landley
2016-06-25new Android toys: start/stopElliott Hughes
2016-06-23Update Android section of roadmap.Elliott Hughes
top switched over a week or two back, and log switched today.
2016-06-23Remove android/log's "default" priority.Elliott Hughes
It turns out that "default" goes nowhere. Whereas "silent" actually shows up in the log. So document "silent" (which we already supported) but remove support for "default". Also make the spacing between levels in the help more regular; it looks weird being in columns when there's only one row!
2016-06-21Attempt at cleanup of log.c, but I don't have a build environment for it so...Rob Landley
2016-06-21new Android toy: logElliott Hughes
2016-06-19Last commit depends on new lib code I forgot to check in. (Oops.)Rob Landley
2016-06-19Next round of diffstat cleanup.Rob Landley
2016-06-17Make it clearer that CMD is the thread name.Elliott Hughes
It should come as no surprise to those who followed the development of this that it's not well known which of the various names is actually the thread name. Adding "thread" to the ps --help output seems like a good idea. I'm also assuming that "stat2" was meant to read "stat[2]", since that's how it mostly appeared on the list while discussing this. Still fits in 80 columns.
2016-06-15Add readlink0() and readlinkat0() which null terminate the data.Rob Landley
2016-06-15The glibc bug at https://sourceware.org/bugzilla/show_bug.cgi?id=17829Rob Landley
continues to get worse, and now can't handle INT_MAX/2 either. So our first workaround _also_ broke. But posix says "A negative precision is taken as if the precision were omitted." and that _doesn't_ trigger the glibc bug, so use that instead.
2016-06-12Lots of netstat cleanup, including a rewrite of the unix domain socket output.Rob Landley
(Ubuntu's netstat is left justifying the inode field, and they're wrong.)
2016-06-12Finish switching to dev_major/dev_minor.Elliott Hughes
7ca5dc4232b9ac5ee5cd25c8b5b33a58904cd251 didn't switch all callers over to the new functions.
2016-06-10Missing parentheses. (Oops.)Rob Landley
2016-06-10Fix trailing whitespace bug in netstat.Elliott Hughes
Spotted while trying to diff netstat -nt against toybox netstat -nt.
2016-06-10xreadlink() only exits for memory allocation, it returns 0 if file not found.Rob Landley
(I forget who reported this bug, wasn't me.)
2016-06-10Update Android roadmap section.Elliott Hughes
We killed toolbox ioctl and wouldn't build a toybox one anyway. Also admit that -- although toybox has a grep -- we're not actually using it yet (and why we're not).
2016-06-10Shuffle arguments around (TNAME->NAME->COMM->CMD), working around posixRob Landley
constraints while still trying to get sane behavior. Discard the old CMD, move COMM to CMD, move the old NAME to COMM, and move TNAME to NAME. Posix assumes argv[] is the only source of process name data, but Linux has three sources (/proc/$PID/cmdline, /proc/$PID/exe, /proc/$PID/stat field 2) and android uses multiple sources simultaneously to identify its processes and threads. Toybox ps also assumes that the field names displayed in the headers can be fed to -o to get that output, which is an assumption posix's ps spec clearly does not have. Before we were erring on the side of posix, now we're erring on the side of sanity. CMD now shows stat[2], all the time. The posix -f behavior change is now just an ARGS=CMD alias in the -f default command line, which -o overrides. (Before -f changed the behavior of -o CMD, which is closer to what posix says but is _insane_ and we've stopped doing it.) COMM now shows /proc/$PID/exe minus the path. (I'm aware posix says argv[0] here, but it says argv everywhere.) NAME is now argv[0] of $PID. TNAME went away. Both $COMM and $NAME show the data for $PID, which is a thread's parent process when $TID != $PID.
2016-06-10Revert commit e02e41373ea3, we're always initializing the TNAME stringRob Landley
field (that's the ptb/tb switching in get_ps) so it's never blank, so this doesn't trigger. (Conditionally initializing it would save runtime memory, but at the expense of more complex code.)
2016-06-10HACK: restore Android ps behavior.Elliott Hughes
"NAME" is no longer doing what we want; "TNAME" is what "NAME" used to be, except that "TNAME" implies -T. This patch switches us over to "TNAME", disables the implicit -T. Change-Id: I5553703d3939b24eaf39976162d2f75a591e1ce8
2016-06-09Fix dangling link after cp commandKyungsik Lee
"toybuf" should be initialized before calling symlinkat() or dangling link could occur.
2016-06-08Fix ps bug, last field wasn't expanding to width.Rob Landley
(Still fixing the fallout from that "Don't truncate number fields" logic rewrite.)
2016-06-08Change the TNAME behavior to "Show parent argv[0]. If that's blank, showour ↵Rob Landley
argv[0]. If that's blank, show [stat2]." That way threads show their parents, parents show themselves, and kernel threads show the [stat2] name.
2016-06-07Izabera pointed out that cmp -ls are contradictory.Rob Landley
2016-06-05Fix TOYBOX_VERSIONPaul Barker
The latest tagged version is 0.7.1.
2016-06-04Basic success/failure return from pgrep/pkill.Elliott Hughes
The man page says they also return 2 for syntax errors and 3 for "fatal error: out of memory etc", but I don't know how to implement that and don't need it (or have any reason to believe anyone needs it). Bug: 29092208
2016-06-04ps: Show [stat2] for any otherwise blank process name field, expand TNAME to 27,Rob Landley
use generated constant for stat field parsing loop.
2016-05-31In cp -a, don't complain if non-root user can't chown, failure is expected.0.7.1Rob Landley
2016-05-30Add output path to cp error message filenames.Rob Landley
2016-05-27Add -o TNAME for android, fix display of last field (retain left justifificationRob Landley
when trimmed for screen width), make ARGS path trimming logic work with spaces in path.
2016-05-26Stabilize another sort.Elliott Hughes
Unstable sorting means confusing diffs if you're checking in the generated files. (Which I shouldn't be doing, but getting this bundle of random scripts into Android's build system isn't going to be easy...)
2016-05-25Stand alone builds of OLDTOY should show help text for corresponding NEWTOY.Rob Landley
2016-05-24The "show parent command path" commit changed the criteria for active nodes,Rob Landley
and the collate logic wasn't updated. (Oops.)
2016-05-23Fix remaining pkill tests.Elliott Hughes
I don't know that anyone cares, but these failures made me think I'd broken something while testing the -SIGNAL patch. The -s parsing wasn't taking into account that -s 0 is a special case, and the -o test was assuming that pkill can tell the difference between two processes started at roughly the same time. Hopefully there's higher-resolution data available that can avoid the need for yet another sleep in the tests.
2016-05-23Fix pkill -9.Elliott Hughes
This fixes the existing test. Internal Android bug 28877702. I've left -l as-is, even though the desktop doesn't support that.