Sleep endlessly

I was wondering if there is an instruction that I can use to have sleep mode indefinitely (perhaps using the sleep function?). (I, obviously, am doing this, waiting for a signal to be delivered at some point to this process, and it will wake it)

+3
source share
3 answers

You want pause () .

EDIT: The most likely circumstances under which you can use pause() will really cause a race condition , so prefer sigsuspend().

+5
source

On Unix, see pauseor sigsuspend.

+3
source

And on Windows use Sleep (INFINITE)

+1
source

All Articles