ash: optional sleep builtin

function                                             old     new   delta
sleepcmd                                               -      10     +10
builtintab                                           352     360      +8
.rodata                                           105264  105271      +7
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 2/0 up/down: 25/0)               Total: 25 bytes

Signed-off-by: Shawn Landden <shawnlandden@tutanota.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Shawn Landden 2022-08-27 19:56:21 +02:00 committed by Denys Vlasenko
parent d432049f28
commit 58598eb709
4 changed files with 19 additions and 0 deletions

View file

@ -134,6 +134,11 @@
//config: default y
//config: depends on SHELL_ASH
//config:
//config:config ASH_SLEEP
//config: bool "sleep builtin"
//config: default y
//config: depends on SHELL_ASH
//config:
//config:config ASH_HELP
//config: bool "help builtin"
//config: default y
@ -10155,6 +10160,9 @@ static int FAST_FUNC printfcmd(int argc, char **argv) { return printf_main(argc,
#if ENABLE_ASH_TEST || BASH_TEST2
static int FAST_FUNC testcmd(int argc, char **argv) { return test_main(argc, argv); }
#endif
#if ENABLE_ASH_SLEEP
static int FAST_FUNC sleepcmd(int argc, char **argv) { return sleep_main(argc, argv); }
#endif
/* Keep these in proper order since it is searched via bsearch() */
static const struct builtincmd builtintab[] = {
@ -10217,6 +10225,9 @@ static const struct builtincmd builtintab[] = {
{ BUILTIN_SPEC_REG "return" , returncmd },
{ BUILTIN_SPEC_REG "set" , setcmd },
{ BUILTIN_SPEC_REG "shift" , shiftcmd },
#if ENABLE_ASH_SLEEP
{ BUILTIN_REGULAR "sleep" , sleepcmd },
#endif
#if BASH_SOURCE
{ BUILTIN_SPEC_REG "source" , dotcmd },
#endif