aboutsummaryrefslogtreecommitdiff
path: root/toys/posix
AgeCommit message (Collapse)Author
2017-11-16Minor tweaks.Rob Landley
2017-11-16Add "df -i".Elliott Hughes
Also switch to u64 for calculations. Some FUSE file systems have inode counts large enough to overflow s64.
2017-11-03file(1): add ogg, TrueType font, LLVM bitcode, PEM certs, and PE executables.Elliott Hughes
More of the files encountered on the Android system image (plus PE executables, which we build but which shouldn't actually make it to the system image!).
2017-10-31Add top -m, fix width truncating for narrow screens (off by one), and add ↵Rob Landley
iotop -H
2017-10-31Fix cut -s and -f when delimiter not found (posix says print whole line).Rob Landley
2017-10-25Make -c work with unicode chars, and first stab at -C measuring columns.Rob Landley
2017-10-17Fix groups(1) and id -G.Elliott Hughes
Both should only output the groups.
2017-10-10Complete rewrite of cut. Handle multipe ranges, add -DFO options, startRob Landley
of utf8 support (not finished yet)... Adds new loopfiles_lines() wrapper to lib.c that calls do_lines from loopfiles.
2017-10-01Fix xargs to obey POSIX's ARG_MAX restrictions.Elliott Hughes
This avoids "xargs: exec echo: Argument list too long" errors in practice. find(1) needs to be fixed too, but that's a bit more complicated and a working xargs provides a workaround. Bug: http://b/65818597 Test: find /proc | strace -f -e execve ./toybox xargs echo > /dev/null
2017-09-25Basic Mach-O support in file(1).Elliott Hughes
The Nexus Player build was subtly broken in that it assumed that the host was using ELF. No-one noticed until a Mac user tried to flash their build, which contained a Mach-O x86 binary instead of an ELF x86 binary. Hilarity ensued. (On the same day, file(1) was able to explain a mixup with an ELF hexagon binary. Next time we see a Mach-O binary on an Android device, we'll be ready!) Bug: http://b/66741960
2017-09-05Replace remaining mb*towc() calls with utf8towc().Rob Landley
2017-09-02In wc, replace mbrtowc() with new utf8towc() which doesn't have a context structRob Landley
or care about locale.
2017-08-31Another try at fixing the ps segfault resulting from /proc entries vanishingRob Landley
out from under us due to asyncronous process exit. The directory we're traversing vanishing can result in DIRTREE_ABORTVAL being returned, which we turn into a NUL entry, but then we were trying to look at that null entry's children. Oops.
2017-07-22Typo (env -0 was checking the flag wrong).Rob Landley
2017-07-02Add -t, deviations from posix, redo loop to have fewer duplicate tests.Rob Landley
2017-07-02strings tests and bugfixesIlya Kuzmich
Fixes missing newline in output if last byte of the input is string. Fixes one-off offset bug. Adds strings tests. Signed-off-by: Ilya Kuzmich <ilya.kuzmich@gmail.com>
2017-06-27whitespace/comment tweaks.Rob Landley
2017-06-27teach head -cIlya Kuzmich
Not POSIX, but implemented in coreutils, busybox and freebsd.
2017-06-19Manually inline TOP_COMMON and PGKILL_COMMON help text until I can teachRob Landley
the help infrastructure to handle it. (The lifetime rules are all wrong for hunks that get reused. Needs a largeish rewrite.)
2017-06-14Grep exits with 2 for errors, which can happen at any time ( > /dev/full).Rob Landley
2017-06-12Add grep -M match and -S skip supporting wildcard patterns.Rob Landley
They don't imply -r because you might do find . -type f | xargs -S blah regex
2017-06-11Provide error messages for files we can open but not read (ala directories).Rob Landley
2017-06-10Fix bug where grep stopped at first dangling symlink and error_exited().Rob Landley
2017-06-04Don't add cpio TRAILER!!! entry by default, add new --trailer option if youRob Landley
want that. (This lets you concatenate cpio archives with "cat". Kernel's initramfs extractor doesn't need it.)
2017-05-28teach head -v and -qIlya Kuzmich
Not POSIX, but implemented in coreutils and busybox. Tests use sed to compensate for the stdin naming difference. Signed-off-by: Ilya Kuzmich <ilya.kuzmich@gmail.com>
2017-05-27Replace two space indents with tab indents in help text (for consistency).Rob Landley
2017-05-26Be more consistent about periods in help text.Elliott Hughes
2017-05-25Add -0 to env.Rob Landley
2017-05-25Teach env that - as first argument means -i for some reason. (Posix!)Rob Landley
2017-05-24Add and use xmmap.Elliott Hughes
Everyone forgets that mmap returns MAP_FAILED rather than NULL on failure. Every use of mmap in toybox was either doing the wrong check, or no check at all (including the two I personally added).
2017-05-19Implement date %N, loosely inspired by Elliott Hughes's patch.Rob Landley
I didn't implement %37N's ability to insert zeroes, so removed those two tests. If you really need it, I can add the divide loop back.
2017-05-08Move strend() to lib/lib.cRob Landley
2017-05-08Now that xopen() no longer returns stdio, !fd doesn't need strcmp("-") to verifyRob Landley
2017-04-19Add ls -ll (with --full-time as a compatibility synonym) to show nanoseconds.Rob Landley
(And, for some reason, timezone. Individual files have timezones?)
2017-04-12Default to -b rather than -q when output is to a tty.Rob Landley
2017-04-11Silence a broken warning by hitting it with a rock.Rob Landley
2017-04-11Fix touch -a/-m (and add the missing tests).Elliott Hughes
utimensat takes atime in [0] and mtime in [1], but since we're overwriting with UTIME_OMIT, we actually want to flip the comparison so -a blats 1 and -m blats 0.
2017-04-10Add "uudecode -o -" support.Elliott Hughes
busybox uudecode supports this, and POSIX explicitly mentions it (albeit only in the "STDOUT" section). Plus Android doesn't have /dev/stdout and /dev/stdin, so this lets us rewrite the uudecode tests so they pass on Android too.
2017-04-08Fix the ls -m test (which is just a whitespace issue, but eh).Rob Landley
While we're at it, ls -m wordwrap was one column early.
2017-04-03Trivial cleanup. (Whitespace, brackets, and remove unnecessary typecasts.)Rob Landley
2017-04-03Add gzip support. (Doesn't show source OS and timestamp, but reporting themRob Landley
isn't obviously useful.)
2017-03-28Don't try to implement %s, we have @seconds, strptime() in libc tendsRob Landley
not to have it, and implementing our own means a pattern like "Time %%%s%%" is expensive to handle the corner cases of.
2017-03-28Replace chkmktime() (which produces false positive normalization failures)Rob Landley
with range checks for seconds, minutes, hours, day of month, and month.
2017-03-28ps: don't query for terminal size if not a tty.Josh Gao
`ps -A | cat` shouldn't have different output depending on the size of your terminal window.
2017-03-21dirtree_flagread() returns DIRTREE_ABORTVAL when the initial node doesn'tRob Landley
exist, which can hit ps when /proc isn't there or /proc/$PID/task isn't there (because process exited between the time we checked its contents and the time we looked for its threads).
2017-03-20Paste bugfix, more tests.Rob Landley
2017-03-20Rewrite paste so it actually works.Rob Landley
2017-02-20If the last ps field is left justified, it extends to the width of the screen.Rob Landley
(Recent "show + for last char when truncated" change broke that, putting it back.)
2017-02-16Teach file(1) about bzip2 files.Elliott Hughes
If we can read and write bzip2 files, we should be able to identify them too...
2017-02-09Document df -aRob Landley