signal.h 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. * signal.h - signal handling
  3. *
  4. * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
  5. * See the copyright notice in the ACK home directory, in the file "Copyright".
  6. */
  7. /* $Header$ */
  8. #if !defined(_SIGNAL_H)
  9. #define _SIGNAL_H
  10. typedef int sig_atomic_t;
  11. #if defined(_POSIX_SOURCE)
  12. #if defined(_MINIX)
  13. typedef unsigned short sigset_t;
  14. #define SIG_BLOCK 0 /* for blocking signals */
  15. #define SIG_UNBLOCK 1 /* for unblocking signals */
  16. #define SIG_SETMASK 2 /* for setting the signal mask */
  17. struct sigaction {
  18. void (*sa_handler)(int);/* SIG_DFL, SIG_IGN or pointer to function */
  19. sigset_t sa_mask; /* signals blocked during handling */
  20. int sa_flags; /* special flags */
  21. };
  22. #endif
  23. #endif
  24. #define SIG_ERR ((void (*)(int))-1)
  25. #if defined(__em22) || defined(__em24) || defined(__em44)
  26. #define SIG_DFL ((void (*)(int))-2)
  27. #define SIG_IGN ((void (*)(int))-3)
  28. #else
  29. #define SIG_DFL ((void (*)(int))0)
  30. #define SIG_IGN ((void (*)(int))1)
  31. #endif /* no interpretation */
  32. #define SIGHUP 1 /* hangup */
  33. #define SIGINT 2 /* interrupt */
  34. #define SIGQUIT 3 /* quit */
  35. #define SIGILL 4 /* illegal instruction (not reset when caught) */
  36. #define SIGTRAP 5 /* trace trap (not reset when caught) */
  37. #define SIGIOT 6 /* IOT instruction */
  38. #define SIGABRT 6 /* ANSI abort trap */
  39. #define SIGEMT 7 /* EMT instruction */
  40. #define SIGFPE 8 /* floating point exception */
  41. #define SIGKILL 9 /* kill (cannot be caught or ignored) */
  42. #define SIGBUS 10 /* bus error */
  43. #define SIGSEGV 11 /* segmentation violation */
  44. #define SIGSYS 12 /* bad argument to system call */
  45. #define SIGPIPE 13 /* write on a pipe with no one to read it */
  46. #define SIGALRM 14 /* alarm clock */
  47. #define SIGTERM 15 /* software termination signal from kill */
  48. #if defined(__USG)
  49. #define SIGUSR1 16 /* user defined signal 1 */
  50. #define SIGUSR2 17 /* user defined signal 2 */
  51. #define SIGCLD 18 /* death of a child */
  52. #define SIGPWR 19 /* power-fail signal */
  53. #define _NSIG 20
  54. #elif defined(__BSD4_2)
  55. #define SIGURG 16 /* urgent condition */
  56. #define SIGSTOP 17 /* stop signal not from tty */
  57. #define SIGTSTP 18 /* stop signal from tty */
  58. #define SIGCONT 19 /* continue a stopped process */
  59. #define SIGCHLD 20 /* death of a child */
  60. #define SIGCLD 20 /* System V compat. */
  61. #define SIGTTIN 21 /* background tty read */
  62. #define SIGTTOU 22 /* background tty write */
  63. #define SIGIO 23 /* I/O possible signal */
  64. #define SIGPOLL SIGIO /* System V compat. */
  65. #define SIGXCPU 24 /* exceeded CPU time limit */
  66. #define SIGXFSZ 25 /* exceeded file size limit */
  67. #define SIGVTALRM 26 /* virtual time alarm */
  68. #define SIGPROF 27 /* profiling time alarm */
  69. #define SIGWINCH 28 /* window has changed */
  70. #define SIGLOST 29 /* resource lost */
  71. #define SIGUSR1 30 /* user defined signal 1 */
  72. #define SIGUSR2 31 /* user defined signal 2 */
  73. #define _NSIG 32
  74. #elif defined(_MINIX)
  75. /* The following signals are defined but not supported */
  76. #define SIGCHLD 17 /* child process terminated or stopped */
  77. #define SIGCONT 18 /* continue if stopped */
  78. #define SIGSTOP 19 /* stop signal */
  79. #define SIGTSTP 20 /* interactive stop signal */
  80. #define SIGTTIN 21 /* background process wants to read */
  81. #define SIGTTOU 22 /* background process wants to write */
  82. #define _NSIG 16
  83. #else
  84. #define _NSIG 16
  85. #endif /* __USG or __BSD4_2 */
  86. void (*signal(int _sig, void (*_func)(int)))(int);
  87. int raise(int _sig);
  88. #endif /* _SIGNAL_H */