xref: /minix3/minix/lib/libc/sys/sigprocmask.c (revision 433d6423c39e34ec4b79c950597bb2d236f886be)
1*433d6423SLionel Sambuc #include <sys/cdefs.h>
2*433d6423SLionel Sambuc #include <sys/types.h>
3*433d6423SLionel Sambuc #include <sys/sigtypes.h>
4*433d6423SLionel Sambuc #include <sys/signal.h>
5*433d6423SLionel Sambuc #include <lib.h>
6*433d6423SLionel Sambuc #include <string.h>
7*433d6423SLionel Sambuc #include "namespace.h"
8*433d6423SLionel Sambuc 
9*433d6423SLionel Sambuc #include <string.h>
10*433d6423SLionel Sambuc #include <signal.h>
11*433d6423SLionel Sambuc 
sigprocmask(how,set,oset)12*433d6423SLionel Sambuc int sigprocmask(how, set, oset)
13*433d6423SLionel Sambuc int how;
14*433d6423SLionel Sambuc const sigset_t *set;
15*433d6423SLionel Sambuc sigset_t *oset;
16*433d6423SLionel Sambuc {
17*433d6423SLionel Sambuc   message m;
18*433d6423SLionel Sambuc 
19*433d6423SLionel Sambuc   memset(&m, 0, sizeof(m));
20*433d6423SLionel Sambuc   if (set == (sigset_t *) NULL) {
21*433d6423SLionel Sambuc 	m.m_lc_pm_sigset.how = SIG_INQUIRE;
22*433d6423SLionel Sambuc 	sigemptyset(&m.m_lc_pm_sigset.set);
23*433d6423SLionel Sambuc   } else {
24*433d6423SLionel Sambuc 	m.m_lc_pm_sigset.how = how;
25*433d6423SLionel Sambuc 	m.m_lc_pm_sigset.set = *set;
26*433d6423SLionel Sambuc   }
27*433d6423SLionel Sambuc   if (_syscall(PM_PROC_NR, PM_SIGPROCMASK, &m) < 0) return(-1);
28*433d6423SLionel Sambuc   if (oset != NULL) *oset = m.m_pm_lc_sigset.set;
29*433d6423SLionel Sambuc 
30*433d6423SLionel Sambuc   return(m.m_type);
31*433d6423SLionel Sambuc }
32*433d6423SLionel Sambuc 
33*433d6423SLionel Sambuc #if defined(__minix) && defined(__weak_alias)
34*433d6423SLionel Sambuc __weak_alias(sigprocmask, __sigprocmask14)
35*433d6423SLionel Sambuc #endif
36