![]() |
![]() |
kill
and raise
System FunctionsThe left arrow above will return you to
the Home page
The left arrows below will return you to the Previous
page
![]() | ![]() | ![]() |
The kill function send a signal to a process or a group of processes. The raise function allows a process to send a signal to itself.
#include <sys/types.h> #include <signal.h> int kill(pid_t pid, int signo); int raise(int signo); Both returns: 0 if OK, -1 on error |
There are four different conditions for the pid argument to kill:
pid > 0 The signal is sent to the process whose process ID is pid pid == 0 The signal is sent to all processes whose process group ID equals the process group ID of the sender and for which the sender has permission to send the signal. pid < 0 The signal is sent to all processes whose process group ID equals the absolute value of pid and for which the sender has permission to send the signal. pid == -1 POSIX leaves this condition as unspecified The list of some of the often used signals is given in the discussion of signals in the C Run Time Library and below:
#include <signal.h>
This list is not encyclopaedic. See Stallings for a more complete list. |
The descriptions of the system functions above are drawn from sources that include
man
uals on the Sun Solaris system and the MAC OS X Darwin/BDS system, and also from 'Advanced Programming in the UNIX Environment', W. Richard Stevens, Addison-Wesley, 1993.
![]() | ![]() | ![]() |
For use only by students and instructors using the supplementary material available with the text book: "Operating Systems - Internals and Design Principles", William Stallings, Prentice Hall, 5th Edition, 2004. Not to be printed out or copied by any other persons or used for any other purpose without written permission of the author(s).
©