summaryrefslogtreecommitdiff
path: root/src/signal/sigwait.c
blob: 9569d6b0203a4162fcb16060b5770dbc448cfc31 (plain)
1
2
3
4
5
6
7
8
9
10
11
#include <signal.h>
#include <stddef.h>

int sigwait(const sigset_t *mask, int *sig)
{
	siginfo_t si;
	if (sigtimedwait(mask, &si, NULL) < 0)
		return -1;
	*sig = si.si_signo;
	return 0;
}