ash builtin sleep behavior

Ron Yorston rmy at pobox.com
Sat Jul 22 07:33:08 UTC 2023


Igor,

There have been a number of problems with the sleep built-in.

It was recently disabled by this commit:

   https://git.busybox.net/busybox/commit/?id=5e0411a7fb510b9aecda0a850c76bdd62c50efa4

>ash: disable sleep as builtin, closes 15619
>Has a few annoying problems:
>* sleepcmd() -> sleep_main(), the parsing of bad arguments exits the shell.
>* sleep_for_duration() in sleep_main() has to be interruptible for
>  ^C traps to work, which may be a problem for other users
>  of sleep_for_duration().
>* BUT, if sleep_for_duration() is interruptible, then SIGCHLD interrupts it
>  as well (try "/bin/sleep 1 & sleep 10").
>* sleep_main() must not allocate anything as ^C in ash longjmp's.
>  (currently, allocations are only on error paths, in message printing).

Cheers,

Ron


More information about the busybox mailing list