Remove building with NOCRYPTO option
[minix.git] / minix / lib / libc / sys / sigreturn.c
blobf81a0ad5ca0d697b97aee0d2ced79ce83b25e1a9
1 #include "namespace.h"
3 #include <sys/cdefs.h>
4 #include <lib.h>
6 #include <string.h>
7 #include <assert.h>
8 #include <signal.h>
9 #include <string.h>
10 #include <sys/signal.h>
11 #include <machine/signal.h>
13 int sigreturn(struct sigcontext *scp)
15 sigset_t set;
17 /* The message can't be on the stack, because the stack will vanish out
18 * from under us. The send part of ipc_sendrec will succeed, but when
19 * a message is sent to restart the current process, who knows what will
20 * be in the place formerly occupied by the message?
22 static message m;
24 /* Protect against race conditions by blocking all interrupts. */
25 sigfillset(&set); /* splhi */
26 sigprocmask(SIG_SETMASK, &set, NULL);
28 memset(&m, 0, sizeof(m));
29 m.m_lc_pm_sigset.set = scp->sc_mask;
30 m.m_lc_pm_sigset.ctx = (vir_bytes)scp;
31 return(_syscall(PM_PROC_NR, PM_SIGRETURN, &m)); /* normally doesn't return */