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_getksig.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_GETKSIG
    3  *
    4  * The parameters for this kernel call are:
    5  *     m2_i1:   SIG_PROC        # process with pending signals
    6  *     m2_l1:   SIG_MAP         # bit map with pending signals
    7  */
    8 
    9 #include "../system.h"
   10 #include <signal.h>
   11 #include <sys/sigcontext.h>
   12 
   13 #if USE_GETKSIG
   14 
   15 /*===========================================================================*
   16  *                            do_getksig                                     *
   17  *===========================================================================*/
   18 PUBLIC int do_getksig(m_ptr)
   19 message *m_ptr;                 /* pointer to request message */
   20 {
   21 /* PM is ready to accept signals and repeatedly does a kernel call to get 
   22  * one. Find a process with pending signals. If no signals are available, 
   23  * return NONE in the process number field.
   24  * It is not sufficient to ready the process when PM is informed, because 
   25  * PM can block waiting for FS to do a core dump.
   26  */
   27   register struct proc *rp;
   28 
   29   /* Find the next process with pending signals. */
   30   for (rp = BEG_USER_ADDR; rp < END_PROC_ADDR; rp++) {
   31       if (rp->p_rts_flags & SIGNALED) {
   32           m_ptr->SIG_PROC = rp->p_nr;           /* store signaled process */
   33           m_ptr->SIG_MAP = rp->p_pending;       /* pending signals map */
   34           sigemptyset(&rp->p_pending);          /* ball is in PM's court */
   35           rp->p_rts_flags &= ~SIGNALED;         /* blocked by SIG_PENDING */
   36           return(OK);
   37       }
   38   }
   39 
   40   /* No process with pending signals was found. */
   41   m_ptr->SIG_PROC = NONE; 
   42   return(OK);
   43 }
   44 #endif /* USE_GETKSIG */
   45 

Cache object: 84fe6af9b7433adb87d9bbeb775e4c78


[ 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.