This preview shows page 1. Sign up to view the full content.
Unformatted text preview: d SIGKILL, whose default actions cannot be changed.
#include <signal.h> typedef void handler t(int) handler t *signal(int signum, handler t *handler)
returns: ptr to previous handler if OK, SIG ERR on error (does not set errno) The signal function can change the action associated with a signal signum in one of three ways: ¯ ¯ ¯ If handler is SIG IGN, then signals of type signum are ignored. If handler is SIG DFL, then the action for signals of type signum reverts to the default action. Otherwise, handler is the address of a user-deﬁned function, called a signal handler, that will be called whenever the process receives a signal of type signum. Changing the default action by passing the address of a handler to the signal function is known as installing the handler. The invocation of the handler is called catching the signal. The execution of the handler is referred to as handling the signal. When a process catches a signal of type , the handler installed for signal is invoked with a single integer argument set to . This argument allows the same handler function to catch different types o...
View Full Document
This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.
- Spring '10
- The American