blob: c8822eea49837bfc732ca38a330af89bc8582288 [file] [log] [blame]
Rich Felker0b44a032011-02-12 00:22:29 -05001#include <signal.h>
Rich Felker0b44a032011-02-12 00:22:29 -05002
Rich Felker400c5e52012-09-06 22:44:55 -04003int sigwait(const sigset_t *restrict mask, int *restrict sig)
Rich Felker0b44a032011-02-12 00:22:29 -05004{
5 siginfo_t si;
Rich Felkera7dbcf52013-12-13 02:20:07 -05006 if (sigtimedwait(mask, &si, 0) < 0)
Rich Felker0b44a032011-02-12 00:22:29 -05007 return -1;
8 *sig = si.si_signo;
9 return 0;
10}