signal.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #ifndef __BITS_SIGNAL_H__
  2. #define __BITS_SIGNAL_H__
  3. #define SIGHUP 1
  4. #define SIGINT 2
  5. #define SIGQUIT 3
  6. #define SIGILL 4
  7. #define SIGTRAP 5
  8. #define SIGABRT 6
  9. #define SIGEMT 7
  10. #define SIGFPE 8
  11. #define SIGKILL 9
  12. #define SIGBUS 10
  13. #define SIGSEGV 11
  14. #define SIGSYS 12
  15. #define SIGPIPE 13
  16. #define SIGALRM 14
  17. #define SIGTERM 15
  18. #define SIGUSR1 16
  19. #define SIGUSR2 17
  20. #define SIGCHLD 18
  21. #define SIGPWR 19
  22. #define SIGWINCH 20
  23. #define SIGURG 21
  24. #define SIGIO 22
  25. #define SIGSTOP 23
  26. #define SIGTSTP 24
  27. #define SIGCONT 25
  28. #define SIGTTIN 26
  29. #define SIGTTOU 27
  30. #define SIGVTALRM 28
  31. #define SIGPROF 29
  32. #define SIGXCPU 30
  33. #define SIGXFSZ 31
  34. #define SIGRTMIN 32
  35. #define SIGRTMAX 63
  36. #define NSIGWORDS 4
  37. struct sigset {
  38. unsigned long word[4];
  39. };
  40. #define SIG_BLOCK 1
  41. #define SIG_UNBLOCK 2
  42. #define SIG_SETMASK 3
  43. #define SIG_DFL ((void*) 0L)
  44. #define SIG_IGN ((void*) 1L)
  45. #define SIG_ERR ((void*)~0L)
  46. #define SA_ONSTACK 0x08000000
  47. #define SA_RESETHAND 0x80000000
  48. #define SA_RESTART 0x10000000
  49. #define SA_SIGINFO 0x00000008
  50. #define SA_NODEFER 0x40000000
  51. #define SA_NOCLDWAIT 0x00010000
  52. #define SA_NOCLDSTOP 0x00000001
  53. struct sigaction {
  54. unsigned int flags;
  55. union {
  56. void (*action)(int, void*, void*);
  57. void (*handler)(int);
  58. };
  59. struct sigset mask;
  60. };
  61. #define SIGHANDLER(sa, hh, fl) \
  62. struct sigaction sa = { \
  63. .handler = hh, \
  64. .flags = fl, \
  65. .mask = { { 0 } } \
  66. }
  67. #endif