Signal
来源:互联网 发布:淘宝质检报告处罚 编辑:程序博客网 时间:2024/05/01 23:47
A signal is an event generated by the UNIX and Linux systems in response to some condition, upon receipt of which a process may in turn take some action. We use the term raise to indicate the generation of a signal, and the term catch to indicate the receipt of a signal. Signals are raised by some error conditions, such as memory segment violations, floating-point processor errors, or illegal instructions. They are generated by the shell and terminal handlers to cause interrupts and can also be explicitly sent from one process to another as a way of passing information or modifying behavior. In all these cases, the programming interface is the same. Signals can be raised, caught and acted upon, or(for some at least) ignoreed.
Signal names are defined by including the header file signal.h. They all begin with SIG.
Programs can handle signals using the signal library function:
The signal to be caught or ignored is given as argument sig. The function to be called when the specified signal is received is given as func. The signal function itself returns a function of the same type, which is the previous value of the function set up to handle this signal, or one of these two special values:
SIG_IGN:Ignore the signal; SIG_DFL:Restore default behavior.
Sending Signals:
A process may send a signal to another process, including itself, by calling kill. The call will fail if the program doesn't have permission to send the signal, often because the target process is owned by another user. This is the program equivalent of the shell command of the same name.
A Robust Signals Interface:
The sigaction structure, used to define the actions to be taken on receipt of the signal specified by sig, is defined in signal.h and has at least the following members:
The header file signal.h defines the type sigset_t and functions used to manipulate sets of signals.
- signal
- signal
- Signal
- signal
- signal
- signal
- signal
- signal
- signal()
- signal
- signal
- signal
- signal
- Signal
- signal
- signal
- signal
- signal
- PHP学习建议
- C语言中返回字符串函数的四种实现方法
- 程序员面试题精选100题(07)-翻转句子中单词的顺序
- Javascript浏览器内核感知,非userAgent,准确率极高;
- 关于Java中生成输入的Robot类用法总结
- Signal
- 12/29/2010 geek日志@Android
- php之samrty模板配置
- Flex视频聊天踢人问题
- 【读书笔记】人生使用说明书
- csdn的mySQL数据库出了点问题
- web编程之html篇(框架)
- /LGC物理引擎/彻底解放CPU的物理卡深入剖析
- /LGC物理引擎/Android port of Box2d