This is rather a beginner question. I wonder what happens when sleep
command is triggered from a bash script, for example. That job would still running, with less priority?
This is rather a beginner question. I wonder what happens when sleep
command is triggered from a bash script, for example. That job would still running, with less priority?
Typically,
sleep
is the GNUsleep
program. This program calls the GNU functionxnanosleep
, which in turn calls the Linuxnanosleep
system call. And:So the process is, by definition, not running (whatever maybe the priority), but suspended.
Testing this out:
The process state is
SN
:Ignore the
N
, I'd guess that's how it was when it started out. So the effective state ofsleep
isinterruptible sleep
.