xref: /haiku/src/system/libroot/posix/signal/siginterrupt.cpp (revision 5ac9b506412b11afb993bb52d161efe7666958a5)
1 /*
2  * Copyright 2009, Axel Dörfler, axeld@pinc-software.de. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 
7 #include <signal.h>
8 
9 #include <symbol_versioning.h>
10 
11 #include <signal_private.h>
12 
13 
14 int
15 __siginterrupt_beos(int signal, int flag)
16 {
17 	struct sigaction_beos action;
18 	__sigaction_beos(signal, NULL, &action);
19 	if (flag)
20 		action.sa_flags &= ~SA_RESTART;
21 	else
22 		action.sa_flags |= SA_RESTART;
23 
24 	return __sigaction_beos(signal, &action, NULL);
25 }
26 
27 
28 int
29 __siginterrupt(int signal, int flag)
30 {
31 	struct sigaction action;
32 	sigaction(signal, NULL, &action);
33 	if (flag)
34 		action.sa_flags &= ~SA_RESTART;
35 	else
36 		action.sa_flags |= SA_RESTART;
37 
38 	return sigaction(signal, &action, NULL);
39 }
40 
41 
42 DEFINE_LIBROOT_KERNEL_SYMBOL_VERSION("__siginterrupt_beos", "siginterrupt@",
43 	"BASE");
44 
45 DEFINE_LIBROOT_KERNEL_SYMBOL_VERSION("__siginterrupt", "siginterrupt@@",
46 	"1_ALPHA4");
47