xref: /haiku/src/system/libroot/posix/signal/siginterrupt.cpp (revision d5ec3805236342ea7564aaa789c7f6fe62c0aaa6)
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 <syscalls.h>
10 
11 
12 extern "C" int
13 siginterrupt(int sig, int flag)
14 {
15 	struct sigaction action;
16 
17 	sigaction(sig, NULL, &action);
18 	if (flag)
19 		action.sa_flags &= ~SA_RESTART;
20 	else
21 		action.sa_flags |= SA_RESTART;
22 
23 	return sigaction(sig, &action, NULL);
24 }
25 
26