aboutsummaryrefslogtreecommitdiff
path: root/toys/posix
AgeCommit message (Collapse)Author
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
2017-02-06ps -l has 4 chars left for "cmd", switch "ADDR" to "BIT" to save space.Rob Landley
2017-02-06Make tty size failure to enable -w (Elliott prefers that), and fix last fieldRob Landley
to be left justified again.
2017-02-05Don't set SIGWINCH when reading ANSI size probe data, it causes a loop.Rob Landley
2017-02-05Bugfix: last field was padding to width with trailing spaces (oops), andRob Landley
when we can't query terminal size pad to 80 but add -w.
2017-02-05Default to width 80 when tty size probe fails (ala serial console).Rob Landley
(It was defaulting to 99999 but not FLAG_w, so it tried to _pad_ to 99999.)
2017-02-03Fix typo in pgrep help.Elliott Hughes
2017-02-03Fix operator precedence error in df.Elliott Hughes
2017-02-01Extend default USER length to 12 and output "+" as last character of truncatedRob Landley
(left-justified) fields.
2017-01-31ps bugfix: len of TTY field doesn't include null terminator, so memmove shouldRob Landley
subtract one _less_ than /dev prefix length or string isn't terminated.
2017-01-30Improve file's ELF parsing.Elliott Hughes
An ELF file with no program headers is valid, and binutils leaves e_phentsize zero in that case. Fix the corruption check to cope. Also, since notes are in both the program and section headers (and I'm not aware of the possibility of having no sections but still having notes --- where would they be?), look for them in the section headers instead. Also extend the parsing of the .android.note.ident ELF note to include the NDK version information if present. (This won't be present for platform binaries, but will be present for NDK-built binaries such as app libraries.)
2017-01-28Tweak -w help text to clarify that it prevents truncating _any_ fields, notRob Landley
just for terminal width.
2017-01-28Add missing `static`s and remove an unused function.Elliott Hughes
2017-01-28Whitespace.Rob Landley
2017-01-28top -H is more useful if it shows thread names.Elliott Hughes
I knew that just showing the process name was a divergence from traditional Android behavior, but I was curious to see whether anyone cared. Bug reports show that they do. I've not made this conditional on CFG_TOYBOX_ON_ANDROID on the assumption that this is more useful for everyone else too. (Why are you asking for per-thread information if you don't actually want to be able to identify individual threads?) Why not _just_ show the thread name? Because on Android at least, every process has lots of identically-named threads; everyone has GC threads, everyone has JIT threads, and so knowing _just_ the thread name is rarely useful. Why show thread name first? Because the kernel limits thread names to 15 bytes plus a NUL, so any left-over space should go to the process name, so that should come last. Why call the thread name THREAD? Because "CMD" isn't obviously "thread name" to folks who don't know how this is implemented behind the scenes. This change also removes an incorrect "usage:" comment. None of the other commands in this file duplicated their "usage:" lines, and this copy wasn't even close to being correct. Bug: http://b/34610082
2016-12-25Fix a bug for sort. When the key_separator is not space, the sort ↵wxj
commandline tool fails to sort by the 3rd,4th,etc column. For example: when you exec $ sort -t',' -k 3n on a file which cotains: 1,2,3,4 2,3,4,1 4,1,2,3 3,4,1,2 you got: 4,1,2,3 1,2,3,4 2,3,4,1 3,4,1,2 but the expected output should be: 3,4,1,2 4,1,2,3 1,2,3,4 2,3,4,1 The bug is due to the dependency of "isspace(str[end])" at line 113. When searching for the non-space key_separator, the search stopped just at the position of first key_separator it met. The bug can be easily fixed by adding "end++" when the search have found one separator and exit the for loop.
2016-12-20Add units for -atime and friends. (Also legacy -amin alias, but not in help textRob Landley
because there's no -asec or -ahour.)