Send a signal by Kill command
- To send a signal to a process other than current task.
- It has prototype :-
int kill(pid_t pid, int signo);
- It is included using header :-
- The system data type pid_t is defined in header :-
- signo is the signal number of signal to be send.
- pid is the PID of the process to which signal is to be send.
- pid can take value:-
* 0 –> To send signo signal to every process in invoking process’ process group
* -1 –>To send signo signal to every process for which invoking process has permission to send a signal, except itself and init
* n(<-1) –> All process in process group
* n(>0) –> process with PID n is signalled.
- This take an optional signal name or number and the PID to send the signal.
- For eg. To send ‘hangup’ signal to shell running on PID 1001, we use command :-
- killall is used to send signal to all the processes running.