xref: /openbsd-src/lib/libc/gen/pause.c (revision 8445c53715e7030056b779e8ab40efb7820981f2)
1 /*	$OpenBSD: pause.c,v 1.3 2001/09/04 23:35:58 millert 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.3 2001/09/04 23:35:58 millert Exp $";
10 #endif /* LIBC_SCCS and not lint */
11 
12 #include <signal.h>
13 
14 /*
15  * Backwards compatible pause(3).
16  */
17 int
18 pause()
19 {
20 	sigset_t mask;
21 
22 	return (sigprocmask(SIG_BLOCK, NULL, &mask) ? -1 : sigsuspend(&mask));
23 }
24