Remove building with NOCRYPTO option
[minix.git] / minix / kernel / system / do_getksig.c
bloba8b5e7dc9c2c013314515b01aea0c0acbefdb281
1 /* The kernel call that is implemented in this file:
2 * m_type: SYS_GETKSIG
4 * The parameters for this kernel call are:
5 * m_sigcalls.endpt # process with pending signals
6 * m_sigcalls.map # bit map with pending signals
7 */
9 #include "kernel/system.h"
10 #include <signal.h>
11 #include <minix/endpoint.h>
13 #if USE_GETKSIG
15 /*===========================================================================*
16 * do_getksig *
17 *===========================================================================*/
18 int do_getksig(struct proc * caller, message * m_ptr)
20 /* The signal manager is ready to accept signals and repeatedly does a kernel
21 * call to get one. Find a process with pending signals. If no signals are
22 * available, return NONE in the process number field.
24 register struct proc *rp;
26 /* Find the next process with pending signals. */
27 for (rp = BEG_USER_ADDR; rp < END_PROC_ADDR; rp++) {
28 if (RTS_ISSET(rp, RTS_SIGNALED)) {
29 if (caller->p_endpoint != priv(rp)->s_sig_mgr) continue;
30 /* store signaled process' endpoint */
31 m_ptr->m_sigcalls.endpt = rp->p_endpoint;
32 m_ptr->m_sigcalls.map = rp->p_pending; /* pending signals map */
33 (void) sigemptyset(&rp->p_pending); /* clear map in the kernel */
34 RTS_UNSET(rp, RTS_SIGNALED); /* blocked by SIG_PENDING */
35 return(OK);
39 /* No process with pending signals was found. */
40 m_ptr->m_sigcalls.endpt = NONE;
41 return(OK);
43 #endif /* USE_GETKSIG */