signal 常量signal Constants

语法Syntax

#include <signal.h>  

备注Remarks

sig 参数必须是 SIGNAL.H 定义的下列清单常量之一。The sig argument must be one of the manifest constants listed below (defined in SIGNAL.H).

SIGABRT
异常终止。Abnormal termination. 默认操作将使用退出代码 3 终止调用程序。The default action terminates the calling program with exit code 3.

SIGABRT_COMPAT
与 SIGABRT 相同。Same as SIGABRT. 针对与其他平台的兼容性。For compatibility with other platforms.

SIGFPE
浮点错误,例如溢出、除数为零或操作无效。Floating-point error, such as overflow, division by zero, or invalid operation. 默认操作将终止调用程序。The default action terminates the calling program.

SIGILL
非法指令。Illegal instruction. 默认操作将终止调用程序。The default action terminates the calling program.

SIGINT
CTRL+C 中断。CTRL+C interrupt. 默认操作将使用退出代码 3 终止调用程序。The default action terminates the calling program with exit code 3.

SIGSEGV
非法存储访问。Illegal storage access. 默认操作将终止调用程序。The default action terminates the calling program.

SIGTERM
发送到程序的终止请求。Termination request sent to the program. 默认操作将使用退出代码 3 终止调用程序。The default action terminates the calling program with exit code 3.

SIG_ERR
指示已发生错误的信号的返回类型。A return type from a signal indicating an error has occurred.

另请参阅See Also

signal signal
raise raise
全局常量Global Constants