signal 操作常量signal Action Constants

收到中断信号后采取的操作取决于 func 的值。The action taken when the interrupt signal is received depends on the value of func.

语法Syntax

#include <signal.h>  

备注Remarks

func 参数必须是一个函数地址或 SIGNAL.H 中定义的下列清单常量之一。The func argument must be either a function address or one of the manifest constants listed below and defined in SIGNAL.H.

SIG_DFL
使用系统默认的响应。Uses system-default response. 如果调用程序使用流 I/O,将不会刷新运行时库创建的缓冲区。If the calling program uses stream I/O, buffers created by the run-time library are not flushed.

SIG_IGN
忽略中断信号。Ignores interrupt signal. 不得为 SIGFPE 指定该值,因为未定义此进程的浮点状态。This value should never be given for SIGFPE, since the floating-point state of the process is left undefined.

SIG_SGE
指示信号中发生错误。Indicates an error occurred in the signal.

SIG_ACK
指示已收到确认。Indicates an acknowledgement was received.

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

另请参阅See Also

signal signal
全局常量Global Constants