source: branches/minix3-book/kernel/system/do_endksig.c@ 26

Last change on this file since 26 was 4, checked in by Mattia Monga, 14 years ago

Importazione sorgenti libro

File size: 1.3 KB
RevLine 
[4]1/* The kernel call that is implemented in this file:
2 * m_type: SYS_ENDKSIG
3 *
4 * The parameters for this kernel call are:
5 * m2_i1: SIG_PROC # process for which PM is done
6 */
7
8#include "../system.h"
9#include <signal.h>
10#include <sys/sigcontext.h>
11
12#if USE_ENDKSIG
13
14/*===========================================================================*
15 * do_endksig *
16 *===========================================================================*/
17PUBLIC int do_endksig(m_ptr)
18message *m_ptr; /* pointer to request message */
19{
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.
23 */
24 register struct proc *rp;
25
26 /* Get process pointer and verify that it had signals pending. If the
27 * process is already dead its flags will be reset.
28 */
29 rp = proc_addr(m_ptr->SIG_PROC);
30 if (! (rp->p_rts_flags & SIG_PENDING)) return(EINVAL);
31
32 /* PM has finished one kernel signal. Perhaps process is ready now? */
33 if (! (rp->p_rts_flags & SIGNALED)) /* new signal arrived */
34 if ((rp->p_rts_flags &= ~SIG_PENDING)==0) /* remove pending flag */
35 lock_enqueue(rp); /* ready if no flags */
36 return(OK);
37}
38
39#endif /* USE_ENDKSIG */
40
Note: See TracBrowser for help on using the repository browser.