aboutsummaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2020-01-06 22:48:56 -0800
committerElliott Hughes <enh@google.com>2020-01-06 22:49:24 -0800
commitfd4f25992ce6ac5e7b3f2c3ff672bd7a16ad0bae (patch)
treec26141dc37ade2d564fa98e4f0c9b27f4f19fa7e /android
parenta5c015bd1102787e012f00caac1c8a02ee81cb01 (diff)
parente00ab7de3c5f929adee379da555fb6c678770f28 (diff)
downloadtoybox-fd4f25992ce6ac5e7b3f2c3ff672bd7a16ad0bae.tar.gz
Merge remote-tracking branch 'toybox/master' into HEAD
Change-Id: I723662de7cece8fab039c1ff5e9dea9302357f1c
Diffstat (limited to 'android')
-rw-r--r--android/device/generated/flags.h54
-rw-r--r--android/device/generated/globals.h27
-rw-r--r--android/device/generated/help.h12
-rw-r--r--android/device/generated/newtoys.h22
-rw-r--r--android/linux/generated/flags.h54
-rw-r--r--android/linux/generated/globals.h27
-rw-r--r--android/linux/generated/help.h14
-rw-r--r--android/linux/generated/newtoys.h22
-rw-r--r--android/mac/generated/flags.h54
-rw-r--r--android/mac/generated/globals.h27
-rw-r--r--android/mac/generated/help.h14
-rw-r--r--android/mac/generated/newtoys.h22
12 files changed, 186 insertions, 163 deletions
diff --git a/android/device/generated/flags.h b/android/device/generated/flags.h
index 1583ade2..04609c35 100644
--- a/android/device/generated/flags.h
+++ b/android/device/generated/flags.h
@@ -207,12 +207,14 @@
#undef FLAG_v
#endif
-// cd
+// cd >1LP[-LP]
#undef OPTSTR_cd
-#define OPTSTR_cd 0
+#define OPTSTR_cd ">1LP[-LP]"
#ifdef CLEANUP_cd
#undef CLEANUP_cd
#undef FOR_cd
+#undef FLAG_P
+#undef FLAG_L
#endif
// chattr
@@ -1178,12 +1180,13 @@
#undef FOR_hello
#endif
-// help ah ah
+// help ahu ahu
#undef OPTSTR_help
-#define OPTSTR_help "ah"
+#define OPTSTR_help "ahu"
#ifdef CLEANUP_help
#undef CLEANUP_help
#undef FOR_help
+#undef FLAG_u
#undef FLAG_h
#undef FLAG_a
#endif
@@ -2104,9 +2107,9 @@
#undef FLAG_d
#endif
-// patch (no-backup-if-mismatch)(dry-run)g#fulp#d:i:Rs(quiet) (no-backup-if-mismatch)(dry-run)xg#fulp#d:i:Rs(quiet)
+// patch >2(no-backup-if-mismatch)(dry-run)F#g#fulp#d:i:Rs(quiet) >2(no-backup-if-mismatch)(dry-run)xF#g#fulp#d:i:Rs(quiet)
#undef OPTSTR_patch
-#define OPTSTR_patch "(no-backup-if-mismatch)(dry-run)g#fulp#d:i:Rs(quiet)"
+#define OPTSTR_patch ">2(no-backup-if-mismatch)(dry-run)F#g#fulp#d:i:Rs(quiet)"
#ifdef CLEANUP_patch
#undef CLEANUP_patch
#undef FOR_patch
@@ -2119,6 +2122,7 @@
#undef FLAG_u
#undef FLAG_f
#undef FLAG_g
+#undef FLAG_F
#undef FLAG_x
#undef FLAG_dry_run
#undef FLAG_no_backup_if_mismatch
@@ -2482,23 +2486,29 @@
#undef FLAG_h
#endif
-// setsid ^<1t ^<1t
+// setsid ^<1wcd[!dc] ^<1wcd[!dc]
#undef OPTSTR_setsid
-#define OPTSTR_setsid "^<1t"
+#define OPTSTR_setsid "^<1wcd[!dc]"
#ifdef CLEANUP_setsid
#undef CLEANUP_setsid
#undef FOR_setsid
-#undef FLAG_t
+#undef FLAG_d
+#undef FLAG_c
+#undef FLAG_w
#endif
-// sh c:i
+// sh (noediting)(noprofile)(norc)sc:i
#undef OPTSTR_sh
-#define OPTSTR_sh "c:i"
+#define OPTSTR_sh "(noediting)(noprofile)(norc)sc:i"
#ifdef CLEANUP_sh
#undef CLEANUP_sh
#undef FOR_sh
#undef FLAG_i
#undef FLAG_c
+#undef FLAG_s
+#undef FLAG_norc
+#undef FLAG_noprofile
+#undef FLAG_noediting
#endif
// sha1sum bc(check)s(status)[!bc] bc(check)s(status)[!bc]
@@ -3556,6 +3566,8 @@
#ifndef TT
#define TT this.cd
#endif
+#define FLAG_P (FORCED_FLAG<<0)
+#define FLAG_L (FORCED_FLAG<<1)
#endif
#ifdef FOR_chattr
@@ -4381,8 +4393,9 @@
#ifndef TT
#define TT this.help
#endif
-#define FLAG_h (1<<0)
-#define FLAG_a (1<<1)
+#define FLAG_u (1<<0)
+#define FLAG_h (1<<1)
+#define FLAG_a (1<<2)
#endif
#ifdef FOR_hexedit
@@ -5162,9 +5175,10 @@
#define FLAG_u (1<<6)
#define FLAG_f (1<<7)
#define FLAG_g (1<<8)
-#define FLAG_x (FORCED_FLAG<<9)
-#define FLAG_dry_run (1<<10)
-#define FLAG_no_backup_if_mismatch (1<<11)
+#define FLAG_F (1<<9)
+#define FLAG_x (FORCED_FLAG<<10)
+#define FLAG_dry_run (1<<11)
+#define FLAG_no_backup_if_mismatch (1<<12)
#endif
#ifdef FOR_pgrep
@@ -5469,7 +5483,9 @@
#ifndef TT
#define TT this.setsid
#endif
-#define FLAG_t (1<<0)
+#define FLAG_d (1<<0)
+#define FLAG_c (1<<1)
+#define FLAG_w (1<<2)
#endif
#ifdef FOR_sh
@@ -5478,6 +5494,10 @@
#endif
#define FLAG_i (FORCED_FLAG<<0)
#define FLAG_c (FORCED_FLAG<<1)
+#define FLAG_s (FORCED_FLAG<<2)
+#define FLAG_norc (FORCED_FLAG<<3)
+#define FLAG_noprofile (FORCED_FLAG<<4)
+#define FLAG_noediting (FORCED_FLAG<<5)
#endif
#ifdef FOR_sha1sum
diff --git a/android/device/generated/globals.h b/android/device/generated/globals.h
index c0cea266..726703ec 100644
--- a/android/device/generated/globals.h
+++ b/android/device/generated/globals.h
@@ -284,9 +284,7 @@ struct hwclock_data {
// toys/other/ionice.c
struct ionice_data {
- long pid;
- long level;
- long class;
+ long p, n, c;
};
// toys/other/login.c
@@ -793,11 +791,10 @@ struct sh_data {
char *command;
long lineno;
-
char **locals;
-
struct double_list functions;
- unsigned options;
+ unsigned options, jobcnt;
+ int hfd; // next high filehandle (>= 10)
// Running jobs.
struct sh_job {
@@ -812,19 +809,12 @@ struct sh_data {
// null terminated array of running processes in pipeline
struct sh_process {
- struct string_list *delete; // expanded strings
- struct sh_redirects {
- struct sh_redirects *next, *prev;
- int count, rd[];
- // rdlist = NULL if process didn't redirect, urd undoes <&- for builtins
- // rdlist is ** because this is our view into inherited context
- } **rdlist, *urd;
- int pid, exit;
+ struct sh_process *next, *prev;
+ struct arg_list *delete; // expanded strings
+ int *urd, envlen, pid, exit; // undo redirects, child PID, exit status
struct sh_arg arg;
} *procs, *proc;
} *jobs, *job;
- struct sh_process *callback_pp;
- unsigned jobcnt;
};
// toys/pending/stty.c
@@ -1254,7 +1244,7 @@ struct paste_data {
struct patch_data {
char *i, *d;
- long p, g;
+ long p, g, F;
struct double_list *current_hunk;
long oldline, oldlen, newline, newlen;
@@ -1328,8 +1318,7 @@ struct sort_data {
void *key_list;
int linecount;
- char **lines;
- char *name;
+ char **lines, *name;
};
// toys/posix/split.c
diff --git a/android/device/generated/help.h b/android/device/generated/help.h
index 435ceeb8..95eb822b 100644
--- a/android/device/generated/help.h
+++ b/android/device/generated/help.h
@@ -176,7 +176,7 @@
#define HELP_shred "usage: shred [-fuz] [-n COUNT] [-s SIZE] FILE...\n\nSecurely delete a file by overwriting its contents with random data.\n\n-f Force (chmod if necessary)\n-n COUNT Random overwrite iterations (default 1)\n-o OFFSET Start at OFFSET\n-s SIZE Use SIZE instead of detecting file size\n-u Unlink (actually delete file when done)\n-x Use exact size (default without -s rounds up to next 4k)\n-z Zero at end\n\nNote: data journaling filesystems render this command useless, you must\noverwrite all free space (fill up disk) to erase old data on those."
-#define HELP_setsid "usage: setsid [-t] command [args...]\n\nRun process in a new session.\n\n-t Grab tty (become foreground process, receiving keyboard signals)"
+#define HELP_setsid "usage: setsid [-cdw] command [args...]\n\nRun process in a new session.\n\n-d Detach from tty\n-c Control tty (become foreground process & receive keyboard signals)"
#define HELP_setfattr "usage: setfattr [-h] [-x|-n NAME] [-v VALUE] FILE...\n\nWrite POSIX extended attributes.\n\n-h Do not dereference symlink\n-n Set given attribute\n-x Remove given attribute\n-v Set value for attribute -n (default is empty)"
@@ -262,7 +262,7 @@
#define HELP_hexedit "usage: hexedit FILENAME\n\nHexadecimal file editor. All changes are written to disk immediately.\n\n-r Read only (display but don't edit)\n\nKeys:\nArrows Move left/right/up/down by one line/column\nPg Up/Pg Dn Move up/down by one page\n0-9, a-f Change current half-byte to hexadecimal value\nu Undo\nq/^c/^d/<esc> Quit"
-#define HELP_help "usage: help [-ah] [command]\n\nShow usage information for toybox commands.\nRun \"toybox\" with no arguments for a list of available commands.\n\n-h HTML output\n-a All commands"
+#define HELP_help "usage: help [-ahu] [COMMAND]\n\n-a All commands\n-u Usage only\n-h HTML output\n\nShow usage information for toybox commands.\nRun \"toybox\" with no arguments for a list of available commands."
#define HELP_fsync "usage: fsync [-d] [FILE...]\n\nSynchronize a file's in-core state with storage device.\n\n-d Avoid syncing metadata"
@@ -460,7 +460,7 @@
#define HELP_tty "usage: tty [-s]\n\nShow filename of terminal connected to stdin.\n\nPrints \"not a tty\" and exits with nonzero status if no terminal\nis connected to stdin.\n\n-s Silent, exit code only"
-#define HELP_true "Return zero."
+#define HELP_true "usage: true\n\nReturn zero."
#define HELP_touch "usage: touch [-amch] [-d DATE] [-t TIME] [-r FILE] FILE...\n\nUpdate the access and modification times of each FILE to the current time.\n\n-a Change access time\n-m Change modification time\n-c Don't create file\n-h Change symlink\n-d Set time to DATE (in YYYY-MM-DDThh:mm:SS[.frac][tz] format)\n-t Set time to TIME (in [[CC]YY]MMDDhhmm[.ss][frac] format)\n-r Set time same as reference FILE"
@@ -504,7 +504,7 @@
#define HELP_printf "usage: printf FORMAT [ARGUMENT...]\n\nFormat and print ARGUMENT(s) according to FORMAT, using C printf syntax\n(% escapes for cdeEfgGiosuxX, \\ escapes for abefnrtv0 or \\OCTAL or \\xHEX)."
-#define HELP_patch "usage: patch [-d DIR] [-i file] [-p depth] [-Rlsu] [--dry-run]\n\nApply a unified diff to one or more files.\n\n-d Modify files in DIR\n-i Input file (default=stdin)\n-l Loose match (ignore whitespace)\n-p Number of '/' to strip from start of file paths (default=all)\n-R Reverse patch\n-s Silent except for errors\n-u Ignored (only handles \"unified\" diffs)\n--dry-run Don't change files, just confirm patch applies\n\nThis version of patch only handles unified diffs, and only modifies\na file when all hunks to that file apply. Patch prints failed hunks\nto stderr, and exits with nonzero status if any hunks fail.\n\nA file compared against /dev/null (or with a date <= the epoch) is\ncreated/deleted as appropriate."
+#define HELP_patch "usage: patch [-d DIR] [-i PATCH] [-p depth] [-F FUZZ] [-Rlsu] [--dry-run] [FILE [PATCH]]\n\nApply a unified diff to one or more files.\n\n-d Modify files in DIR\n-i Input patch file (default=stdin)\n-l Loose match (ignore whitespace)\n-p Number of '/' to strip from start of file paths (default=all)\n-R Reverse patch\n-s Silent except for errors\n-u Ignored (only handles \"unified\" diffs)\n--dry-run Don't change files, just confirm patch applies\n\nThis version of patch only handles unified diffs, and only modifies\na file when all hunks to that file apply. Patch prints failed hunks\nto stderr, and exits with nonzero status if any hunks fail.\n\nA file compared against /dev/null (or with a date <= the epoch) is\ncreated/deleted as appropriate."
#define HELP_paste "usage: paste [-s] [-d DELIMITERS] [FILE...]\n\nMerge corresponding lines from each input file.\n\n-d List of delimiter characters to separate fields with (default is \\t)\n-s Sequential mode: turn each input file into one line of output"
@@ -554,7 +554,7 @@
#define HELP_file "usage: file [-bhLs] [file...]\n\nExamine the given files and describe their content types.\n\n-b Brief (no filename)\n-h Don't follow symlinks (default)\n-L Follow symlinks\n-s Show block/char device contents"
-#define HELP_false "Return nonzero."
+#define HELP_false "usage: false\n\nReturn nonzero."
#define HELP_expand "usage: expand [-t TABLIST] [FILE...]\n\nExpand tabs to spaces according to tabstops.\n\n-t TABLIST\n\nSpecify tab stops, either a single number instead of the default 8,\nor a comma separated list of increasing numbers representing tabstop\npositions (absolute, not increments) with each additional tab beyond\nthat becoming one space."
@@ -568,7 +568,7 @@
#define HELP_df "usage: df [-HPkhi] [-t type] [FILESYSTEM ...]\n\nThe \"disk free\" command shows total/used/available disk space for\neach filesystem listed on the command line, or all currently mounted\nfilesystems.\n\n-a Show all (including /proc and friends)\n-P The SUSv3 \"Pedantic\" option\n-k Sets units back to 1024 bytes (the default without -P)\n-h Human readable (K=1024)\n-H Human readable (k=1000)\n-i Show inodes instead of blocks\n-t type Display only filesystems of this type\n\nPedantic provides a slightly less useful output format dictated by Posix,\nand sets the units to 512 bytes instead of the default 1024 bytes."
-#define HELP_date "usage: date [-u] [-r FILE] [-d DATE] [+DISPLAY_FORMAT] [-D SET_FORMAT] [SET]\n\nSet/get the current date/time. With no SET shows the current date.\n\n-d Show DATE instead of current time (convert date format)\n-D +FORMAT for SET or -d (instead of MMDDhhmm[[CC]YY][.ss])\n-r Use modification time of FILE instead of current date\n-u Use UTC instead of current timezone\n\nSupported input formats:\n\nMMDDhhmm[[CC]YY][.ss] POSIX\n@UNIXTIME[.FRACTION] seconds since midnight 1970-01-01\nYYYY-MM-DD [hh:mm[:ss]] ISO 8601\nhh:mm[:ss] 24-hour time today\n\nAll input formats can be preceded by TZ=\"id\" to set the input time zone\nseparately from the output time zone. Otherwise $TZ sets both.\n\n+FORMAT specifies display format string using strftime(3) syntax:\n\n%% literal % %n newline %t tab\n%S seconds (00-60) %M minute (00-59) %m month (01-12)\n%H hour (0-23) %I hour (01-12) %p AM/PM\n%y short year (00-99) %Y year %C century\n%a short weekday name %A weekday name %u day of week (1-7, 1=mon)\n%b short month name %B month name %Z timezone name\n%j day of year (001-366) %d day of month (01-31) %e day of month ( 1-31)\n%N nanosec (output only)\n\n%U Week of year (0-53 start sunday) %W Week of year (0-53 start monday)\n%V Week of year (1-53 start monday, week < 4 days not part of this year)\n\n%D = \"%m/%d/%y\" %r = \"%I : %M : %S %p\" %T = \"%H:%M:%S\" %h = \"%b\"\n%x locale date %X locale time %c locale date/time"
+#define HELP_date "usage: date [-u] [-r FILE] [-d DATE] [+DISPLAY_FORMAT] [-D SET_FORMAT] [SET]\n\nSet/get the current date/time. With no SET shows the current date.\n\n-d Show DATE instead of current time (convert date format)\n-D +FORMAT for SET or -d (instead of MMDDhhmm[[CC]YY][.ss])\n-r Use modification time of FILE instead of current date\n-u Use UTC instead of current timezone\n\nSupported input formats:\n\nMMDDhhmm[[CC]YY][.ss] POSIX\n@UNIXTIME[.FRACTION] seconds since midnight 1970-01-01\nYYYY-MM-DD [hh:mm[:ss]] ISO 8601\nhh:mm[:ss] 24-hour time today\n\nAll input formats can be preceded by TZ=\"id\" to set the input time zone\nseparately from the output time zone. Otherwise $TZ sets both.\n\n+FORMAT specifies display format string using strftime(3) syntax:\n\n%% literal % %n newline %t tab\n%S seconds (00-60) %M minute (00-59) %m month (01-12)\n%H hour (0-23) %I hour (01-12) %p AM/PM\n%y short year (00-99) %Y year %C century\n%a short weekday name %A weekday name %u day of week (1-7, 1=mon)\n%b short month name %B month name %Z timezone name\n%j day of year (001-366) %d day of month (01-31) %e day of month ( 1-31)\n%N nanosec (output only)\n\n%U Week of year (0-53 start sunday) %W Week of year (0-53 start monday)\n%V Week of year (1-53 start monday, week < 4 days not part of this year)\n\n%F \"%Y-%m-%d\" %R \"%H:%M\" %T \"%H:%M:%S\" %z numeric timezone\n%D \"%m/%d/%y\" %r \"%I:%M:%S %p\" %h \"%b\" %s unix epoch time\n%x locale date %X locale time %c locale date/time"
#define HELP_cut "usage: cut [-Ds] [-bcfF LIST] [-dO DELIM] [FILE...]\n\nPrint selected parts of lines from each FILE to standard output.\n\nEach selection LIST is comma separated, either numbers (counting from 1)\nor dash separated ranges (inclusive, with X- meaning to end of line and -X\nfrom start). By default selection ranges are sorted and collated, use -D\nto prevent that.\n\n-b Select bytes\n-c Select UTF-8 characters\n-C Select unicode columns\n-d Use DELIM (default is TAB for -f, run of whitespace for -F)\n-D Don't sort/collate selections or match -fF lines without delimiter\n-f Select fields (words) separated by single DELIM character\n-F Select fields separated by DELIM regex\n-O Output delimiter (default one space for -F, input delim for -f)\n-s Skip lines without delimiters"
diff --git a/android/device/generated/newtoys.h b/android/device/generated/newtoys.h
index 7b39d64e..2801ae27 100644
--- a/android/device/generated/newtoys.h
+++ b/android/device/generated/newtoys.h
@@ -2,7 +2,7 @@ USE_TOYBOX(NEWTOY(toybox, NULL, TOYFLAG_STAYROOT))
USE_SH(OLDTOY(-bash, sh, 0))
USE_SH(OLDTOY(-sh, sh, 0))
USE_SH(OLDTOY(-toysh, sh, 0))
-USE_TRUE(OLDTOY(:, true, TOYFLAG_NOFORK|TOYFLAG_NOHELP))
+USE_TRUE(OLDTOY(:, true, TOYFLAG_NOFORK|TOYFLAG_NOHELP|TOYFLAG_MAYFORK))
USE_TEST(OLDTOY([, test, TOYFLAG_NOFORK|TOYFLAG_NOHELP))
USE_ACPI(NEWTOY(acpi, "abctV", TOYFLAG_USR|TOYFLAG_BIN))
USE_GROUPADD(OLDTOY(addgroup, groupadd, TOYFLAG_NEEDROOT|TOYFLAG_SBIN))
@@ -24,7 +24,7 @@ USE_BZCAT(NEWTOY(bzcat, NULL, TOYFLAG_USR|TOYFLAG_BIN))
USE_CAL(NEWTOY(cal, ">2", TOYFLAG_USR|TOYFLAG_BIN))
USE_CAT(NEWTOY(cat, "u"USE_CAT_V("vte"), TOYFLAG_BIN))
USE_CATV(NEWTOY(catv, USE_CATV("vte"), TOYFLAG_USR|TOYFLAG_BIN))
-USE_SH(NEWTOY(cd, NULL, TOYFLAG_NOFORK))
+USE_SH(NEWTOY(cd, ">1LP[-LP]", TOYFLAG_NOFORK))
USE_CHATTR(NEWTOY(chattr, NULL, TOYFLAG_BIN))
USE_CHCON(NEWTOY(chcon, "<2hvR", TOYFLAG_USR|TOYFLAG_BIN))
USE_CHGRP(NEWTOY(chgrp, "<2hPLHRfv[-HLP]", TOYFLAG_BIN))
@@ -74,7 +74,7 @@ USE_EXPAND(NEWTOY(expand, "t*", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LOCALE))
USE_EXPR(NEWTOY(expr, NULL, TOYFLAG_USR|TOYFLAG_BIN))
USE_FACTOR(NEWTOY(factor, 0, TOYFLAG_USR|TOYFLAG_BIN))
USE_FALLOCATE(NEWTOY(fallocate, ">1l#|o#", TOYFLAG_USR|TOYFLAG_BIN))
-USE_FALSE(NEWTOY(false, NULL, TOYFLAG_BIN|TOYFLAG_NOHELP))
+USE_FALSE(NEWTOY(false, NULL, TOYFLAG_BIN|TOYFLAG_NOHELP|TOYFLAG_MAYFORK))
USE_FDISK(NEWTOY(fdisk, "C#<0H#<0S#<0b#<512ul", TOYFLAG_SBIN))
USE_FGREP(OLDTOY(fgrep, grep, TOYFLAG_BIN|TOYFLAG_ARGFAIL(2)))
USE_FILE(NEWTOY(file, "<1bhLs[!hL]", TOYFLAG_USR|TOYFLAG_BIN))
@@ -104,7 +104,7 @@ USE_GZIP(NEWTOY(gzip, "ncdfk123456789[-123456789]", TOYFLAG_USR|TOYFLAG_BIN))
USE_REBOOT(OLDTOY(halt, reboot, TOYFLAG_SBIN|TOYFLAG_NEEDROOT))
USE_HEAD(NEWTOY(head, "?n(lines)#<0=10c(bytes)#<0qv[-nc]", TOYFLAG_USR|TOYFLAG_BIN))
USE_HELLO(NEWTOY(hello, 0, TOYFLAG_USR|TOYFLAG_BIN))
-USE_HELP(NEWTOY(help, ""USE_HELP_EXTRAS("ah"), TOYFLAG_BIN))
+USE_HELP(NEWTOY(help, "ahu", TOYFLAG_BIN|TOYFLAG_MAYFORK))
USE_HEXEDIT(NEWTOY(hexedit, "<1>1r", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LOCALE))
USE_HOST(NEWTOY(host, "<1>2avt:", TOYFLAG_USR|TOYFLAG_BIN))
USE_HOSTID(NEWTOY(hostid, ">0", TOYFLAG_USR|TOYFLAG_BIN))
@@ -132,7 +132,7 @@ USE_IP(OLDTOY(iplink, ip, TOYFLAG_SBIN))
USE_IP(OLDTOY(iproute, ip, TOYFLAG_SBIN))
USE_IP(OLDTOY(iprule, ip, TOYFLAG_SBIN))
USE_IP(OLDTOY(iptunnel, ip, TOYFLAG_SBIN))
-USE_KILL(NEWTOY(kill, "?ls: ", TOYFLAG_BIN))
+USE_KILL(NEWTOY(kill, "?ls: ", TOYFLAG_BIN|TOYFLAG_MAYFORK))
USE_KILLALL(NEWTOY(killall, "?s:ilqvw", TOYFLAG_USR|TOYFLAG_BIN))
USE_KILLALL5(NEWTOY(killall5, "?o*ls: [!lo][!ls]", TOYFLAG_SBIN))
USE_KLOGD(NEWTOY(klogd, "c#<1>8n", TOYFLAG_SBIN))
@@ -188,7 +188,7 @@ USE_OPENVT(NEWTOY(openvt, "c#<1>63sw", TOYFLAG_BIN|TOYFLAG_NEEDROOT))
USE_PARTPROBE(NEWTOY(partprobe, "<1", TOYFLAG_SBIN))
USE_PASSWD(NEWTOY(passwd, ">1a:dlu", TOYFLAG_STAYROOT|TOYFLAG_USR|TOYFLAG_BIN))
USE_PASTE(NEWTOY(paste, "d:s", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LOCALE))
-USE_PATCH(NEWTOY(patch, "(no-backup-if-mismatch)(dry-run)"USE_TOYBOX_DEBUG("x")"g#fulp#d:i:Rs(quiet)", TOYFLAG_USR|TOYFLAG_BIN))
+USE_PATCH(NEWTOY(patch, ">2(no-backup-if-mismatch)(dry-run)"USE_TOYBOX_DEBUG("x")"F#g#fulp#d:i:Rs(quiet)", TOYFLAG_USR|TOYFLAG_BIN))
USE_PGREP(NEWTOY(pgrep, "?cld:u*U*t*s*P*g*G*fnovxL:[-no]", TOYFLAG_USR|TOYFLAG_BIN))
USE_PIDOF(NEWTOY(pidof, "<1so:x", TOYFLAG_BIN))
USE_PING(NEWTOY(ping, "<1>1m#t#<0>255=64c#<0=3s#<0>4088=56i%W#<0=3w#<0qf46I:[-46]", TOYFLAG_USR|TOYFLAG_BIN))
@@ -201,7 +201,7 @@ USE_PRINTENV(NEWTOY(printenv, "0(null)", TOYFLAG_BIN))
USE_PRINTF(NEWTOY(printf, "<1?^", TOYFLAG_USR|TOYFLAG_BIN))
USE_ULIMIT(OLDTOY(prlimit, ulimit, TOYFLAG_USR|TOYFLAG_BIN))
USE_PS(NEWTOY(ps, "k(sort)*P(ppid)*aAdeflMno*O*p(pid)*s*t*Tu*U*g*G*wZ[!ol][+Ae][!oO]", TOYFLAG_BIN|TOYFLAG_LOCALE))
-USE_PWD(NEWTOY(pwd, ">0LP[-LP]", TOYFLAG_BIN))
+USE_PWD(NEWTOY(pwd, ">0LP[-LP]", TOYFLAG_BIN|TOYFLAG_MAYFORK))
USE_PWDX(NEWTOY(pwdx, "<1a", TOYFLAG_USR|TOYFLAG_BIN))
USE_READAHEAD(NEWTOY(readahead, NULL, TOYFLAG_BIN))
USE_READLINK(NEWTOY(readlink, "<1nqmef(canonicalize)[-mef]", TOYFLAG_USR|TOYFLAG_BIN))
@@ -222,8 +222,8 @@ USE_SENDEVENT(NEWTOY(sendevent, "<4>4", TOYFLAG_USR|TOYFLAG_SBIN))
USE_SEQ(NEWTOY(seq, "<1>3?f:s:w[!fw]", TOYFLAG_USR|TOYFLAG_BIN))
USE_SETENFORCE(NEWTOY(setenforce, "<1>1", TOYFLAG_USR|TOYFLAG_SBIN))
USE_SETFATTR(NEWTOY(setfattr, "hn:|v:x:|[!xv]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_SETSID(NEWTOY(setsid, "^<1t", TOYFLAG_USR|TOYFLAG_BIN))
-USE_SH(NEWTOY(sh, "c:i", TOYFLAG_BIN))
+USE_SETSID(NEWTOY(setsid, "^<1wcd[!dc]", TOYFLAG_USR|TOYFLAG_BIN))
+USE_SH(NEWTOY(sh, "(noediting)(noprofile)(norc)sc:i", TOYFLAG_BIN))
USE_SHA1SUM(NEWTOY(sha1sum, "bc(check)s(status)[!bc]", TOYFLAG_USR|TOYFLAG_BIN))
USE_TOYBOX_LIBCRYPTO(USE_SHA224SUM(OLDTOY(sha224sum, sha1sum, TOYFLAG_USR|TOYFLAG_BIN)))
USE_TOYBOX_LIBCRYPTO(USE_SHA256SUM(OLDTOY(sha256sum, sha1sum, TOYFLAG_USR|TOYFLAG_BIN)))
@@ -258,7 +258,7 @@ USE_TELNETD(NEWTOY(telnetd, "w#<0b:p#<0>65535=23f:l:FSKi[!wi]", TOYFLAG_USR|TOYF
USE_TEST(NEWTOY(test, 0, TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_NOHELP|TOYFLAG_MAYFORK))
USE_TFTP(NEWTOY(tftp, "<1b#<8>65464r:l:g|p|[!gp]", TOYFLAG_USR|TOYFLAG_BIN))
USE_TFTPD(NEWTOY(tftpd, "rcu:l", TOYFLAG_BIN))
-USE_TIME(NEWTOY(time, "<1^pv", TOYFLAG_USR|TOYFLAG_BIN))
+USE_TIME(NEWTOY(time, "<1^pv", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_MAYFORK))
USE_TIMEOUT(NEWTOY(timeout, "<2^(foreground)(preserve-status)vk:s(signal):", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_ARGFAIL(125)))
USE_TOP(NEWTOY(top, ">0O*" "Hk*o*p*u*s#<1d%<100=3000m#n#<1bq[!oO]", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LOCALE))
USE_TOUCH(NEWTOY(touch, "<1acd:fmr:t:h[!dtr]", TOYFLAG_BIN))
@@ -266,7 +266,7 @@ USE_SH(OLDTOY(toysh, sh, TOYFLAG_BIN))
USE_TR(NEWTOY(tr, "^>2<1Ccsd[+cC]", TOYFLAG_USR|TOYFLAG_BIN))
USE_TRACEROUTE(NEWTOY(traceroute, "<1>2i:f#<1>255=1z#<0>86400=0g*w#<0>86400=5t#<0>255=0s:q#<1>255=3p#<1>65535=33434m#<1>255=30rvndlIUF64", TOYFLAG_STAYROOT|TOYFLAG_USR|TOYFLAG_BIN))
USE_TRACEROUTE(OLDTOY(traceroute6,traceroute, TOYFLAG_STAYROOT|TOYFLAG_USR|TOYFLAG_BIN))
-USE_TRUE(NEWTOY(true, NULL, TOYFLAG_BIN|TOYFLAG_NOHELP))
+USE_TRUE(NEWTOY(true, NULL, TOYFLAG_BIN|TOYFLAG_NOHELP|TOYFLAG_MAYFORK))
USE_TRUNCATE(NEWTOY(truncate, "<1s:|c", TOYFLAG_USR|TOYFLAG_BIN))
USE_TTY(NEWTOY(tty, "s", TOYFLAG_USR|TOYFLAG_BIN))
USE_TUNCTL(NEWTOY(tunctl, "<1>1t|d|u:T[!td]", TOYFLAG_USR|TOYFLAG_BIN))
diff --git a/android/linux/generated/flags.h b/android/linux/generated/flags.h
index 5062406a..c3d46d9f 100644
--- a/android/linux/generated/flags.h
+++ b/android/linux/generated/flags.h
@@ -207,12 +207,14 @@
#undef FLAG_v
#endif
-// cd
+// cd >1LP[-LP]
#undef OPTSTR_cd
-#define OPTSTR_cd 0
+#define OPTSTR_cd ">1LP[-LP]"
#ifdef CLEANUP_cd
#undef CLEANUP_cd
#undef FOR_cd
+#undef FLAG_P
+#undef FLAG_L
#endif
// chattr
@@ -1178,12 +1180,13 @@
#undef FOR_hello
#endif
-// help ah
+// help ahu
#undef OPTSTR_help
-#define OPTSTR_help "ah"
+#define OPTSTR_help "ahu"
#ifdef CLEANUP_help
#undef CLEANUP_help
#undef FOR_help
+#undef FLAG_u
#undef FLAG_h
#undef FLAG_a
#endif
@@ -2104,9 +2107,9 @@
#undef FLAG_d
#endif
-// patch (no-backup-if-mismatch)(dry-run)g#fulp#d:i:Rs(quiet) (no-backup-if-mismatch)(dry-run)xg#fulp#d:i:Rs(quiet)
+// patch >2(no-backup-if-mismatch)(dry-run)F#g#fulp#d:i:Rs(quiet) >2(no-backup-if-mismatch)(dry-run)xF#g#fulp#d:i:Rs(quiet)
#undef OPTSTR_patch
-#define OPTSTR_patch "(no-backup-if-mismatch)(dry-run)g#fulp#d:i:Rs(quiet)"
+#define OPTSTR_patch ">2(no-backup-if-mismatch)(dry-run)F#g#fulp#d:i:Rs(quiet)"
#ifdef CLEANUP_patch
#undef CLEANUP_patch
#undef FOR_patch
@@ -2119,6 +2122,7 @@
#undef FLAG_u
#undef FLAG_f
#undef FLAG_g
+#undef FLAG_F
#undef FLAG_x
#undef FLAG_dry_run
#undef FLAG_no_backup_if_mismatch
@@ -2482,23 +2486,29 @@
#undef FLAG_h
#endif
-// setsid ^<1t ^<1t
+// setsid ^<1wcd[!dc] ^<1wcd[!dc]
#undef OPTSTR_setsid
-#define OPTSTR_setsid "^<1t"
+#define OPTSTR_setsid "^<1wcd[!dc]"
#ifdef CLEANUP_setsid
#undef CLEANUP_setsid
#undef FOR_setsid
-#undef FLAG_t
+#undef FLAG_d
+#undef FLAG_c
+#undef FLAG_w
#endif
-// sh c:i
+// sh (noediting)(noprofile)(norc)sc:i
#undef OPTSTR_sh
-#define OPTSTR_sh "c:i"
+#define OPTSTR_sh "(noediting)(noprofile)(norc)sc:i"
#ifdef CLEANUP_sh
#undef CLEANUP_sh
#undef FOR_sh
#undef FLAG_i
#undef FLAG_c
+#undef FLAG_s
+#undef FLAG_norc
+#undef FLAG_noprofile
+#undef FLAG_noediting
#endif
// sha1sum bc(check)s(status)[!bc] bc(check)s(status)[!bc]
@@ -3556,6 +3566,8 @@
#ifndef TT
#define TT this.cd
#endif
+#define FLAG_P (FORCED_FLAG<<0)
+#define FLAG_L (FORCED_FLAG<<1)
#endif
#ifdef FOR_chattr
@@ -4381,8 +4393,9 @@
#ifndef TT
#define TT this.help
#endif
-#define FLAG_h (FORCED_FLAG<<0)
-#define FLAG_a (FORCED_FLAG<<1)
+#define FLAG_u (FORCED_FLAG<<0)
+#define FLAG_h (FORCED_FLAG<<1)
+#define FLAG_a (FORCED_FLAG<<2)
#endif
#ifdef FOR_hexedit
@@ -5162,9 +5175,10 @@
#define FLAG_u (1<<6)
#define FLAG_f (1<<7)
#define FLAG_g (1<<8)
-#define FLAG_x (FORCED_FLAG<<9)
-#define FLAG_dry_run (1<<10)
-#define FLAG_no_backup_if_mismatch (1<<11)
+#define FLAG_F (1<<9)
+#define FLAG_x (FORCED_FLAG<<10)
+#define FLAG_dry_run (1<<11)
+#define FLAG_no_backup_if_mismatch (1<<12)
#endif
#ifdef FOR_pgrep
@@ -5469,7 +5483,9 @@
#ifndef TT
#define TT this.setsid
#endif
-#define FLAG_t (1<<0)
+#define FLAG_d (1<<0)
+#define FLAG_c (1<<1)
+#define FLAG_w (1<<2)
#endif
#ifdef FOR_sh
@@ -5478,6 +5494,10 @@
#endif
#define FLAG_i (FORCED_FLAG<<0)
#define FLAG_c (FORCED_FLAG<<1)
+#define FLAG_s (FORCED_FLAG<<2)
+#define FLAG_norc (FORCED_FLAG<<3)
+#define FLAG_noprofile (FORCED_FLAG<<4)
+#define FLAG_noediting (FORCED_FLAG<<5)
#endif
#ifdef FOR_sha1sum
diff --git a/android/linux/generated/globals.h b/android/linux/generated/globals.h
index c0cea266..726703ec 100644
--- a/android/linux/generated/globals.h
+++ b/android/linux/generated/globals.h
@@ -284,9 +284,7 @@ struct hwclock_data {
// toys/other/ionice.c
struct ionice_data {
- long pid;
- long level;
- long class;
+ long p, n, c;
};
// toys/other/login.c
@@ -793,11 +791,10 @@ struct sh_data {
char *command;
long lineno;
-
char **locals;
-
struct double_list functions;
- unsigned options;
+ unsigned options, jobcnt;
+ int hfd; // next high filehandle (>= 10)
// Running jobs.
struct sh_job {
@@ -812,19 +809,12 @@ struct sh_data {
// null terminated array of running processes in pipeline
struct sh_process {
- struct string_list *delete; // expanded strings
- struct sh_redirects {
- struct sh_redirects *next, *prev;
- int count, rd[];
- // rdlist = NULL if process didn't redirect, urd undoes <&- for builtins
- // rdlist is ** because this is our view into inherited context
- } **rdlist, *urd;
- int pid, exit;
+ struct sh_process *next, *prev;
+ struct arg_list *delete; // expanded strings
+ int *urd, envlen, pid, exit; // undo redirects, child PID, exit status
struct sh_arg arg;
} *procs, *proc;
} *jobs, *job;
- struct sh_process *callback_pp;
- unsigned jobcnt;
};
// toys/pending/stty.c
@@ -1254,7 +1244,7 @@ struct paste_data {
struct patch_data {
char *i, *d;
- long p, g;
+ long p, g, F;
struct double_list *current_hunk;
long oldline, oldlen, newline, newlen;
@@ -1328,8 +1318,7 @@ struct sort_data {
void *key_list;
int linecount;
- char **lines;
- char *name;
+ char **lines, *name;
};
// toys/posix/split.c
diff --git a/android/linux/generated/help.h b/android/linux/generated/help.h
index cae178ed..ef424430 100644
--- a/android/linux/generated/help.h
+++ b/android/linux/generated/help.h
@@ -178,7 +178,7 @@
#define HELP_shred "usage: shred [-fuz] [-n COUNT] [-s SIZE] FILE...\n\nSecurely delete a file by overwriting its contents with random data.\n\n-f Force (chmod if necessary)\n-n COUNT Random overwrite iterations (default 1)\n-o OFFSET Start at OFFSET\n-s SIZE Use SIZE instead of detecting file size\n-u Unlink (actually delete file when done)\n-x Use exact size (default without -s rounds up to next 4k)\n-z Zero at end\n\nNote: data journaling filesystems render this command useless, you must\noverwrite all free space (fill up disk) to erase old data on those."
-#define HELP_setsid "usage: setsid [-t] command [args...]\n\nRun process in a new session.\n\n-t Grab tty (become foreground process, receiving keyboard signals)"
+#define HELP_setsid "usage: setsid [-cdw] command [args...]\n\nRun process in a new session.\n\n-d Detach from tty\n-c Control tty (become foreground process & receive keyboard signals)"
#define HELP_setfattr "usage: setfattr [-h] [-x|-n NAME] [-v VALUE] FILE...\n\nWrite POSIX extended attributes.\n\n-h Do not dereference symlink\n-n Set given attribute\n-x Remove given attribute\n-v Set value for attribute -n (default is empty)"
@@ -264,9 +264,7 @@
#define HELP_hexedit "usage: hexedit FILENAME\n\nHexadecimal file editor. All changes are written to disk immediately.\n\n-r Read only (display but don't edit)\n\nKeys:\nArrows Move left/right/up/down by one line/column\nPg Up/Pg Dn Move up/down by one page\n0-9, a-f Change current half-byte to hexadecimal value\nu Undo\nq/^c/^d/<esc> Quit"
-#define HELP_help_extras "usage: help [-ah]\n\n-a All commands\n-h HTML output"
-
-#define HELP_help "usage: help [command]\n\nShow usage information for toybox commands.\nRun \"toybox\" with no arguments for a list of available commands."
+#define HELP_help "usage: help [-ahu] [COMMAND]\n\n-a All commands\n-u Usage only\n-h HTML output\n\nShow usage information for toybox commands.\nRun \"toybox\" with no arguments for a list of available commands."
#define HELP_fsync "usage: fsync [-d] [FILE...]\n\nSynchronize a file's in-core state with storage device.\n\n-d Avoid syncing metadata"
@@ -464,7 +462,7 @@
#define HELP_tty "usage: tty [-s]\n\nShow filename of terminal connected to stdin.\n\nPrints \"not a tty\" and exits with nonzero status if no terminal\nis connected to stdin.\n\n-s Silent, exit code only"
-#define HELP_true "Return zero."
+#define HELP_true "usage: true\n\nReturn zero."
#define HELP_touch "usage: touch [-amch] [-d DATE] [-t TIME] [-r FILE] FILE...\n\nUpdate the access and modification times of each FILE to the current time.\n\n-a Change access time\n-m Change modification time\n-c Don't create file\n-h Change symlink\n-d Set time to DATE (in YYYY-MM-DDThh:mm:SS[.frac][tz] format)\n-t Set time to TIME (in [[CC]YY]MMDDhhmm[.ss][frac] format)\n-r Set time same as reference FILE"
@@ -508,7 +506,7 @@
#define HELP_printf "usage: printf FORMAT [ARGUMENT...]\n\nFormat and print ARGUMENT(s) according to FORMAT, using C printf syntax\n(% escapes for cdeEfgGiosuxX, \\ escapes for abefnrtv0 or \\OCTAL or \\xHEX)."
-#define HELP_patch "usage: patch [-d DIR] [-i file] [-p depth] [-Rlsu] [--dry-run]\n\nApply a unified diff to one or more files.\n\n-d Modify files in DIR\n-i Input file (default=stdin)\n-l Loose match (ignore whitespace)\n-p Number of '/' to strip from start of file paths (default=all)\n-R Reverse patch\n-s Silent except for errors\n-u Ignored (only handles \"unified\" diffs)\n--dry-run Don't change files, just confirm patch applies\n\nThis version of patch only handles unified diffs, and only modifies\na file when all hunks to that file apply. Patch prints failed hunks\nto stderr, and exits with nonzero status if any hunks fail.\n\nA file compared against /dev/null (or with a date <= the epoch) is\ncreated/deleted as appropriate."
+#define HELP_patch "usage: patch [-d DIR] [-i PATCH] [-p depth] [-F FUZZ] [-Rlsu] [--dry-run] [FILE [PATCH]]\n\nApply a unified diff to one or more files.\n\n-d Modify files in DIR\n-i Input patch file (default=stdin)\n-l Loose match (ignore whitespace)\n-p Number of '/' to strip from start of file paths (default=all)\n-R Reverse patch\n-s Silent except for errors\n-u Ignored (only handles \"unified\" diffs)\n--dry-run Don't change files, just confirm patch applies\n\nThis version of patch only handles unified diffs, and only modifies\na file when all hunks to that file apply. Patch prints failed hunks\nto stderr, and exits with nonzero status if any hunks fail.\n\nA file compared against /dev/null (or with a date <= the epoch) is\ncreated/deleted as appropriate."
#define HELP_paste "usage: paste [-s] [-d DELIMITERS] [FILE...]\n\nMerge corresponding lines from each input file.\n\n-d List of delimiter characters to separate fields with (default is \\t)\n-s Sequential mode: turn each input file into one line of output"
@@ -562,7 +560,7 @@
#define HELP_file "usage: file [-bhLs] [file...]\n\nExamine the given files and describe their content types.\n\n-b Brief (no filename)\n-h Don't follow symlinks (default)\n-L Follow symlinks\n-s Show block/char device contents"
-#define HELP_false "Return nonzero."
+#define HELP_false "usage: false\n\nReturn nonzero."
#define HELP_expand "usage: expand [-t TABLIST] [FILE...]\n\nExpand tabs to spaces according to tabstops.\n\n-t TABLIST\n\nSpecify tab stops, either a single number instead of the default 8,\nor a comma separated list of increasing numbers representing tabstop\npositions (absolute, not increments) with each additional tab beyond\nthat becoming one space."
@@ -576,7 +574,7 @@
#define HELP_df "usage: df [-HPkhi] [-t type] [FILESYSTEM ...]\n\nThe \"disk free\" command shows total/used/available disk space for\neach filesystem listed on the command line, or all currently mounted\nfilesystems.\n\n-a Show all (including /proc and friends)\n-P The SUSv3 \"Pedantic\" option\n-k Sets units back to 1024 bytes (the default without -P)\n-h Human readable (K=1024)\n-H Human readable (k=1000)\n-i Show inodes instead of blocks\n-t type Display only filesystems of this type\n\nPedantic provides a slightly less useful output format dictated by Posix,\nand sets the units to 512 bytes instead of the default 1024 bytes."
-#define HELP_date "usage: date [-u] [-r FILE] [-d DATE] [+DISPLAY_FORMAT] [-D SET_FORMAT] [SET]\n\nSet/get the current date/time. With no SET shows the current date.\n\n-d Show DATE instead of current time (convert date format)\n-D +FORMAT for SET or -d (instead of MMDDhhmm[[CC]YY][.ss])\n-r Use modification time of FILE instead of current date\n-u Use UTC instead of current timezone\n\nSupported input formats:\n\nMMDDhhmm[[CC]YY][.ss] POSIX\n@UNIXTIME[.FRACTION] seconds since midnight 1970-01-01\nYYYY-MM-DD [hh:mm[:ss]] ISO 8601\nhh:mm[:ss] 24-hour time today\n\nAll input formats can be preceded by TZ=\"id\" to set the input time zone\nseparately from the output time zone. Otherwise $TZ sets both.\n\n+FORMAT specifies display format string using strftime(3) syntax:\n\n%% literal % %n newline %t tab\n%S seconds (00-60) %M minute (00-59) %m month (01-12)\n%H hour (0-23) %I hour (01-12) %p AM/PM\n%y short year (00-99) %Y year %C century\n%a short weekday name %A weekday name %u day of week (1-7, 1=mon)\n%b short month name %B month name %Z timezone name\n%j day of year (001-366) %d day of month (01-31) %e day of month ( 1-31)\n%N nanosec (output only)\n\n%U Week of year (0-53 start sunday) %W Week of year (0-53 start monday)\n%V Week of year (1-53 start monday, week < 4 days not part of this year)\n\n%D = \"%m/%d/%y\" %r = \"%I : %M : %S %p\" %T = \"%H:%M:%S\" %h = \"%b\"\n%x locale date %X locale time %c locale date/time"
+#define HELP_date "usage: date [-u] [-r FILE] [-d DATE] [+DISPLAY_FORMAT] [-D SET_FORMAT] [SET]\n\nSet/get the current date/time. With no SET shows the current date.\n\n-d Show DATE instead of current time (convert date format)\n-D +FORMAT for SET or -d (instead of MMDDhhmm[[CC]YY][.ss])\n-r Use modification time of FILE instead of current date\n-u Use UTC instead of current timezone\n\nSupported input formats:\n\nMMDDhhmm[[CC]YY][.ss] POSIX\n@UNIXTIME[.FRACTION] seconds since midnight 1970-01-01\nYYYY-MM-DD [hh:mm[:ss]] ISO 8601\nhh:mm[:ss] 24-hour time today\n\nAll input formats can be preceded by TZ=\"id\" to set the input time zone\nseparately from the output time zone. Otherwise $TZ sets both.\n\n+FORMAT specifies display format string using strftime(3) syntax:\n\n%% literal % %n newline %t tab\n%S seconds (00-60) %M minute (00-59) %m month (01-12)\n%H hour (0-23) %I hour (01-12) %p AM/PM\n%y short year (00-99) %Y year %C century\n%a short weekday name %A weekday name %u day of week (1-7, 1=mon)\n%b short month name %B month name %Z timezone name\n%j day of year (001-366) %d day of month (01-31) %e day of month ( 1-31)\n%N nanosec (output only)\n\n%U Week of year (0-53 start sunday) %W Week of year (0-53 start monday)\n%V Week of year (1-53 start monday, week < 4 days not part of this year)\n\n%F \"%Y-%m-%d\" %R \"%H:%M\" %T \"%H:%M:%S\" %z numeric timezone\n%D \"%m/%d/%y\" %r \"%I:%M:%S %p\" %h \"%b\" %s unix epoch time\n%x locale date %X locale time %c locale date/time"
#define HELP_cut "usage: cut [-Ds] [-bcfF LIST] [-dO DELIM] [FILE...]\n\nPrint selected parts of lines from each FILE to standard output.\n\nEach selection LIST is comma separated, either numbers (counting from 1)\nor dash separated ranges (inclusive, with X- meaning to end of line and -X\nfrom start). By default selection ranges are sorted and collated, use -D\nto prevent that.\n\n-b Select bytes\n-c Select UTF-8 characters\n-C Select unicode columns\n-d Use DELIM (default is TAB for -f, run of whitespace for -F)\n-D Don't sort/collate selections or match -fF lines without delimiter\n-f Select fields (words) separated by single DELIM character\n-F Select fields separated by DELIM regex\n-O Output delimiter (default one space for -F, input delim for -f)\n-s Skip lines without delimiters"
diff --git a/android/linux/generated/newtoys.h b/android/linux/generated/newtoys.h
index 7b39d64e..2801ae27 100644
--- a/android/linux/generated/newtoys.h
+++ b/android/linux/generated/newtoys.h
@@ -2,7 +2,7 @@ USE_TOYBOX(NEWTOY(toybox, NULL, TOYFLAG_STAYROOT))
USE_SH(OLDTOY(-bash, sh, 0))
USE_SH(OLDTOY(-sh, sh, 0))
USE_SH(OLDTOY(-toysh, sh, 0))
-USE_TRUE(OLDTOY(:, true, TOYFLAG_NOFORK|TOYFLAG_NOHELP))
+USE_TRUE(OLDTOY(:, true, TOYFLAG_NOFORK|TOYFLAG_NOHELP|TOYFLAG_MAYFORK))
USE_TEST(OLDTOY([, test, TOYFLAG_NOFORK|TOYFLAG_NOHELP))
USE_ACPI(NEWTOY(acpi, "abctV", TOYFLAG_USR|TOYFLAG_BIN))
USE_GROUPADD(OLDTOY(addgroup, groupadd, TOYFLAG_NEEDROOT|TOYFLAG_SBIN))
@@ -24,7 +24,7 @@ USE_BZCAT(NEWTOY(bzcat, NULL, TOYFLAG_USR|TOYFLAG_BIN))
USE_CAL(NEWTOY(cal, ">2", TOYFLAG_USR|TOYFLAG_BIN))
USE_CAT(NEWTOY(cat, "u"USE_CAT_V("vte"), TOYFLAG_BIN))
USE_CATV(NEWTOY(catv, USE_CATV("vte"), TOYFLAG_USR|TOYFLAG_BIN))
-USE_SH(NEWTOY(cd, NULL, TOYFLAG_NOFORK))
+USE_SH(NEWTOY(cd, ">1LP[-LP]", TOYFLAG_NOFORK))
USE_CHATTR(NEWTOY(chattr, NULL, TOYFLAG_BIN))
USE_CHCON(NEWTOY(chcon, "<2hvR", TOYFLAG_USR|TOYFLAG_BIN))
USE_CHGRP(NEWTOY(chgrp, "<2hPLHRfv[-HLP]", TOYFLAG_BIN))
@@ -74,7 +74,7 @@ USE_EXPAND(NEWTOY(expand, "t*", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LOCALE))
USE_EXPR(NEWTOY(expr, NULL, TOYFLAG_USR|TOYFLAG_BIN))
USE_FACTOR(NEWTOY(factor, 0, TOYFLAG_USR|TOYFLAG_BIN))
USE_FALLOCATE(NEWTOY(fallocate, ">1l#|o#", TOYFLAG_USR|TOYFLAG_BIN))
-USE_FALSE(NEWTOY(false, NULL, TOYFLAG_BIN|TOYFLAG_NOHELP))
+USE_FALSE(NEWTOY(false, NULL, TOYFLAG_BIN|TOYFLAG_NOHELP|TOYFLAG_MAYFORK))
USE_FDISK(NEWTOY(fdisk, "C#<0H#<0S#<0b#<512ul", TOYFLAG_SBIN))
USE_FGREP(OLDTOY(fgrep, grep, TOYFLAG_BIN|TOYFLAG_ARGFAIL(2)))
USE_FILE(NEWTOY(file, "<1bhLs[!hL]", TOYFLAG_USR|TOYFLAG_BIN))
@@ -104,7 +104,7 @@ USE_GZIP(NEWTOY(gzip, "ncdfk123456789[-123456789]", TOYFLAG_USR|TOYFLAG_BIN))
USE_REBOOT(OLDTOY(halt, reboot, TOYFLAG_SBIN|TOYFLAG_NEEDROOT))
USE_HEAD(NEWTOY(head, "?n(lines)#<0=10c(bytes)#<0qv[-nc]", TOYFLAG_USR|TOYFLAG_BIN))
USE_HELLO(NEWTOY(hello, 0, TOYFLAG_USR|TOYFLAG_BIN))
-USE_HELP(NEWTOY(help, ""USE_HELP_EXTRAS("ah"), TOYFLAG_BIN))
+USE_HELP(NEWTOY(help, "ahu", TOYFLAG_BIN|TOYFLAG_MAYFORK))
USE_HEXEDIT(NEWTOY(hexedit, "<1>1r", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LOCALE))
USE_HOST(NEWTOY(host, "<1>2avt:", TOYFLAG_USR|TOYFLAG_BIN))
USE_HOSTID(NEWTOY(hostid, ">0", TOYFLAG_USR|TOYFLAG_BIN))
@@ -132,7 +132,7 @@ USE_IP(OLDTOY(iplink, ip, TOYFLAG_SBIN))
USE_IP(OLDTOY(iproute, ip, TOYFLAG_SBIN))
USE_IP(OLDTOY(iprule, ip, TOYFLAG_SBIN))
USE_IP(OLDTOY(iptunnel, ip, TOYFLAG_SBIN))
-USE_KILL(NEWTOY(kill, "?ls: ", TOYFLAG_BIN))
+USE_KILL(NEWTOY(kill, "?ls: ", TOYFLAG_BIN|TOYFLAG_MAYFORK))
USE_KILLALL(NEWTOY(killall, "?s:ilqvw", TOYFLAG_USR|TOYFLAG_BIN))
USE_KILLALL5(NEWTOY(killall5, "?o*ls: [!lo][!ls]", TOYFLAG_SBIN))
USE_KLOGD(NEWTOY(klogd, "c#<1>8n", TOYFLAG_SBIN))
@@ -188,7 +188,7 @@ USE_OPENVT(NEWTOY(openvt, "c#<1>63sw", TOYFLAG_BIN|TOYFLAG_NEEDROOT))
USE_PARTPROBE(NEWTOY(partprobe, "<1", TOYFLAG_SBIN))
USE_PASSWD(NEWTOY(passwd, ">1a:dlu", TOYFLAG_STAYROOT|TOYFLAG_USR|TOYFLAG_BIN))
USE_PASTE(NEWTOY(paste, "d:s", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LOCALE))
-USE_PATCH(NEWTOY(patch, "(no-backup-if-mismatch)(dry-run)"USE_TOYBOX_DEBUG("x")"g#fulp#d:i:Rs(quiet)", TOYFLAG_USR|TOYFLAG_BIN))
+USE_PATCH(NEWTOY(patch, ">2(no-backup-if-mismatch)(dry-run)"USE_TOYBOX_DEBUG("x")"F#g#fulp#d:i:Rs(quiet)", TOYFLAG_USR|TOYFLAG_BIN))
USE_PGREP(NEWTOY(pgrep, "?cld:u*U*t*s*P*g*G*fnovxL:[-no]", TOYFLAG_USR|TOYFLAG_BIN))
USE_PIDOF(NEWTOY(pidof, "<1so:x", TOYFLAG_BIN))
USE_PING(NEWTOY(ping, "<1>1m#t#<0>255=64c#<0=3s#<0>4088=56i%W#<0=3w#<0qf46I:[-46]", TOYFLAG_USR|TOYFLAG_BIN))
@@ -201,7 +201,7 @@ USE_PRINTENV(NEWTOY(printenv, "0(null)", TOYFLAG_BIN))
USE_PRINTF(NEWTOY(printf, "<1?^", TOYFLAG_USR|TOYFLAG_BIN))
USE_ULIMIT(OLDTOY(prlimit, ulimit, TOYFLAG_USR|TOYFLAG_BIN))
USE_PS(NEWTOY(ps, "k(sort)*P(ppid)*aAdeflMno*O*p(pid)*s*t*Tu*U*g*G*wZ[!ol][+Ae][!oO]", TOYFLAG_BIN|TOYFLAG_LOCALE))
-USE_PWD(NEWTOY(pwd, ">0LP[-LP]", TOYFLAG_BIN))
+USE_PWD(NEWTOY(pwd, ">0LP[-LP]", TOYFLAG_BIN|TOYFLAG_MAYFORK))
USE_PWDX(NEWTOY(pwdx, "<1a", TOYFLAG_USR|TOYFLAG_BIN))
USE_READAHEAD(NEWTOY(readahead, NULL, TOYFLAG_BIN))
USE_READLINK(NEWTOY(readlink, "<1nqmef(canonicalize)[-mef]", TOYFLAG_USR|TOYFLAG_BIN))
@@ -222,8 +222,8 @@ USE_SENDEVENT(NEWTOY(sendevent, "<4>4", TOYFLAG_USR|TOYFLAG_SBIN))
USE_SEQ(NEWTOY(seq, "<1>3?f:s:w[!fw]", TOYFLAG_USR|TOYFLAG_BIN))
USE_SETENFORCE(NEWTOY(setenforce, "<1>1", TOYFLAG_USR|TOYFLAG_SBIN))
USE_SETFATTR(NEWTOY(setfattr, "hn:|v:x:|[!xv]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_SETSID(NEWTOY(setsid, "^<1t", TOYFLAG_USR|TOYFLAG_BIN))
-USE_SH(NEWTOY(sh, "c:i", TOYFLAG_BIN))
+USE_SETSID(NEWTOY(setsid, "^<1wcd[!dc]", TOYFLAG_USR|TOYFLAG_BIN))
+USE_SH(NEWTOY(sh, "(noediting)(noprofile)(norc)sc:i", TOYFLAG_BIN))
USE_SHA1SUM(NEWTOY(sha1sum, "bc(check)s(status)[!bc]", TOYFLAG_USR|TOYFLAG_BIN))
USE_TOYBOX_LIBCRYPTO(USE_SHA224SUM(OLDTOY(sha224sum, sha1sum, TOYFLAG_USR|TOYFLAG_BIN)))
USE_TOYBOX_LIBCRYPTO(USE_SHA256SUM(OLDTOY(sha256sum, sha1sum, TOYFLAG_USR|TOYFLAG_BIN)))
@@ -258,7 +258,7 @@ USE_TELNETD(NEWTOY(telnetd, "w#<0b:p#<0>65535=23f:l:FSKi[!wi]", TOYFLAG_USR|TOYF
USE_TEST(NEWTOY(test, 0, TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_NOHELP|TOYFLAG_MAYFORK))
USE_TFTP(NEWTOY(tftp, "<1b#<8>65464r:l:g|p|[!gp]", TOYFLAG_USR|TOYFLAG_BIN))
USE_TFTPD(NEWTOY(tftpd, "rcu:l", TOYFLAG_BIN))
-USE_TIME(NEWTOY(time, "<1^pv", TOYFLAG_USR|TOYFLAG_BIN))
+USE_TIME(NEWTOY(time, "<1^pv", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_MAYFORK))
USE_TIMEOUT(NEWTOY(timeout, "<2^(foreground)(preserve-status)vk:s(signal):", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_ARGFAIL(125)))
USE_TOP(NEWTOY(top, ">0O*" "Hk*o*p*u*s#<1d%<100=3000m#n#<1bq[!oO]", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LOCALE))
USE_TOUCH(NEWTOY(touch, "<1acd:fmr:t:h[!dtr]", TOYFLAG_BIN))
@@ -266,7 +266,7 @@ USE_SH(OLDTOY(toysh, sh, TOYFLAG_BIN))
USE_TR(NEWTOY(tr, "^>2<1Ccsd[+cC]", TOYFLAG_USR|TOYFLAG_BIN))
USE_TRACEROUTE(NEWTOY(traceroute, "<1>2i:f#<1>255=1z#<0>86400=0g*w#<0>86400=5t#<0>255=0s:q#<1>255=3p#<1>65535=33434m#<1>255=30rvndlIUF64", TOYFLAG_STAYROOT|TOYFLAG_USR|TOYFLAG_BIN))
USE_TRACEROUTE(OLDTOY(traceroute6,traceroute, TOYFLAG_STAYROOT|TOYFLAG_USR|TOYFLAG_BIN))
-USE_TRUE(NEWTOY(true, NULL, TOYFLAG_BIN|TOYFLAG_NOHELP))
+USE_TRUE(NEWTOY(true, NULL, TOYFLAG_BIN|TOYFLAG_NOHELP|TOYFLAG_MAYFORK))
USE_TRUNCATE(NEWTOY(truncate, "<1s:|c", TOYFLAG_USR|TOYFLAG_BIN))
USE_TTY(NEWTOY(tty, "s", TOYFLAG_USR|TOYFLAG_BIN))
USE_TUNCTL(NEWTOY(tunctl, "<1>1t|d|u:T[!td]", TOYFLAG_USR|TOYFLAG_BIN))
diff --git a/android/mac/generated/flags.h b/android/mac/generated/flags.h
index 7f0d2538..25d8787e 100644
--- a/android/mac/generated/flags.h
+++ b/android/mac/generated/flags.h
@@ -207,12 +207,14 @@
#undef FLAG_v
#endif
-// cd
+// cd >1LP[-LP]
#undef OPTSTR_cd
-#define OPTSTR_cd 0
+#define OPTSTR_cd ">1LP[-LP]"
#ifdef CLEANUP_cd
#undef CLEANUP_cd
#undef FOR_cd
+#undef FLAG_P
+#undef FLAG_L
#endif
// chattr
@@ -1178,12 +1180,13 @@
#undef FOR_hello
#endif
-// help ah
+// help ahu
#undef OPTSTR_help
-#define OPTSTR_help "ah"
+#define OPTSTR_help "ahu"
#ifdef CLEANUP_help
#undef CLEANUP_help
#undef FOR_help
+#undef FLAG_u
#undef FLAG_h
#undef FLAG_a
#endif
@@ -2104,9 +2107,9 @@
#undef FLAG_d
#endif
-// patch (no-backup-if-mismatch)(dry-run)g#fulp#d:i:Rs(quiet) (no-backup-if-mismatch)(dry-run)xg#fulp#d:i:Rs(quiet)
+// patch >2(no-backup-if-mismatch)(dry-run)F#g#fulp#d:i:Rs(quiet) >2(no-backup-if-mismatch)(dry-run)xF#g#fulp#d:i:Rs(quiet)
#undef OPTSTR_patch
-#define OPTSTR_patch "(no-backup-if-mismatch)(dry-run)g#fulp#d:i:Rs(quiet)"
+#define OPTSTR_patch ">2(no-backup-if-mismatch)(dry-run)F#g#fulp#d:i:Rs(quiet)"
#ifdef CLEANUP_patch
#undef CLEANUP_patch
#undef FOR_patch
@@ -2119,6 +2122,7 @@
#undef FLAG_u
#undef FLAG_f
#undef FLAG_g
+#undef FLAG_F
#undef FLAG_x
#undef FLAG_dry_run
#undef FLAG_no_backup_if_mismatch
@@ -2482,23 +2486,29 @@
#undef FLAG_h
#endif
-// setsid ^<1t ^<1t
+// setsid ^<1wcd[!dc] ^<1wcd[!dc]
#undef OPTSTR_setsid
-#define OPTSTR_setsid "^<1t"
+#define OPTSTR_setsid "^<1wcd[!dc]"
#ifdef CLEANUP_setsid
#undef CLEANUP_setsid
#undef FOR_setsid
-#undef FLAG_t
+#undef FLAG_d
+#undef FLAG_c
+#undef FLAG_w
#endif
-// sh c:i
+// sh (noediting)(noprofile)(norc)sc:i
#undef OPTSTR_sh
-#define OPTSTR_sh "c:i"
+#define OPTSTR_sh "(noediting)(noprofile)(norc)sc:i"
#ifdef CLEANUP_sh
#undef CLEANUP_sh
#undef FOR_sh
#undef FLAG_i
#undef FLAG_c
+#undef FLAG_s
+#undef FLAG_norc
+#undef FLAG_noprofile
+#undef FLAG_noediting
#endif
// sha1sum bc(check)s(status)[!bc] bc(check)s(status)[!bc]
@@ -3556,6 +3566,8 @@
#ifndef TT
#define TT this.cd
#endif
+#define FLAG_P (FORCED_FLAG<<0)
+#define FLAG_L (FORCED_FLAG<<1)
#endif
#ifdef FOR_chattr
@@ -4381,8 +4393,9 @@
#ifndef TT
#define TT this.help
#endif
-#define FLAG_h (FORCED_FLAG<<0)
-#define FLAG_a (FORCED_FLAG<<1)
+#define FLAG_u (FORCED_FLAG<<0)
+#define FLAG_h (FORCED_FLAG<<1)
+#define FLAG_a (FORCED_FLAG<<2)
#endif
#ifdef FOR_hexedit
@@ -5162,9 +5175,10 @@
#define FLAG_u (1<<6)
#define FLAG_f (1<<7)
#define FLAG_g (1<<8)
-#define FLAG_x (FORCED_FLAG<<9)
-#define FLAG_dry_run (1<<10)
-#define FLAG_no_backup_if_mismatch (1<<11)
+#define FLAG_F (1<<9)
+#define FLAG_x (FORCED_FLAG<<10)
+#define FLAG_dry_run (1<<11)
+#define FLAG_no_backup_if_mismatch (1<<12)
#endif
#ifdef FOR_pgrep
@@ -5469,7 +5483,9 @@
#ifndef TT
#define TT this.setsid
#endif
-#define FLAG_t (1<<0)
+#define FLAG_d (1<<0)
+#define FLAG_c (1<<1)
+#define FLAG_w (1<<2)
#endif
#ifdef FOR_sh
@@ -5478,6 +5494,10 @@
#endif
#define FLAG_i (FORCED_FLAG<<0)
#define FLAG_c (FORCED_FLAG<<1)
+#define FLAG_s (FORCED_FLAG<<2)
+#define FLAG_norc (FORCED_FLAG<<3)
+#define FLAG_noprofile (FORCED_FLAG<<4)
+#define FLAG_noediting (FORCED_FLAG<<5)
#endif
#ifdef FOR_sha1sum
diff --git a/android/mac/generated/globals.h b/android/mac/generated/globals.h
index c0cea266..726703ec 100644
--- a/android/mac/generated/globals.h
+++ b/android/mac/generated/globals.h
@@ -284,9 +284,7 @@ struct hwclock_data {
// toys/other/ionice.c
struct ionice_data {
- long pid;
- long level;
- long class;
+ long p, n, c;
};
// toys/other/login.c
@@ -793,11 +791,10 @@ struct sh_data {
char *command;
long lineno;
-
char **locals;
-
struct double_list functions;
- unsigned options;
+ unsigned options, jobcnt;
+ int hfd; // next high filehandle (>= 10)
// Running jobs.
struct sh_job {
@@ -812,19 +809,12 @@ struct sh_data {
// null terminated array of running processes in pipeline
struct sh_process {
- struct string_list *delete; // expanded strings
- struct sh_redirects {
- struct sh_redirects *next, *prev;
- int count, rd[];
- // rdlist = NULL if process didn't redirect, urd undoes <&- for builtins
- // rdlist is ** because this is our view into inherited context
- } **rdlist, *urd;
- int pid, exit;
+ struct sh_process *next, *prev;
+ struct arg_list *delete; // expanded strings
+ int *urd, envlen, pid, exit; // undo redirects, child PID, exit status
struct sh_arg arg;
} *procs, *proc;
} *jobs, *job;
- struct sh_process *callback_pp;
- unsigned jobcnt;
};
// toys/pending/stty.c
@@ -1254,7 +1244,7 @@ struct paste_data {
struct patch_data {
char *i, *d;
- long p, g;
+ long p, g, F;
struct double_list *current_hunk;
long oldline, oldlen, newline, newlen;
@@ -1328,8 +1318,7 @@ struct sort_data {
void *key_list;
int linecount;
- char **lines;
- char *name;
+ char **lines, *name;
};
// toys/posix/split.c
diff --git a/android/mac/generated/help.h b/android/mac/generated/help.h
index cae178ed..ef424430 100644
--- a/android/mac/generated/help.h
+++ b/android/mac/generated/help.h
@@ -178,7 +178,7 @@
#define HELP_shred "usage: shred [-fuz] [-n COUNT] [-s SIZE] FILE...\n\nSecurely delete a file by overwriting its contents with random data.\n\n-f Force (chmod if necessary)\n-n COUNT Random overwrite iterations (default 1)\n-o OFFSET Start at OFFSET\n-s SIZE Use SIZE instead of detecting file size\n-u Unlink (actually delete file when done)\n-x Use exact size (default without -s rounds up to next 4k)\n-z Zero at end\n\nNote: data journaling filesystems render this command useless, you must\noverwrite all free space (fill up disk) to erase old data on those."
-#define HELP_setsid "usage: setsid [-t] command [args...]\n\nRun process in a new session.\n\n-t Grab tty (become foreground process, receiving keyboard signals)"
+#define HELP_setsid "usage: setsid [-cdw] command [args...]\n\nRun process in a new session.\n\n-d Detach from tty\n-c Control tty (become foreground process & receive keyboard signals)"
#define HELP_setfattr "usage: setfattr [-h] [-x|-n NAME] [-v VALUE] FILE...\n\nWrite POSIX extended attributes.\n\n-h Do not dereference symlink\n-n Set given attribute\n-x Remove given attribute\n-v Set value for attribute -n (default is empty)"
@@ -264,9 +264,7 @@
#define HELP_hexedit "usage: hexedit FILENAME\n\nHexadecimal file editor. All changes are written to disk immediately.\n\n-r Read only (display but don't edit)\n\nKeys:\nArrows Move left/right/up/down by one line/column\nPg Up/Pg Dn Move up/down by one page\n0-9, a-f Change current half-byte to hexadecimal value\nu Undo\nq/^c/^d/<esc> Quit"
-#define HELP_help_extras "usage: help [-ah]\n\n-a All commands\n-h HTML output"
-
-#define HELP_help "usage: help [command]\n\nShow usage information for toybox commands.\nRun \"toybox\" with no arguments for a list of available commands."
+#define HELP_help "usage: help [-ahu] [COMMAND]\n\n-a All commands\n-u Usage only\n-h HTML output\n\nShow usage information for toybox commands.\nRun \"toybox\" with no arguments for a list of available commands."
#define HELP_fsync "usage: fsync [-d] [FILE...]\n\nSynchronize a file's in-core state with storage device.\n\n-d Avoid syncing metadata"
@@ -464,7 +462,7 @@
#define HELP_tty "usage: tty [-s]\n\nShow filename of terminal connected to stdin.\n\nPrints \"not a tty\" and exits with nonzero status if no terminal\nis connected to stdin.\n\n-s Silent, exit code only"
-#define HELP_true "Return zero."
+#define HELP_true "usage: true\n\nReturn zero."
#define HELP_touch "usage: touch [-amch] [-d DATE] [-t TIME] [-r FILE] FILE...\n\nUpdate the access and modification times of each FILE to the current time.\n\n-a Change access time\n-m Change modification time\n-c Don't create file\n-h Change symlink\n-d Set time to DATE (in YYYY-MM-DDThh:mm:SS[.frac][tz] format)\n-t Set time to TIME (in [[CC]YY]MMDDhhmm[.ss][frac] format)\n-r Set time same as reference FILE"
@@ -508,7 +506,7 @@
#define HELP_printf "usage: printf FORMAT [ARGUMENT...]\n\nFormat and print ARGUMENT(s) according to FORMAT, using C printf syntax\n(% escapes for cdeEfgGiosuxX, \\ escapes for abefnrtv0 or \\OCTAL or \\xHEX)."
-#define HELP_patch "usage: patch [-d DIR] [-i file] [-p depth] [-Rlsu] [--dry-run]\n\nApply a unified diff to one or more files.\n\n-d Modify files in DIR\n-i Input file (default=stdin)\n-l Loose match (ignore whitespace)\n-p Number of '/' to strip from start of file paths (default=all)\n-R Reverse patch\n-s Silent except for errors\n-u Ignored (only handles \"unified\" diffs)\n--dry-run Don't change files, just confirm patch applies\n\nThis version of patch only handles unified diffs, and only modifies\na file when all hunks to that file apply. Patch prints failed hunks\nto stderr, and exits with nonzero status if any hunks fail.\n\nA file compared against /dev/null (or with a date <= the epoch) is\ncreated/deleted as appropriate."
+#define HELP_patch "usage: patch [-d DIR] [-i PATCH] [-p depth] [-F FUZZ] [-Rlsu] [--dry-run] [FILE [PATCH]]\n\nApply a unified diff to one or more files.\n\n-d Modify files in DIR\n-i Input patch file (default=stdin)\n-l Loose match (ignore whitespace)\n-p Number of '/' to strip from start of file paths (default=all)\n-R Reverse patch\n-s Silent except for errors\n-u Ignored (only handles \"unified\" diffs)\n--dry-run Don't change files, just confirm patch applies\n\nThis version of patch only handles unified diffs, and only modifies\na file when all hunks to that file apply. Patch prints failed hunks\nto stderr, and exits with nonzero status if any hunks fail.\n\nA file compared against /dev/null (or with a date <= the epoch) is\ncreated/deleted as appropriate."
#define HELP_paste "usage: paste [-s] [-d DELIMITERS] [FILE...]\n\nMerge corresponding lines from each input file.\n\n-d List of delimiter characters to separate fields with (default is \\t)\n-s Sequential mode: turn each input file into one line of output"
@@ -562,7 +560,7 @@
#define HELP_file "usage: file [-bhLs] [file...]\n\nExamine the given files and describe their content types.\n\n-b Brief (no filename)\n-h Don't follow symlinks (default)\n-L Follow symlinks\n-s Show block/char device contents"
-#define HELP_false "Return nonzero."
+#define HELP_false "usage: false\n\nReturn nonzero."
#define HELP_expand "usage: expand [-t TABLIST] [FILE...]\n\nExpand tabs to spaces according to tabstops.\n\n-t TABLIST\n\nSpecify tab stops, either a single number instead of the default 8,\nor a comma separated list of increasing numbers representing tabstop\npositions (absolute, not increments) with each additional tab beyond\nthat becoming one space."
@@ -576,7 +574,7 @@
#define HELP_df "usage: df [-HPkhi] [-t type] [FILESYSTEM ...]\n\nThe \"disk free\" command shows total/used/available disk space for\neach filesystem listed on the command line, or all currently mounted\nfilesystems.\n\n-a Show all (including /proc and friends)\n-P The SUSv3 \"Pedantic\" option\n-k Sets units back to 1024 bytes (the default without -P)\n-h Human readable (K=1024)\n-H Human readable (k=1000)\n-i Show inodes instead of blocks\n-t type Display only filesystems of this type\n\nPedantic provides a slightly less useful output format dictated by Posix,\nand sets the units to 512 bytes instead of the default 1024 bytes."
-#define HELP_date "usage: date [-u] [-r FILE] [-d DATE] [+DISPLAY_FORMAT] [-D SET_FORMAT] [SET]\n\nSet/get the current date/time. With no SET shows the current date.\n\n-d Show DATE instead of current time (convert date format)\n-D +FORMAT for SET or -d (instead of MMDDhhmm[[CC]YY][.ss])\n-r Use modification time of FILE instead of current date\n-u Use UTC instead of current timezone\n\nSupported input formats:\n\nMMDDhhmm[[CC]YY][.ss] POSIX\n@UNIXTIME[.FRACTION] seconds since midnight 1970-01-01\nYYYY-MM-DD [hh:mm[:ss]] ISO 8601\nhh:mm[:ss] 24-hour time today\n\nAll input formats can be preceded by TZ=\"id\" to set the input time zone\nseparately from the output time zone. Otherwise $TZ sets both.\n\n+FORMAT specifies display format string using strftime(3) syntax:\n\n%% literal % %n newline %t tab\n%S seconds (00-60) %M minute (00-59) %m month (01-12)\n%H hour (0-23) %I hour (01-12) %p AM/PM\n%y short year (00-99) %Y year %C century\n%a short weekday name %A weekday name %u day of week (1-7, 1=mon)\n%b short month name %B month name %Z timezone name\n%j day of year (001-366) %d day of month (01-31) %e day of month ( 1-31)\n%N nanosec (output only)\n\n%U Week of year (0-53 start sunday) %W Week of year (0-53 start monday)\n%V Week of year (1-53 start monday, week < 4 days not part of this year)\n\n%D = \"%m/%d/%y\" %r = \"%I : %M : %S %p\" %T = \"%H:%M:%S\" %h = \"%b\"\n%x locale date %X locale time %c locale date/time"
+#define HELP_date "usage: date [-u] [-r FILE] [-d DATE] [+DISPLAY_FORMAT] [-D SET_FORMAT] [SET]\n\nSet/get the current date/time. With no SET shows the current date.\n\n-d Show DATE instead of current time (convert date format)\n-D +FORMAT for SET or -d (instead of MMDDhhmm[[CC]YY][.ss])\n-r Use modification time of FILE instead of current date\n-u Use UTC instead of current timezone\n\nSupported input formats:\n\nMMDDhhmm[[CC]YY][.ss] POSIX\n@UNIXTIME[.FRACTION] seconds since midnight 1970-01-01\nYYYY-MM-DD [hh:mm[:ss]] ISO 8601\nhh:mm[:ss] 24-hour time today\n\nAll input formats can be preceded by TZ=\"id\" to set the input time zone\nseparately from the output time zone. Otherwise $TZ sets both.\n\n+FORMAT specifies display format string using strftime(3) syntax:\n\n%% literal % %n newline %t tab\n%S seconds (00-60) %M minute (00-59) %m month (01-12)\n%H hour (0-23) %I hour (01-12) %p AM/PM\n%y short year (00-99) %Y year %C century\n%a short weekday name %A weekday name %u day of week (1-7, 1=mon)\n%b short month name %B month name %Z timezone name\n%j day of year (001-366) %d day of month (01-31) %e day of month ( 1-31)\n%N nanosec (output only)\n\n%U Week of year (0-53 start sunday) %W Week of year (0-53 start monday)\n%V Week of year (1-53 start monday, week < 4 days not part of this year)\n\n%F \"%Y-%m-%d\" %R \"%H:%M\" %T \"%H:%M:%S\" %z numeric timezone\n%D \"%m/%d/%y\" %r \"%I:%M:%S %p\" %h \"%b\" %s unix epoch time\n%x locale date %X locale time %c locale date/time"
#define HELP_cut "usage: cut [-Ds] [-bcfF LIST] [-dO DELIM] [FILE...]\n\nPrint selected parts of lines from each FILE to standard output.\n\nEach selection LIST is comma separated, either numbers (counting from 1)\nor dash separated ranges (inclusive, with X- meaning to end of line and -X\nfrom start). By default selection ranges are sorted and collated, use -D\nto prevent that.\n\n-b Select bytes\n-c Select UTF-8 characters\n-C Select unicode columns\n-d Use DELIM (default is TAB for -f, run of whitespace for -F)\n-D Don't sort/collate selections or match -fF lines without delimiter\n-f Select fields (words) separated by single DELIM character\n-F Select fields separated by DELIM regex\n-O Output delimiter (default one space for -F, input delim for -f)\n-s Skip lines without delimiters"
diff --git a/android/mac/generated/newtoys.h b/android/mac/generated/newtoys.h
index 7b39d64e..2801ae27 100644
--- a/android/mac/generated/newtoys.h
+++ b/android/mac/generated/newtoys.h
@@ -2,7 +2,7 @@ USE_TOYBOX(NEWTOY(toybox, NULL, TOYFLAG_STAYROOT))
USE_SH(OLDTOY(-bash, sh, 0))
USE_SH(OLDTOY(-sh, sh, 0))
USE_SH(OLDTOY(-toysh, sh, 0))
-USE_TRUE(OLDTOY(:, true, TOYFLAG_NOFORK|TOYFLAG_NOHELP))
+USE_TRUE(OLDTOY(:, true, TOYFLAG_NOFORK|TOYFLAG_NOHELP|TOYFLAG_MAYFORK))
USE_TEST(OLDTOY([, test, TOYFLAG_NOFORK|TOYFLAG_NOHELP))
USE_ACPI(NEWTOY(acpi, "abctV", TOYFLAG_USR|TOYFLAG_BIN))
USE_GROUPADD(OLDTOY(addgroup, groupadd, TOYFLAG_NEEDROOT|TOYFLAG_SBIN))
@@ -24,7 +24,7 @@ USE_BZCAT(NEWTOY(bzcat, NULL, TOYFLAG_USR|TOYFLAG_BIN))
USE_CAL(NEWTOY(cal, ">2", TOYFLAG_USR|TOYFLAG_BIN))
USE_CAT(NEWTOY(cat, "u"USE_CAT_V("vte"), TOYFLAG_BIN))
USE_CATV(NEWTOY(catv, USE_CATV("vte"), TOYFLAG_USR|TOYFLAG_BIN))
-USE_SH(NEWTOY(cd, NULL, TOYFLAG_NOFORK))
+USE_SH(NEWTOY(cd, ">1LP[-LP]", TOYFLAG_NOFORK))
USE_CHATTR(NEWTOY(chattr, NULL, TOYFLAG_BIN))
USE_CHCON(NEWTOY(chcon, "<2hvR", TOYFLAG_USR|TOYFLAG_BIN))
USE_CHGRP(NEWTOY(chgrp, "<2hPLHRfv[-HLP]", TOYFLAG_BIN))
@@ -74,7 +74,7 @@ USE_EXPAND(NEWTOY(expand, "t*", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LOCALE))
USE_EXPR(NEWTOY(expr, NULL, TOYFLAG_USR|TOYFLAG_BIN))
USE_FACTOR(NEWTOY(factor, 0, TOYFLAG_USR|TOYFLAG_BIN))
USE_FALLOCATE(NEWTOY(fallocate, ">1l#|o#", TOYFLAG_USR|TOYFLAG_BIN))
-USE_FALSE(NEWTOY(false, NULL, TOYFLAG_BIN|TOYFLAG_NOHELP))
+USE_FALSE(NEWTOY(false, NULL, TOYFLAG_BIN|TOYFLAG_NOHELP|TOYFLAG_MAYFORK))
USE_FDISK(NEWTOY(fdisk, "C#<0H#<0S#<0b#<512ul", TOYFLAG_SBIN))
USE_FGREP(OLDTOY(fgrep, grep, TOYFLAG_BIN|TOYFLAG_ARGFAIL(2)))
USE_FILE(NEWTOY(file, "<1bhLs[!hL]", TOYFLAG_USR|TOYFLAG_BIN))
@@ -104,7 +104,7 @@ USE_GZIP(NEWTOY(gzip, "ncdfk123456789[-123456789]", TOYFLAG_USR|TOYFLAG_BIN))
USE_REBOOT(OLDTOY(halt, reboot, TOYFLAG_SBIN|TOYFLAG_NEEDROOT))
USE_HEAD(NEWTOY(head, "?n(lines)#<0=10c(bytes)#<0qv[-nc]", TOYFLAG_USR|TOYFLAG_BIN))
USE_HELLO(NEWTOY(hello, 0, TOYFLAG_USR|TOYFLAG_BIN))
-USE_HELP(NEWTOY(help, ""USE_HELP_EXTRAS("ah"), TOYFLAG_BIN))
+USE_HELP(NEWTOY(help, "ahu", TOYFLAG_BIN|TOYFLAG_MAYFORK))
USE_HEXEDIT(NEWTOY(hexedit, "<1>1r", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LOCALE))
USE_HOST(NEWTOY(host, "<1>2avt:", TOYFLAG_USR|TOYFLAG_BIN))
USE_HOSTID(NEWTOY(hostid, ">0", TOYFLAG_USR|TOYFLAG_BIN))
@@ -132,7 +132,7 @@ USE_IP(OLDTOY(iplink, ip, TOYFLAG_SBIN))
USE_IP(OLDTOY(iproute, ip, TOYFLAG_SBIN))
USE_IP(OLDTOY(iprule, ip, TOYFLAG_SBIN))
USE_IP(OLDTOY(iptunnel, ip, TOYFLAG_SBIN))
-USE_KILL(NEWTOY(kill, "?ls: ", TOYFLAG_BIN))
+USE_KILL(NEWTOY(kill, "?ls: ", TOYFLAG_BIN|TOYFLAG_MAYFORK))
USE_KILLALL(NEWTOY(killall, "?s:ilqvw", TOYFLAG_USR|TOYFLAG_BIN))
USE_KILLALL5(NEWTOY(killall5, "?o*ls: [!lo][!ls]", TOYFLAG_SBIN))
USE_KLOGD(NEWTOY(klogd, "c#<1>8n", TOYFLAG_SBIN))
@@ -188,7 +188,7 @@ USE_OPENVT(NEWTOY(openvt, "c#<1>63sw", TOYFLAG_BIN|TOYFLAG_NEEDROOT))
USE_PARTPROBE(NEWTOY(partprobe, "<1", TOYFLAG_SBIN))
USE_PASSWD(NEWTOY(passwd, ">1a:dlu", TOYFLAG_STAYROOT|TOYFLAG_USR|TOYFLAG_BIN))
USE_PASTE(NEWTOY(paste, "d:s", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LOCALE))
-USE_PATCH(NEWTOY(patch, "(no-backup-if-mismatch)(dry-run)"USE_TOYBOX_DEBUG("x")"g#fulp#d:i:Rs(quiet)", TOYFLAG_USR|TOYFLAG_BIN))
+USE_PATCH(NEWTOY(patch, ">2(no-backup-if-mismatch)(dry-run)"USE_TOYBOX_DEBUG("x")"F#g#fulp#d:i:Rs(quiet)", TOYFLAG_USR|TOYFLAG_BIN))
USE_PGREP(NEWTOY(pgrep, "?cld:u*U*t*s*P*g*G*fnovxL:[-no]", TOYFLAG_USR|TOYFLAG_BIN))
USE_PIDOF(NEWTOY(pidof, "<1so:x", TOYFLAG_BIN))
USE_PING(NEWTOY(ping, "<1>1m#t#<0>255=64c#<0=3s#<0>4088=56i%W#<0=3w#<0qf46I:[-46]", TOYFLAG_USR|TOYFLAG_BIN))
@@ -201,7 +201,7 @@ USE_PRINTENV(NEWTOY(printenv, "0(null)", TOYFLAG_BIN))
USE_PRINTF(NEWTOY(printf, "<1?^", TOYFLAG_USR|TOYFLAG_BIN))
USE_ULIMIT(OLDTOY(prlimit, ulimit, TOYFLAG_USR|TOYFLAG_BIN))
USE_PS(NEWTOY(ps, "k(sort)*P(ppid)*aAdeflMno*O*p(pid)*s*t*Tu*U*g*G*wZ[!ol][+Ae][!oO]", TOYFLAG_BIN|TOYFLAG_LOCALE))
-USE_PWD(NEWTOY(pwd, ">0LP[-LP]", TOYFLAG_BIN))
+USE_PWD(NEWTOY(pwd, ">0LP[-LP]", TOYFLAG_BIN|TOYFLAG_MAYFORK))
USE_PWDX(NEWTOY(pwdx, "<1a", TOYFLAG_USR|TOYFLAG_BIN))
USE_READAHEAD(NEWTOY(readahead, NULL, TOYFLAG_BIN))
USE_READLINK(NEWTOY(readlink, "<1nqmef(canonicalize)[-mef]", TOYFLAG_USR|TOYFLAG_BIN))
@@ -222,8 +222,8 @@ USE_SENDEVENT(NEWTOY(sendevent, "<4>4", TOYFLAG_USR|TOYFLAG_SBIN))
USE_SEQ(NEWTOY(seq, "<1>3?f:s:w[!fw]", TOYFLAG_USR|TOYFLAG_BIN))
USE_SETENFORCE(NEWTOY(setenforce, "<1>1", TOYFLAG_USR|TOYFLAG_SBIN))
USE_SETFATTR(NEWTOY(setfattr, "hn:|v:x:|[!xv]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_SETSID(NEWTOY(setsid, "^<1t", TOYFLAG_USR|TOYFLAG_BIN))
-USE_SH(NEWTOY(sh, "c:i", TOYFLAG_BIN))
+USE_SETSID(NEWTOY(setsid, "^<1wcd[!dc]", TOYFLAG_USR|TOYFLAG_BIN))
+USE_SH(NEWTOY(sh, "(noediting)(noprofile)(norc)sc:i", TOYFLAG_BIN))
USE_SHA1SUM(NEWTOY(sha1sum, "bc(check)s(status)[!bc]", TOYFLAG_USR|TOYFLAG_BIN))
USE_TOYBOX_LIBCRYPTO(USE_SHA224SUM(OLDTOY(sha224sum, sha1sum, TOYFLAG_USR|TOYFLAG_BIN)))
USE_TOYBOX_LIBCRYPTO(USE_SHA256SUM(OLDTOY(sha256sum, sha1sum, TOYFLAG_USR|TOYFLAG_BIN)))
@@ -258,7 +258,7 @@ USE_TELNETD(NEWTOY(telnetd, "w#<0b:p#<0>65535=23f:l:FSKi[!wi]", TOYFLAG_USR|TOYF
USE_TEST(NEWTOY(test, 0, TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_NOHELP|TOYFLAG_MAYFORK))
USE_TFTP(NEWTOY(tftp, "<1b#<8>65464r:l:g|p|[!gp]", TOYFLAG_USR|TOYFLAG_BIN))
USE_TFTPD(NEWTOY(tftpd, "rcu:l", TOYFLAG_BIN))
-USE_TIME(NEWTOY(time, "<1^pv", TOYFLAG_USR|TOYFLAG_BIN))
+USE_TIME(NEWTOY(time, "<1^pv", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_MAYFORK))
USE_TIMEOUT(NEWTOY(timeout, "<2^(foreground)(preserve-status)vk:s(signal):", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_ARGFAIL(125)))
USE_TOP(NEWTOY(top, ">0O*" "Hk*o*p*u*s#<1d%<100=3000m#n#<1bq[!oO]", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LOCALE))
USE_TOUCH(NEWTOY(touch, "<1acd:fmr:t:h[!dtr]", TOYFLAG_BIN))
@@ -266,7 +266,7 @@ USE_SH(OLDTOY(toysh, sh, TOYFLAG_BIN))
USE_TR(NEWTOY(tr, "^>2<1Ccsd[+cC]", TOYFLAG_USR|TOYFLAG_BIN))
USE_TRACEROUTE(NEWTOY(traceroute, "<1>2i:f#<1>255=1z#<0>86400=0g*w#<0>86400=5t#<0>255=0s:q#<1>255=3p#<1>65535=33434m#<1>255=30rvndlIUF64", TOYFLAG_STAYROOT|TOYFLAG_USR|TOYFLAG_BIN))
USE_TRACEROUTE(OLDTOY(traceroute6,traceroute, TOYFLAG_STAYROOT|TOYFLAG_USR|TOYFLAG_BIN))
-USE_TRUE(NEWTOY(true, NULL, TOYFLAG_BIN|TOYFLAG_NOHELP))
+USE_TRUE(NEWTOY(true, NULL, TOYFLAG_BIN|TOYFLAG_NOHELP|TOYFLAG_MAYFORK))
USE_TRUNCATE(NEWTOY(truncate, "<1s:|c", TOYFLAG_USR|TOYFLAG_BIN))
USE_TTY(NEWTOY(tty, "s", TOYFLAG_USR|TOYFLAG_BIN))
USE_TUNCTL(NEWTOY(tunctl, "<1>1t|d|u:T[!td]", TOYFLAG_USR|TOYFLAG_BIN))