1.Signal Concepts
Signals are software interrupts,which can be generated by following kind of conditions:
a.The terminal-generated signals occur when users press certain terminal keys
(ctrl + C | delete:SIGINT)
b.Hardware exceptions generate signals(devide by 0,invalid memory reference,SIGSEGV)
c.calling kill function allows a process to send any signal to another process or process group
d.kill command provides interface to the kill function.
e.Software conditions can generate signals when something happens about which the process should be notified.(SIGURG:out-of-band data arrives over a network connection;SIGPIPE:generatd when a process writes to a pipe after the reader of the pipe has terminated;SIGALRM:generated when an alram clock set by the process expires)
2.Signal Handling
disposition of the signal or the action associated with the signal:
a.Ignore the signal.(SIG_ING)
b.catch the signal.(signal handler installed by calling sigaction or signal function)
c.apply default action for the signal.
***SIGKILL and SIGSTOP can never be caught or ignored ****
***default action for most signals is terminate the process ***
3.List of signals
SIGABRT abnormal termination(abort)
SIGALRM time expired(alarm)
SIGBUS hardware fault
SIGCANCEL thread library internal use
SIGCHLD change in status of child(stopped,continued,termination)
SIGCONT continue stopped process
SIGEMT hardware fault
SIGFPE arithmetic exception
SIGFREEZE checkpoint freeze
SIGHUP hangup
SIGILL illegal instruction
SIGINFO status request from keyboard
SIGINT terminal interrupt character
SIGIO asynchronous I/O
SIGIOT hardware fault
SIGKILL termination
SIGLWP thread library internal use
SIGPIPE write to a pipe with no reader
SIGPOLL pollable event(poll)
SIGPROF profiling time alarm(settimer)
SIGPWR power fail/restart
SIGQUIT terminal quit character(Ctrl + \)
SIGSEGV invalid memory reference
SIGSTKFLT coprocessor stack fault
SIGSTOP stop
SIGSYS invalid system call
SIGTERM termination
SIGTHAW checkpoint thaw
SIGTRAP hardware fault
SIGTSTP terminal stop character
SIGTTIN background read from control tty
SIGTTOU background write to control tty
SIGURG urgent conditions(sockets)
SIGUSR1 user-defined signals
SIGUSR2 user-defined signals
SIGVTALRM virtual time alarm(settimer)
SIGWAITING thread library internal use ignore
SIGWINCH terminal window size change ignore
SIGXCPU CPU limit exceeded
SIGXFSZ file size limit exceeded
SIGXRES resource control exceeded ignore
阅读(1709) | 评论(1) | 转发(0) |