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

Signal Handling--ref

发布时间:2021-01-25 23:15:02 所属栏目: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

Actual floating-point exceptions are a complicated subject because there are many types of exceptions with subtly different meanings,and theSIGFPEsignal doesn't distinguish between them. TheIEEE Standard for Binary Floating-Point Arithmetic (ANSI/IEEE Std 754-1985)defines various floating-point exceptions and requires conforming computer systems to report their occurrences. However,this standard does not specify how the exceptions are reported,or what kinds of handling and control the operating system can offer to the programmer.

SIGFPEhandler with an extra argument that distinguishes various causes of the exception. In order to access this argument,you must define the handler to accept two arguments,which means you must cast it to a one-argument function type in order to establish the handler. The GNU library does provide this extra argument,but the value is meaningful only on operating systems that provide the information (BSD systems and GNU systems).

FPE_INTOVF_TRAP
Integer overflow (impossible in a C program unless you enable overflow trapping in a hardware-specific fashion).
FPE_INTDIV_TRAP
Integer division by zero.
FPE_SUBRNG_TRAP
Subscript-range (something that C programs never check for).
FPE_FLTOVF_TRAP
Floating overflow trap.
FPE_FLTDIV_TRAP
Floating/decimal division by zero.
FPE_FLTUND_TRAP
Floating underflow trap. (Trapping on floating underflow is not normally enabled.)
FPE_DECOVF_TRAP
Decimal overflow trap. (Only a few machines have decimal arithmetic and C never uses it.)
intSIGILL
The name of this signal is derived from "illegal instruction"; it usually means your program is trying to execute garbage or a privileged instruction. Since the C compiler generates only valid instructions,SIGILLtypically indicates that the executable file is corrupted,or that you are trying to execute data. Some common ways of getting into the latter situation are by passing an invalid object where a pointer to a function was expected,or by writing past the end of an automatic array (or similar problems with pointers to automatic variables) and corrupting other data on the stack such as the return address of a stack frame.

SIGILLcan also be generated when the stack overflows,or when the system has trouble running the handler for a signal.

(编辑:威海站长网)

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

热点阅读