📄 signal.2
字号:
.th SIGNAL II 8/5/73.sh NAMEsignal \*- catch or ignore signals.sh SYNOPSIS(signal = 48.).br.ft Bsys signal; sig; label.ft R.br(old value in r0).s3.ft Bsignal(sig, func).brint (*func)( );.ft R.sh DESCRIPTIONA.it signalis generated by some abnormal event,initiated either by user at a typewriter (quit, interrupt),by a program error (bus error, etc.),or by request of another program (kill).Normally all signalscause termination of the receiving process,but this call allows them either to be ignoredor to cause an interrupt to a specified location.Here is the list of signals:.s3.lp +10 51 hangup.lp +10 52 interrupt.lp +10 53* quit.lp +10 54* illegal instruction (not reset when caught).lp +10 55* trace trap (not reset when caught).lp +10 56* IOT instruction.lp +10 57* EMT instruction.lp +10 58* floating point exception.lp +10 59 kill (cannot be caught or ignored).lp +10 510* bus error.lp +10 511* segmentation violation.lp +10 512* bad argument to system call.lp +10 513 write on a pipe with no one to read it.s3.i0In the assembler call, if.it labelis 0,the process is terminatedwhen the signal occurs; this is the default action.If.it labelis odd, the signal is ignored.Any other even.it labelspecifies an address in the processwhere an interrupt is simulated.An RTI or RTT instruction will return from theinterrupt.Except as indicated,a signal is reset to 0 after being caught.Thus if it is desired tocatch every such signal,the catching routine mustissue another.it signalcall..s3In C,if.it funcis 0, the default actionfor signal.it sig(termination)is reinstated.If.it funcis 1,the signal is ignored.If.it funcis non-zero andeven, it is assumed to be the addressof a function entry point.When the signal occurs,the function will be called.A return from the function willcontinue the process at the point it was interrupted.As in the assembler call,.it signalmust in general be called again to catch subsequent signals..s3When a caught signal occursduring certain system calls, the call terminates prematurely.In particular this can occurduring a.it reador.it writeon a slow device (like a typewriter; but not a file);and during.sleepor.it wait.When such a signal occurs, the saved user statusis arranged in such a way that when return from thesignal-catching takes place, it will appear that thesystem call returned a characteristic error status.The user's program may then, if it wishes,re-execute the call..s3The starred signals in the list above cause a core imageif not caught or ignored..s3The value of the call is the old action defined for the signal..s3After a.it fork(II)the child inheritsall signals..it Exec(II)resets allcaught signals to default action..sh "SEE ALSO"kill (I), kill (II),ptrace (II),reset (III).sh DIAGNOSTICSThe error bit(c-bit)is set if thegiven signal is out of range.In C, a \*-1 indicates an error;0 indicates success..sh BUGS
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -