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