diff options
Diffstat (limited to 'reference/C/CONTRIB/OR_USING_C/08.6.c')
-rw-r--r-- | reference/C/CONTRIB/OR_USING_C/08.6.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/reference/C/CONTRIB/OR_USING_C/08.6.c b/reference/C/CONTRIB/OR_USING_C/08.6.c new file mode 100644 index 0000000..80ccd1e --- /dev/null +++ b/reference/C/CONTRIB/OR_USING_C/08.6.c @@ -0,0 +1,33 @@ +#include <signal.h> + +/* + * work, work, work, all I ever do is work! + */ +dowork() +{ +} + +main() +{ + int mask; + + /* + * Block SIGIO, which will indicate more + * work to be done. + */ + mask = sigmask(SIGIO); + + for (;;) { + /* + * Go do work. + */ + dowork(); + + /* + * Pause until we receive a signal. + * SIGIO is not blocked in mask. + */ + sigpause(mask); + } +} + |