Chinaunix首页 | 论坛 | 博客
  • 博客访问: 69747
  • 博文数量: 13
  • 博客积分: 247
  • 博客等级: 二等列兵
  • 技术积分: 138
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-02 18:17
文章分类

全部博文(13)

文章存档

2015年(1)

2014年(1)

2013年(1)

2012年(2)

2011年(8)

我的朋友

分类: C/C++

2011-10-20 16:23:58

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) |
给主人留下些什么吧!~~

regansong2011-10-20 17:19:51

小松加油!