Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 1 | #include <signal.h> |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 2 | |
Rich Felker | 400c5e5 | 2012-09-06 22:44:55 -0400 | [diff] [blame] | 3 | int sigwait(const sigset_t *restrict mask, int *restrict sig) |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 4 | { |
5 | siginfo_t si; | ||||
Rich Felker | a7dbcf5 | 2013-12-13 02:20:07 -0500 | [diff] [blame] | 6 | if (sigtimedwait(mask, &si, 0) < 0) |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 7 | return -1; |
8 | *sig = si.si_signo; | ||||
9 | return 0; | ||||
10 | } |