about summary refs log tree commit diff
path: root/src/signal/sigwait.c
blob: 48a855bb0a25136caf691775fde1e29c23806d4e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
#include <signal.h>
#include <stddef.h>

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