previous | start | next

Sending Signals to a Process Group

The kill function can send a signal to a process or to a process group.

Example

If a process has pid 1400 and is the leader of a group

Signals can easily be sent to a whole process group.

             int kill(pid_t pid, int sig);
   

If pid is positive, then signal sig is sent only to the process with pid.

If pid equals 0, then sig is sent to every process in the process group of the current process.

If pid is less than -1, then sig is sent to every process in the process group -pid.



previous | start | next