xref: /haiku/src/system/libroot/posix/signal/sigpause.cpp (revision d46a010c43680f56495b4d8afaf3f7d357f9c5ac)
1 /*
2  * Copyright 2008, 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 sigpause(int signal)
12 {
13 	sigset_t processSignalSet;
14 
15 	if (sigprocmask(SIG_SETMASK, NULL, &processSignalSet) == -1)
16 		return -1;
17 
18 	if (sigdelset(&processSignalSet, signal) == -1)
19 		return -1;
20 
21 	return sigsuspend(&processSignalSet);
22 }
23