summaryrefslogtreecommitdiff
path: root/lib/libc/gen/pause.c
blob: 4db649bb4b0d39004efd15c17563183e10ea706f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*	$OpenBSD: pause.c,v 1.5 2004/05/18 02:05:52 jfb Exp $	*/

/*
 * Written by Todd C. Miller <Todd.Miller@courtesan.com>
 * Public domain.
 */

#if defined(LIBC_SCCS) && !defined(lint)
static const char rcsid[] = "$OpenBSD: pause.c,v 1.5 2004/05/18 02:05:52 jfb Exp $";
#endif /* LIBC_SCCS and not lint */

#include <signal.h>
#include <unistd.h>

/*
 * Backwards compatible pause(3).
 */
int
pause(void)
{
	sigset_t mask;

	return (sigprocmask(SIG_BLOCK, NULL, &mask) ? -1 : sigsuspend(&mask));
}