?? signal.2
字號:
.TH SIGNAL 2 .SH NAMEsignal \- catch or ignore signals.SH SYNOPSIS.B #include <signal.h>.PP.B (*signal(sig, func))().br.B (*func)();.SH DESCRIPTIONA 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 a.I signalcall allows them either to be ignoredor to cause an interrupt to a specified location.Here is the list of signals with names as inthe include file..LP.nf.ta \w'SIGMMMM 'u +\w'15* 'uSIGHUP 1 hangupSIGINT 2 interruptSIGQUIT 3* quitSIGILL 4* illegal instruction (not reset when caught)SIGTRAP 5* trace trap (not reset when caught)SIGIOT 6* IOT instructionSIGEMT 7* EMT instructionSIGFPE 8* floating point exceptionSIGKILL 9 kill (cannot be caught or ignored)SIGBUS 10* bus errorSIGSEGV 11* segmentation violationSIGSYS 12* bad argument to system callSIGPIPE 13 write on a pipe or link with no one to read itSIGALRM 14 alarm clockSIGTERM 15 software termination signal 16 unassigned.fi.PPThe starred signals in the list above cause a core imageif not caught or ignored..PPIf.I funcis SIG_DFL, the default actionfor signal.I sigis reinstated; this default is termination,sometimes with a core image.If.I funcis SIG_IGN the signal is ignored.Otherwisewhen the signal occurs.I funcwill be called with thesignal number as argument.A return from the function willcontinue the process at the point it was interrupted.Except as indicated,a signal is reset to SIG_DFL after being caught.Thus if it is desired tocatch every such signal,the catching routine mustissue another.I signalcall..PPWhen a caught signal occursduring certain system calls, the call terminates prematurely.In particular this can occurduring a.I reador.IR write (2)on a slow device (like a typewriter; but not a file);and during.I pauseor.IR wait (2).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 an error status.The user's program may then, if it wishes,re-execute the call..PPThe value of.I signalis the previous (or initial)value of.I funcfor the particular signal..PPAfter a.IR fork (2)the child inheritsall signals..IR Exec (2)resets allcaught signals to default action..SH "SEE ALSO"kill(1), kill(2),ptrace(2),setjmp(3).SH DIAGNOSTICSThe value (int)\-1 is returned if thegiven signal is out of range..SH BUGSIf a repeated signal arrives before the last one can bereset, there is no chance to catch it..PPThe type specification of the routine and its.I funcargument are problematical..SH ASSEMBLER(signal = 48.).br.B sys signal; sig; label.br(old label in r0).PPIf.I labelis 0,default action is reinstated.If.I labelis odd, the signal is ignored.Any other even.I labelspecifies an address in the processwhere an interrupt is simulated.An RTI or RTT instruction will return from theinterrupt.
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -