signum-generic.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /* Signal number constants. Generic template.
  2. Copyright (C) 1991-2019 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, see
  14. <http://www.gnu.org/licenses/>. */
  15. #ifndef _BITS_SIGNUM_GENERIC_H
  16. #define _BITS_SIGNUM_GENERIC_H 1
  17. #ifndef _SIGNAL_H
  18. #error "Never include <bits/signum-generic.h> directly; use <signal.h> instead."
  19. #endif
  20. /* Fake signal functions. */
  21. #define SIG_ERR ((__sighandler_t) -1) /* Error return. */
  22. #define SIG_DFL ((__sighandler_t) 0) /* Default action. */
  23. #define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */
  24. #ifdef __USE_XOPEN
  25. # define SIG_HOLD ((__sighandler_t) 2) /* Add signal to hold mask. */
  26. #endif
  27. /* We define here all the signal names listed in POSIX (1003.1-2008);
  28. as of 1003.1-2013, no additional signals have been added by POSIX.
  29. We also define here signal names that historically exist in every
  30. real-world POSIX variant (e.g. SIGWINCH).
  31. Signals in the 1-15 range are defined with their historical numbers.
  32. For other signals, we use the BSD numbers.
  33. There are two unallocated signal numbers in the 1-31 range: 7 and 29.
  34. Signal number 0 is reserved for use as kill(pid, 0), to test whether
  35. a process exists without sending it a signal. */
  36. /* ISO C99 signals. */
  37. #define SIGINT 2 /* Interactive attention signal. */
  38. #define SIGILL 4 /* Illegal instruction. */
  39. #define SIGABRT 6 /* Abnormal termination. */
  40. #define SIGFPE 8 /* Erroneous arithmetic operation. */
  41. #define SIGSEGV 11 /* Invalid access to storage. */
  42. #define SIGTERM 15 /* Termination request. */
  43. /* Historical signals specified by POSIX. */
  44. #define SIGHUP 1 /* Hangup. */
  45. #define SIGQUIT 3 /* Quit. */
  46. #define SIGTRAP 5 /* Trace/breakpoint trap. */
  47. #define SIGKILL 9 /* Killed. */
  48. #define SIGBUS 10 /* Bus error. */
  49. #define SIGSYS 12 /* Bad system call. */
  50. #define SIGPIPE 13 /* Broken pipe. */
  51. #define SIGALRM 14 /* Alarm clock. */
  52. /* New(er) POSIX signals (1003.1-2008, 1003.1-2013). */
  53. #define SIGURG 16 /* Urgent data is available at a socket. */
  54. #define SIGSTOP 17 /* Stop, unblockable. */
  55. #define SIGTSTP 18 /* Keyboard stop. */
  56. #define SIGCONT 19 /* Continue. */
  57. #define SIGCHLD 20 /* Child terminated or stopped. */
  58. #define SIGTTIN 21 /* Background read from control terminal. */
  59. #define SIGTTOU 22 /* Background write to control terminal. */
  60. #define SIGPOLL 23 /* Pollable event occurred (System V). */
  61. #define SIGXCPU 24 /* CPU time limit exceeded. */
  62. #define SIGXFSZ 25 /* File size limit exceeded. */
  63. #define SIGVTALRM 26 /* Virtual timer expired. */
  64. #define SIGPROF 27 /* Profiling timer expired. */
  65. #define SIGUSR1 30 /* User-defined signal 1. */
  66. #define SIGUSR2 31 /* User-defined signal 2. */
  67. /* Nonstandard signals found in all modern POSIX systems
  68. (including both BSD and Linux). */
  69. #define SIGWINCH 28 /* Window size change (4.3 BSD, Sun). */
  70. /* Archaic names for compatibility. */
  71. #define SIGIO SIGPOLL /* I/O now possible (4.2 BSD). */
  72. #define SIGIOT SIGABRT /* IOT instruction, abort() on a PDP-11. */
  73. #define SIGCLD SIGCHLD /* Old System V name */
  74. /* Not all systems support real-time signals. bits/signum.h indicates
  75. that they are supported by overriding __SIGRTMAX to a value greater
  76. than __SIGRTMIN. These constants give the kernel-level hard limits,
  77. but some real-time signals may be used internally by glibc. Do not
  78. use these constants in application code; use SIGRTMIN and SIGRTMAX
  79. (defined in signal.h) instead. */
  80. #define __SIGRTMIN 32
  81. #define __SIGRTMAX __SIGRTMIN
  82. /* Biggest signal number + 1 (including real-time signals). */
  83. #define _NSIG (__SIGRTMAX + 1)
  84. #endif /* bits/signum-generic.h. */