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

int sigpause(int sig)
{
	sigset_t mask;

	if (sigprocmask(0, NULL, &mask) < 0 || sigdelset(&mask, sig) < 0)
		return -1;
	return sigsuspend(&mask);
}