correct references to manpage section 9 to 1x.
[minix3.git] / kernel / system / do_endksig.c
blob1e62dc05b91f38a5990a249f2ac70b543d3ab499
1 /* The kernel call that is implemented in this file:
2 * m_type: SYS_ENDKSIG
4 * The parameters for this kernel call are:
5 * m2_i1: SIG_ENDPT # process for which PM is done
6 */
8 #include "../system.h"
9 #include <signal.h>
10 #include <sys/sigcontext.h>
12 #if USE_ENDKSIG
14 /*===========================================================================*
15 * do_endksig *
16 *===========================================================================*/
17 PUBLIC int do_endksig(m_ptr)
18 message *m_ptr; /* pointer to request message */
20 /* Finish up after a kernel type signal, caused by a SYS_KILL message or a
21 * call to cause_sig by a task. This is called by the PM after processing a
22 * signal it got with SYS_GETKSIG.
24 register struct proc *rp;
25 int proc;
27 /* Get process pointer and verify that it had signals pending. If the
28 * process is already dead its flags will be reset.
30 if(!isokendpt(m_ptr->SIG_ENDPT, &proc))
31 return EINVAL;
33 rp = proc_addr(proc);
34 if (!RTS_ISSET(rp, SIG_PENDING)) return(EINVAL);
36 /* PM has finished one kernel signal. Perhaps process is ready now? */
37 if (!RTS_ISSET(rp, SIGNALED)) /* new signal arrived */
38 RTS_LOCK_UNSET(rp, SIG_PENDING); /* remove pending flag */
39 return(OK);
42 #endif /* USE_ENDKSIG */