The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/kernel/system/do_endksig.c

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    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  *===========================================================================*/
   17 PUBLIC int do_endksig(m_ptr)
   18 message *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 

Cache object: 3d07b6ede42f9c5bfb04b296d825eeea


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.