UNIX Signals and Process Groups

0 views
Skip to first unread message

elsiddik

unread,
Dec 16, 2007, 6:20:43 AM12/16/07
to unix
Traditional System-V inherited its signal-handling environment from V7
research UNIX. This environment has three major limitations:

* Recursive signal handling is always allowed.
* Signal handlers are reset to SIG_DFL prior to being called.
* System calls interrupt when a signal is delivered.

These limitations cause "unreliable" signal behavior: Since signals
can be delivered recursively and the signal handler must manually
reset the signal handler from SIG_DFL, there is a window during which
the default signal handler can be called if another signal of the same
type arrives. In many cases the default action is to ignore the
signal, causing the signal to be lost. In the worst case the default
action is to terminate the process.

Additionally any signal can interrupt a system call. The window for
interrupting a system call is fairly small for most system calls (and
impossible for some) but large for some common "slow" system calls
such as read() or write(). Few applications attempt to restart system
calls that have been interrupted by a signal. This results in even
more unreliability.

The interface to the traditional signal handling environment is:

int (*signal)(int signal_number, int (*function)(int));

Change the signal handler for the indicated signal. Signal_number
indicates which signal, function is the new handler.

int pause(void);

Wait for a signal to arrive.

Two standard signal handlers exist:

SIG_DFL
Take the default action for this signal.

SIG_IGN
Ignore this signal.


Read more >> http://www.cs.ucsb.edu/~almeroth/classes/W99.276/assignment1/signals.html



zaher el siddik
http://www.unixshells.nl/
http://elsiddik.blogspot.com/
Reply all
Reply to author
Forward
0 new messages