当前位置:   article > 正文

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

linux 信号值about

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


  1. #define SIG_ERR ((__sighandler_t) -1) /* Error return. */
  2. #define SIG_DFL ((__sighandler_t) 0) /* Default action. */
  3. #define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */
  4. #ifdef __USE_UNIX98
  5. # define SIG_HOLD ((__sighandler_t) 2) /* Add signal to hold mask. */
  6. #endif
  7. /* Signals. */
  8. #define SIGHUP 1 /* Hangup (POSIX). */
  9. #define SIGINT 2 /* Interrupt (ANSI). */
  10. #define SIGQUIT 3 /* Quit (POSIX). */
  11. #define SIGILL 4 /* Illegal instruction (ANSI). */
  12. #define SIGTRAP 5 /* Trace trap (POSIX). */
  13. #define SIGABRT 6 /* Abort (ANSI). */
  14. #define SIGIOT 6 /* IOT trap (4.2 BSD). */
  15. #define SIGBUS 7 /* BUS error (4.2 BSD). */
  16. #define SIGFPE 8 /* Floating-point exception (ANSI). */
  17. #define SIGKILL 9 /* Kill, unblockable (POSIX). */
  18. #define SIGUSR1 10 /* User-defined signal 1 (POSIX). */
  19. #define SIGSEGV 11 /* Segmentation violation (ANSI). */
  20. #define SIGUSR2 12 /* User-defined signal 2 (POSIX). */
  21. #define SIGPIPE 13 /* Broken pipe (POSIX). */
  22. #define SIGALRM 14 /* Alarm clock (POSIX). */
  23. #define SIGTERM 15 /* Termination (ANSI). */
  24. #define SIGSTKFLT 16 /* Stack fault. */
  25. #define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */
  26. #define SIGCHLD 17 /* Child status has changed (POSIX). */
  27. #define SIGCONT 18 /* Continue (POSIX). */
  28. #define SIGSTOP 19 /* Stop, unblockable (POSIX). */
  29. #define SIGTSTP 20 /* Keyboard stop (POSIX). */
  30. #define SIGTTIN 21 /* Background read from tty (POSIX). */
  31. #define SIGTTOU 22 /* Background write to tty (POSIX). */
  32. #define SIGURG 23 /* Urgent condition on socket (4.2 BSD). */
  33. #define SIGXCPU 24 /* CPU limit exceeded (4.2 BSD). */
  34. #define SIGXFSZ 25 /* File size limit exceeded (4.2 BSD). */
  35. #define SIGVTALRM 26 /* Virtual alarm clock (4.2 BSD). */
  36. #define SIGPROF 27 /* Profiling alarm clock (4.2 BSD). */
  37. #define SIGWINCH 28 /* Window size change (4.3 BSD, Sun). */
  38. #define SIGPOLL SIGIO /* Pollable event occurred (System V). */
  39. #define SIGIO 29 /* I/O now possible (4.2 BSD). */
  40. #define SIGPWR 30 /* Power failure restart (System V). */
  41. #define SIGSYS 31 /* Bad system call. */
  42. #define SIGUNUSED 31
  43. #define _NSIG 65 /* Biggest signal number + 1
  44. (including real-time signals). */
  45. #define SIGRTMIN (__libc_current_sigrtmin ())
  46. #define SIGRTMAX (__libc_current_sigrtmax ())
  47. /* These are the hard limits of the kernel. These values should not be
  48. used directly at user level. */
  49. #define __SIGRTMIN 32
  50. #define __SIGRTMAX (_NSIG - 1)


声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/运维做开发/article/detail/864821
推荐阅读
相关标签
  

闽ICP备14008679号