xref: /haiku/src/system/libroot/posix/signal/sigsuspend.cpp (revision 25a7b01d15612846f332751841da3579db313082)
1 /*
2  * Copyright 2005-2011, Haiku, Inc. All rights reserved.
3  * Distributed under the terms of the MIT license.
4  *
5  * Author(s):
6  *		Jérôme Duval
7  *		Ingo Weinhold, ingo_weinhold@gmx.de
8  */
9 
10 
11 #include <signal.h>
12 
13 #include <errno.h>
14 #include <pthread.h>
15 
16 #include <syscall_utils.h>
17 
18 #include <symbol_versioning.h>
19 #include <syscalls.h>
20 
21 #include <errno_private.h>
22 #include <signal_private.h>
23 
24 
25 int
__sigsuspend_beos(const sigset_t_beos * beosMask)26 __sigsuspend_beos(const sigset_t_beos* beosMask)
27 {
28 	sigset_t mask = from_beos_sigset(*beosMask);
29 	return __sigsuspend(&mask);
30 }
31 
32 
33 int
__sigsuspend(const sigset_t * mask)34 __sigsuspend(const sigset_t* mask)
35 {
36 	__set_errno(_kern_sigsuspend(mask));
37 
38 	pthread_testcancel();
39 
40 	return -1;
41 }
42 
43 
44 DEFINE_LIBROOT_KERNEL_SYMBOL_VERSION("__sigsuspend_beos", "sigsuspend@",
45 	"BASE");
46 
47 DEFINE_LIBROOT_KERNEL_SYMBOL_VERSION("__sigsuspend", "sigsuspend@@",
48 	"1_ALPHA4");
49