APUE says about sleep()
This function
sleep()
causes the calling process to be suspended until either
- The amount of wall clock time specified by seconds has elapsed.
- A signal is caught by the process and the signal handler returns.
Does the first case work by sending some specific signal to the process itself? If yes, what is the signal?
alarm()
can send signal SIGALARM
to the calling process after a specific time period, which is why I wonder if sleep()
work in the same way.
Does sleep()
change the state of the calling process to the same state as sigsuspend()
changes to? Which process state(s) do the two functions change to?
Is it correct that a suspended process can only be waken by a signal? That is the reason why I have the question.
Thanks.