signal.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 1995, 96, 97, 98, 99, 2003 by Ralf Baechle
  7. * Copyright (C) 1999 Silicon Graphics, Inc.
  8. */
  9. #ifndef _ASM_SIGNAL_H
  10. #define _ASM_SIGNAL_H
  11. #include <linux/types.h>
  12. #define _NSIG 128
  13. #define _NSIG_BPW (sizeof(unsigned long) * 8)
  14. #define _NSIG_WORDS (_NSIG / _NSIG_BPW)
  15. typedef struct {
  16. unsigned long sig[_NSIG_WORDS];
  17. } sigset_t;
  18. typedef unsigned long old_sigset_t; /* at least 32 bits */
  19. #define SIGHUP 1 /* Hangup (POSIX). */
  20. #define SIGINT 2 /* Interrupt (ANSI). */
  21. #define SIGQUIT 3 /* Quit (POSIX). */
  22. #define SIGILL 4 /* Illegal instruction (ANSI). */
  23. #define SIGTRAP 5 /* Trace trap (POSIX). */
  24. #define SIGIOT 6 /* IOT trap (4.2 BSD). */
  25. #define SIGABRT SIGIOT /* Abort (ANSI). */
  26. #define SIGEMT 7
  27. #define SIGFPE 8 /* Floating-point exception (ANSI). */
  28. #define SIGKILL 9 /* Kill, unblockable (POSIX). */
  29. #define SIGBUS 10 /* BUS error (4.2 BSD). */
  30. #define SIGSEGV 11 /* Segmentation violation (ANSI). */
  31. #define SIGSYS 12
  32. #define SIGPIPE 13 /* Broken pipe (POSIX). */
  33. #define SIGALRM 14 /* Alarm clock (POSIX). */
  34. #define SIGTERM 15 /* Termination (ANSI). */
  35. #define SIGUSR1 16 /* User-defined signal 1 (POSIX). */
  36. #define SIGUSR2 17 /* User-defined signal 2 (POSIX). */
  37. #define SIGCHLD 18 /* Child status has changed (POSIX). */
  38. #define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */
  39. #define SIGPWR 19 /* Power failure restart (System V). */
  40. #define SIGWINCH 20 /* Window size change (4.3 BSD, Sun). */
  41. #define SIGURG 21 /* Urgent condition on socket (4.2 BSD). */
  42. #define SIGIO 22 /* I/O now possible (4.2 BSD). */
  43. #define SIGPOLL SIGIO /* Pollable event occurred (System V). */
  44. #define SIGSTOP 23 /* Stop, unblockable (POSIX). */
  45. #define SIGTSTP 24 /* Keyboard stop (POSIX). */
  46. #define SIGCONT 25 /* Continue (POSIX). */
  47. #define SIGTTIN 26 /* Background read from tty (POSIX). */
  48. #define SIGTTOU 27 /* Background write to tty (POSIX). */
  49. #define SIGVTALRM 28 /* Virtual alarm clock (4.2 BSD). */
  50. #define SIGPROF 29 /* Profiling alarm clock (4.2 BSD). */
  51. #define SIGXCPU 30 /* CPU limit exceeded (4.2 BSD). */
  52. #define SIGXFSZ 31 /* File size limit exceeded (4.2 BSD). */
  53. /* These should not be considered constants from userland. */
  54. #define SIGRTMIN 32
  55. #define SIGRTMAX _NSIG
  56. /*
  57. * SA_FLAGS values:
  58. *
  59. * SA_ONSTACK indicates that a registered stack_t will be used.
  60. * SA_RESTART flag to get restarting signals (which were the default long ago)
  61. * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
  62. * SA_RESETHAND clears the handler when the signal is delivered.
  63. * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
  64. * SA_NODEFER prevents the current signal from being masked in the handler.
  65. *
  66. * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
  67. * Unix names RESETHAND and NODEFER respectively.
  68. *
  69. * SA_RESTORER used to be defined as 0x04000000 but only the O32 ABI ever
  70. * supported its use and no libc was using it, so the entire sa-restorer
  71. * functionality was removed with lmo commit 39bffc12c3580ab for 2.5.48
  72. * retaining only the SA_RESTORER definition as a reminder to avoid
  73. * accidental reuse of the mask bit.
  74. */
  75. #define SA_ONSTACK 0x08000000
  76. #define SA_RESETHAND 0x80000000
  77. #define SA_RESTART 0x10000000
  78. #define SA_SIGINFO 0x00000008
  79. #define SA_NODEFER 0x40000000
  80. #define SA_NOCLDWAIT 0x00010000
  81. #define SA_NOCLDSTOP 0x00000001
  82. #define SA_NOMASK SA_NODEFER
  83. #define SA_ONESHOT SA_RESETHAND
  84. #define MINSIGSTKSZ 2048
  85. #define SIGSTKSZ 8192
  86. #define SIG_BLOCK 1 /* for blocking signals */
  87. #define SIG_UNBLOCK 2 /* for unblocking signals */
  88. #define SIG_SETMASK 3 /* for setting the signal mask */
  89. #include <asm-generic/signal-defs.h>
  90. struct sigaction {
  91. unsigned int sa_flags;
  92. __sighandler_t sa_handler;
  93. sigset_t sa_mask;
  94. };
  95. /* IRIX compatible stack_t */
  96. typedef struct sigaltstack {
  97. void *ss_sp;
  98. size_t ss_size;
  99. int ss_flags;
  100. } stack_t;
  101. #endif /* _ASM_SIGNAL_H */