Linux信号、对应的值以及解释

来源:互联网 发布:产业大数据平台 编辑:程序博客网 时间:2024/06/06 00:36

          有时,程序被信号中断,用wait()函数和WIFSIGNALED宏只能获取一个信号值,看了得找对应的信号是什么,以及对应的解释。下面就贴出Linux信号、对应的值以及解释。方便以后编程时的查找。


#define SIG_ERR((__sighandler_t) -1)/* Error return.  */#define SIG_DFL((__sighandler_t) 0)/* Default action.  */#define SIG_IGN((__sighandler_t) 1)/* Ignore signal.  */#ifdef __USE_UNIX98# define SIG_HOLD((__sighandler_t) 2)/* Add signal to hold mask.  */#endif/* Signals.  */#defineSIGHUP1/* Hangup (POSIX).  */#defineSIGINT2/* Interrupt (ANSI).  */#defineSIGQUIT3/* Quit (POSIX).  */#defineSIGILL4/* Illegal instruction (ANSI).  */#defineSIGTRAP5/* Trace trap (POSIX).  */#defineSIGABRT6/* Abort (ANSI).  */#defineSIGIOT6/* IOT trap (4.2 BSD).  */#defineSIGBUS7/* BUS error (4.2 BSD).  */#defineSIGFPE8/* Floating-point exception (ANSI).  */#defineSIGKILL9/* Kill, unblockable (POSIX).  */#defineSIGUSR110/* User-defined signal 1 (POSIX).  */#defineSIGSEGV11/* Segmentation violation (ANSI).  */#defineSIGUSR212/* User-defined signal 2 (POSIX).  */#defineSIGPIPE13/* Broken pipe (POSIX).  */#defineSIGALRM14/* Alarm clock (POSIX).  */#defineSIGTERM15/* Termination (ANSI).  */#defineSIGSTKFLT16/* Stack fault.  */#defineSIGCLDSIGCHLD/* Same as SIGCHLD (System V).  */#defineSIGCHLD17/* Child status has changed (POSIX).  */#defineSIGCONT18/* Continue (POSIX).  */#defineSIGSTOP19/* Stop, unblockable (POSIX).  */#defineSIGTSTP20/* Keyboard stop (POSIX).  */#defineSIGTTIN21/* Background read from tty (POSIX).  */#defineSIGTTOU22/* Background write to tty (POSIX).  */#defineSIGURG23/* Urgent condition on socket (4.2 BSD).  */#defineSIGXCPU24/* CPU limit exceeded (4.2 BSD).  */#defineSIGXFSZ25/* File size limit exceeded (4.2 BSD).  */#defineSIGVTALRM26/* Virtual alarm clock (4.2 BSD).  */#defineSIGPROF27/* Profiling alarm clock (4.2 BSD).  */#defineSIGWINCH28/* Window size change (4.3 BSD, Sun).  */#defineSIGPOLLSIGIO/* Pollable event occurred (System V).  */#defineSIGIO29/* I/O now possible (4.2 BSD).  */#defineSIGPWR30/* Power failure restart (System V).  */#define SIGSYS31/* Bad system call.  */#define SIGUNUSED31#define_NSIG65/* Biggest signal number + 1   (including real-time signals).  */#define SIGRTMIN        (__libc_current_sigrtmin ())#define SIGRTMAX        (__libc_current_sigrtmax ())/* These are the hard limits of the kernel.  These values should not be   used directly at user level.  */#define __SIGRTMIN32#define __SIGRTMAX(_NSIG - 1)