加入收藏 | 设为首页 | 会员中心 | 我要投稿 威海站长网 (https://www.0631zz.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 服务器 > 搭建环境 > Linux > 正文

Signal Handling--ref

发布时间:2021-01-25 08:01:09 所属栏目:Linux 来源:网络整理
导读:signal is a software interrupt delivered to a process. The operating system uses signals to report exceptional situations to an executing program. Some signals report errors such as references to invalid memory addresses; others report asy

intSIGTTOU
This is similar toSIGTTIN,but is generated when a process in a background job attempts to write to the terminal or set its modes. Again,the default action is to stop the process.SIGTTOUis only generated for an attempt to write to the terminal if theTOSTOPoutput mode is set; see section.

SIGKILLsignals and (obviously)SIGCONTsignals. The signals are marked as pending,but not delivered until the process is continued. TheSIGKILLsignal always causes termination of the process and can't be blocked,handled or ignored. You can ignoreSIGCONT,but it always causes the process to be continued anyway if it is stopped. Sending aSIGCONTsignal to a process causes any pending stop signals for that process to be discarded. Likewise,any pendingSIGCONTsignals for a process are discarded when it receives a stop signal.

SIGTSTP,SIGTTIN,orSIGTTOUsignal and does not handle it,the process does not stop. Stopping the process would probably not be very useful,since there is no shell program that will notice it stop and allow the user to continue it. What happens instead depends on the operating system you are using. Some systems may do nothing; others may deliver another signal instead,such asSIGKILLorSIGHUP. In the GNU system,the process dies withSIGKILL; this avoids the problem of many stopped,orphaned processes lying around the system.

intSIGPIPE
Broken pipe. If you use pipes or FIFOs,you have to design your application so that one process opens the pipe for reading before another starts writing. If the reading process never starts,or terminates unexpectedly,writing to the pipe or FIFO raises aSIGPIPEsignal. IfSIGPIPEis blocked,handled or ignored,the offending call fails withEPIPEinstead.

Pipes and FIFO special files are discussed in more detail in section.

Another cause ofSIGPIPEis when you try to output to a socket that isn't connected. See section.

intSIGLOST
Resource lost. This signal is generated when you have an advisory lock on an NFS file,and the NFS server reboots and forgets about your lock.

(编辑:威海站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

热点阅读