xref: /openbsd-src/lib/libc/gen/pause.c (revision db3296cf5c1dd9058ceecc3a29fe4aaa0bd26000)
1 /*	$OpenBSD: pause.c,v 1.4 2003/06/25 21:15:04 deraadt Exp $	*/
2 
3 /*
4  * Written by Todd C. Miller <Todd.Miller@courtesan.com>
5  * Public domain.
6  */
7 
8 #if defined(LIBC_SCCS) && !defined(lint)
9 static const char rcsid[] = "$OpenBSD: pause.c,v 1.4 2003/06/25 21:15:04 deraadt Exp $";
10 #endif /* LIBC_SCCS and not lint */
11 
12 #include <signal.h>
13 #include <unistd.h>
14 
15 /*
16  * Backwards compatible pause(3).
17  */
18 int
19 pause()
20 {
21 	sigset_t mask;
22 
23 	return (sigprocmask(SIG_BLOCK, NULL, &mask) ? -1 : sigsuspend(&mask));
24 }
25