headers/bsd: Add sys/queue.h.
[haiku.git] / src / system / libroot / posix / signal / sigpause.cpp
blobc87b70123507cf70ff82c01f9c8dc8ca3922fe5b
1 /*
2 * Copyright 2008, Vasilis Kaoutsis, kaoutsis@sch.gr
3 * Distributed under the terms of the MIT License.
4 */
7 #include <signal.h>
9 #include <symbol_versioning.h>
11 #include <signal_private.h>
14 int
15 __sigpause_beos(int signal)
17 sigset_t_beos processSignalSet;
18 if (__pthread_sigmask_beos(SIG_SETMASK, NULL, &processSignalSet) == -1)
19 return -1;
21 if (__sigdelset_beos(&processSignalSet, signal) == -1)
22 return -1;
24 return __sigsuspend_beos(&processSignalSet);
28 int
29 __sigpause(int signal)
31 sigset_t processSignalSet;
32 if (sigprocmask(SIG_SETMASK, NULL, &processSignalSet) == -1)
33 return -1;
35 if (sigdelset(&processSignalSet, signal) == -1)
36 return -1;
38 return sigsuspend(&processSignalSet);
42 DEFINE_LIBROOT_KERNEL_SYMBOL_VERSION("__sigpause_beos", "sigpause@", "BASE");
44 DEFINE_LIBROOT_KERNEL_SYMBOL_VERSION("__sigpause", "sigpause@@", "1_ALPHA4");