1 /* 2 * Copyright 2006, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Axel Dörfler, axeld@pinc-software.de 7 */ 8 9 10 #include <signal.h> 11 12 13 int 14 sigsetmask(int mask) 15 { 16 sigset_t set = mask; 17 sigset_t oset; 18 19 if (sigprocmask(SIG_SETMASK, &set, &oset) < 0) 20 return -1; 21 22 return (int)oset; 23 } 24 25 26 int 27 sigblock(int mask) 28 { 29 sigset_t set = mask; 30 sigset_t oset; 31 32 if (sigprocmask(SIG_BLOCK, &set, &oset) < 0) 33 return -1; 34 35 return (int)oset; 36 } 37 38