minix/lib/libc/sys-minix/sigprocmask.c
Ben Gras 8ccb12bb5a use netbsd <sys/signal.h> and sigset_t
. create signals-related struct message type to store sigset_t
	  directly
	. create notify-specific message types, so the generic NOTIFY_ARG
	  doesn't exist anymore
	. various related test expansions, improvements, fixes
	. add a few error-checks to sigismember() calls
	. rename kernel call specific signals fields to SYS_*

Change-Id: I53c18999b5eaf0cfa0cb25f5330bee9e7ad2b478
2014-03-02 12:28:31 +01:00

34 lines
686 B
C

#include <sys/cdefs.h>
#include <sys/signal.h>
#include <sys/sigtypes.h>
#include <lib.h>
#include <string.h>
#include "namespace.h"
#include <string.h>
#include <signal.h>
int sigprocmask(how, set, oset)
int how;
const sigset_t *set;
sigset_t *oset;
{
message m;
memset(&m, 0, sizeof(m));
if (set == (sigset_t *) NULL) {
m.PM_SIG_HOW = SIG_INQUIRE;
sigemptyset(&m.PM_SIG_SET);
} else {
m.PM_SIG_HOW = how;
m.PM_SIG_SET = *set;
}
if (_syscall(PM_PROC_NR, PM_SIGPROCMASK, &m) < 0) return(-1);
if (oset != (sigset_t *) NULL) *oset = m.PM_SIG_SET;
return(m.m_type);
}
#if defined(__minix) && defined(__weak_alias)
__weak_alias(sigprocmask, __sigprocmask14)
#endif