Age | Commit message (Collapse) | Author |
|
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.
|
|
I've also flipped the `#if` because `#ifdef` feels more naturally readable
than #ifndef when there's also a `#else`.
(I've preserved the oddness of the clearenv declaration being here,
because there isn't currently a more suitable `#ifdef __APPLE__` to move
it too. Later...)
|
|
|
|
|
|
The only part of this I actually need for macOS is to remove __APPLE__
from the getdelim/getline workaround, but if we're following the usual
"seven year rule", glibc 2.10 is dead to us anyway, and we should just
remove all of this.
|
|
The new tests pass on the host (coreutils 8.28) and with toybox after
this patch is applied.
|
|
|
|
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.
|
|
The macOS libc headers use `__attribute__((noreturn))` rather than
`__attribute__((__noreturn__))`, so toybox's `noreturn` macro trips them
up. Since we already have a variety of uses of `__attribute__` that
aren't guarded in this way, let's do the same here.
|
|
GNU sed supports -E, -r, and --regexp-extended. BSD sed only supports
-r.
|
|
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"
|
|
|
|
|
|
|
|
|
|
|
|
default in Yocto 2.6 Thud release" and identified several error_exit() and
friends that should use the _raw versions.
|
|
|
|
At least the AOSP build doesn't try to _set_ the hostname...
|
|
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...)
|
|
|
|
|
|
genbuild() is a bunch of echo statements, and with enough parallelism piping
its output to "head" can close the pipe before all the echo statements have
run, then they complain about writing to a closed pipe. (We're intentionally
discarding the output, it's not an error, so...)
|
|
|
|
|
|
|
|
(Alas, llvm doesn't understand -Wno-maybe-uninitialized yet.)
|
|
We've removed the need for perl and runalarm, rsync was misleading
(as you'd hope!), and we now use a prebuilt of the xmllint in AOSP itself.
|
|
UIO_MAXIOV/_SC_UIO_MAXIOV.
|
|
|
|
|
|
|
|
|
|
changed), better error message when .config missing.
|
|
(Output file is read only because broken installs that write to the old filename
will truncate+overwrite toybox binary otherwise.)
|
|
Prior to calling TIOCGWINSZ on stdin/stdout/stderr, check to see if the
file descriptor is a tty. Calling TIOCGWINSZ on a non-tty doesn't make
any sense.
Calling TIOCGWINSZ on a non-tty is mildly problematic for systems like
Android where strict ioctl filtering is in place, and generates SELinux
audit noise.
Strict ioctl filtering for non-filesystem fifo_files (eg pipe() or
pipe2() generated pipes) was enabled in Android in commit
https://android-review.googlesource.com/c/platform/system/sepolicy/+/792599
|