1 /* The kernel call that is implemented in this file:
4 * The parameters for this kernel call are:
5 * m_sigcalls.endpt # process to signal/ pending
6 * m_sigcalls.sig # signal number to send to process
9 #include "kernel/system.h"
14 /*===========================================================================*
16 *===========================================================================*/
17 int do_kill(struct proc
* caller
, message
* m_ptr
)
19 /* Handle sys_kill(). Cause a signal to be sent to a process. Any request
20 * is added to the map of pending signals and the signal manager
21 * associated to the process is informed about the new signal. The signal
22 * is then delivered using POSIX signal handlers for user processes, or
23 * translated into an IPC message for system services.
25 proc_nr_t proc_nr
, proc_nr_e
;
26 int sig_nr
= m_ptr
->m_sigcalls
.sig
;
28 proc_nr_e
= (proc_nr_t
)m_ptr
->m_sigcalls
.endpt
;
30 if (!isokendpt(proc_nr_e
, &proc_nr
)) return(EINVAL
);
31 if (sig_nr
>= _NSIG
) return(EINVAL
);
32 if (iskerneln(proc_nr
)) return(EPERM
);
34 /* Set pending signal to be processed by the signal manager. */
35 cause_sig(proc_nr
, sig_nr
);