libc, libutil: remove compat hacks
[minix.git] / lib / libc / sys-minix / sigreturn.c
blobd80cca99189bf3486cd51a9a2820d1cda935ed92
1 #include <sys/cdefs.h>
2 #include <lib.h>
3 #include "namespace.h"
5 #include <signal.h>
6 #include <sys/signal.h>
8 #ifdef __weak_alias
9 __weak_alias(sigreturn, _sigreturn)
10 #endif
12 int sigreturn(scp)
13 register 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 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, (sigset_t *) NULL);
28 m.m2_l1 = scp->sc_mask;
29 m.m2_i2 = scp->sc_flags;
30 m.m2_p1 = (char *) scp;
31 return(_syscall(PM_PROC_NR, SIGRETURN, &m)); /* normally this doesn't return */