xref: /haiku/src/system/libroot/posix/signal/sighold.cpp (revision 16d5c24e533eb14b7b8a99ee9f3ec9ba66335b1e)
1 /*
2  * Copyright 2007, Vasilis Kaoutsis, kaoutsis@sch.gr
3  * Distributed under the terms of the MIT License.
4  */
5 
6 
7 #include <signal.h>
8 
9 
10 int
11 sighold(int signal)
12 {
13 	// make an empty set
14 	// and add the signal
15 	sigset_t tempSignalSet;
16 	sigemptyset(&tempSignalSet);
17 	if (sigaddset(&tempSignalSet, signal) == -1)
18 		return -1;
19 
20 	// add the signal to the calling process' signal mask
21 	return sigprocmask(SIG_BLOCK, &tempSignalSet, NULL);
22 }
23