signal.h 3.6 KB

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