minix/kernel/system/do_endksig.c
Jorrit Herder 42ab148155 Reorganized system call library; uses separate file per call now.
New configuration header file to include/ exclude functionality.
Extracted privileged features from struct proc and create new struct priv.
Renamed various system calls for readability.
2005-07-14 15:12:12 +00:00

49 lines
1.8 KiB
C

/* The system call that is implemented in this file:
* SYS_SIGCTL # signal handling functionality
*
* The parameters and types for this system call are:
* SIG_REQUEST # request to perform (long)
* SIG_PROC # process to signal/ pending (int)
* SIG_CTXT_PTR # pointer to sigcontext structure (pointer)
* SIG_FLAGS # flags for S_SIGRETURN call (int)
* SIG_MAP # bit map with pending signals (long)
* SIG_NUMBER # signal number to send to process (int)
*
* Supported request types are in the parameter SIG_REQUEST:
* S_GETSIG # get a pending kernel signal
* S_ENDSIG # signal has been processed
* S_SENDSIG # deliver a POSIX-style signal
* S_SIGRETURN # return from a POSIX-style signal
* S_KILL # send a signal to a process
*/
#include "../system.h"
#include <signal.h>
#include <sys/sigcontext.h>
#if USE_ENDKSIG
/*===========================================================================*
* do_endksig *
*===========================================================================*/
PUBLIC int do_endksig(m_ptr)
message *m_ptr; /* pointer to request message */
{
/* Finish up after a kernel type signal, caused by a SYS_KILL message or a
* call to cause_sig by a task. This is called by the PM after processing a
* signal it got with SYS_GETKSIG.
*/
register struct proc *rp;
rp = proc_addr(m_ptr->SIG_PROC);
if (isemptyp(rp)) return(EINVAL); /* process already dead? */
/* PM has finished one kernel signal. Perhaps process is ready now? */
if (! (rp->p_rts_flags & SIGNALED)) /* new signal arrived */
if ((rp->p_rts_flags &= ~SIG_PENDING)==0) /* remove pending flag */
lock_ready(rp); /* ready if no flags */
return(OK);
}
#endif /* USE_ENDKSIG */