Age | Commit message (Collapse) | Author |
|
Handling -e by gluing together multiple regexes with | wasn't portable,
break down and do a linked list with for loops.
|
|
|
|
|
|
|
|
|
|
When necessary, realloc() the line to add 4 aligned bytes of storage at
the end, stick the unsigned offset in there, and then fish it back out for
display (and add 1 because offset is 0 based and display is 1 based).
|
|
|
|
Several parameters common on Linux are missing on macOS.
|
|
|
|
Be consistent about upper versus lower case. (Upper seems to have the
majority, so I went with that, though I'm happy to provide the opposite
patch as long as we're consistent!)
Be consistent about using \t. (Though saving a few bytes seems like it
might be better done in the code that generates help.h rather than
directly in the source, since tabs make careful ASCII art layout hard
enough that we regularly have things misaligned.)
Remove trailing periods (most of which seem to have been added by me).
Always use the US "human readable" rather than my British
"human-readable", and be more consistent about declaring whether we're
showing multiples of 1000 or 1024.
Just say "verbose" rather than adding a useless "mode" or "output".
|
|
|
|
|
|
Don't hard-code Linux's buffer size.
|
|
|
|
Even if we don't build ps, we can't have a Linux-only struct in GLOBALS.
The obvious alternative to this would be to have a fake struct sysinfo
in lib/portability.h. Since having a real macOS replacement for
sysinfo(2) seems unlikely at this point, I went this route instead.
|
|
bionic, glibc, macOS, and musl all have strcasestr
(see http://man7.org/linux/man-pages/man3/strstr.3.html).
macOS (via BSD) has a strnstr that does what strnstr sounds like it
should do by analogy with strnlen and strncpy.
So we at least need to rename strnstr, but it probably makes more sense
just to switch to strcasestr instead.
|
|
Used by OTA package scripts in AOSP, and quite widely inside Google.
I've also added --lines because it seems crazy to support one and not
the other, and --lines is also widly used inside Google too.
|
|
There are a bunch of if (!memcmp(s+28,...)) lines,
let's make them "else if"
|
|
I actually only need --quiet to build AOSP, but it seems weird to add
--quiet as a synonym for -s but _not_ add the more obviously related
--silent.
|
|
|
|
|
|
AOSP doesn't need -a specifically, but since it's needed for -s we may
as well accept it too.
|
|
I assume it's actually meaningful on BSD/macOS and makes them behave
like us, but I don't have access to a Mac to test that theory.
|
|
Both occur in AOSP. (Until I looked, I had no idea there were _two_
long versions of -p...)
|
|
|
|
|
|
UIO_MAXIOV/_SC_UIO_MAXIOV.
|
|
|
|
xparsetime() not to need floating point, adjust callers.
|
|
|
|
From eyeballing the output of
for i in `./toybox | tr " " "\n"` ; do ./toybox $i --help ; done | \
grep '^-' | grep -v "\t"
|
|
|
|
|
|
remove curly brackets around single line if().
|
|
`errno` isn't meaningful here.
|
|
Also improve the -l output to include sections (because you need to
know whether you're dealing with a pathconf variable to supply the
required path).
|
|
glibc doesn't have _XOPEN_UUCP (though bionic does), which meant that the
generated array of values was out of sync with the hand-written array of
names.
This patch removes that by using a unified array and the preprocessor.
A side benefit of this for me is that it makes toybox easier to integrate
in the AOSP build system (the less shell script magic, the better).
|
|
I've had added the argument, but I don't know what it wants? Ubuntu's file
calls a bmp file "data".
|
|
|
|
|
|
|
|
|
|
|
|
(Well, when you say --color or "alias ls='ls --color=auto'" in your shell.)
|
|
|
|
that argument (so "t:" fills out TT.t), 2) go ahead and collate arguments of
same type on same line. (Order's guaranteed by C99 either way.)
|
|
|
|
|
|
This was found by https://kernel.googlesource.com/pub/scm/linux/kernel/git/shuah/linux-kselftest/+/master/tools/testing/selftests/splice/default_file_splice_read.sh which broke after the recent change.
Plus this actually fixes another of our existing test failures on the host.
I'm assuming we don't want to try the "exact fit" heuristics until we
have a concrete need for them. (I haven't fully understood the
circumstances under which they're used, though the two remaining host
test failures appear to be because of them.)
Bug: http://b/111891791
Test: ran tests
|
|
|