summaryrefslogtreecommitdiff
path: root/lib/libc/gen/pause.c
blob: 7624e982cfadaf0ed67aa16abb17fa9eca3f7bab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*	$OpenBSD: pause.c,v 1.7 2019/01/25 00:19:25 millert Exp $	*/

/*
 * Written by Todd C. Miller <millert@openbsd.org>
 * Public domain.
 */

#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));
}