|CS 321 Spring 2013 > Lecture Notes for Friday, February 15, 2013|
Simple message-passing mechanism. A traditional part of C library under *ix OSs. Very little information is sent—only the signal itself. By default, asynchronous, handler function executed using standard process stack.
A handler function takes an
int (the signal)
Set up a handler by calling system call
passing the signal name and a pointer to the handler function.
Signals are sent by
kill system call.
Also a program named
kill can be used on the command line.
Here are some of the more common signals. There are many others, most of which are rarely used. The default response is what happens to the process receiving the signal if it has not set up a handler function.
|Signal||Traditionally Sent By||Can Be Handled||Default Response|
||No||Wake if suspended; otherwise ignore|
for a program that sets up a signal handler.
The alarm signal (
most often used by a process to signal itself.
The signal is sent after some fixed amount of time has elapsed.
for a program that uses