xref: /haiku/src/system/libroot/posix/unistd/pause.c (revision ed24eb5ff12640d052171c6a7feba37fab8a75d1)
1 /*
2  * Copyright (c) 2005, Haiku Project. All rights reserved.
3  * Distributed under the terms of the MIT license.
4  *
5  * Author(s):
6  *		Jérôme Duval
7  */
8 
9 
10 #include <syscalls.h>
11 
12 #include <errno.h>
13 #include <pthread.h>
14 #include <signal.h>
15 
16 #include <errno_private.h>
17 
18 
19 int
20 pause(void)
21 {
22 	sigset_t mask;
23 	sigemptyset(&mask);
24 
25 	__set_errno(_kern_sigsuspend(&mask));
26 
27 	pthread_testcancel();
28 
29 	return -1;
30 }
31 
32