signum-generic.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /* Signal number constants. Generic template.
  2. Copyright (C) 1991-2021 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. <https://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 SIGPIPE 13 /* Broken pipe. */
  49. #define SIGALRM 14 /* Alarm clock. */
  50. /* Archaic names for compatibility. */
  51. #define SIGIO SIGPOLL /* I/O now possible (4.2 BSD). */
  52. #define SIGIOT SIGABRT /* IOT instruction, abort() on a PDP-11. */
  53. #define SIGCLD SIGCHLD /* Old System V name */
  54. /* Not all systems support real-time signals. bits/signum.h indicates
  55. that they are supported by overriding __SIGRTMAX to a value greater
  56. than __SIGRTMIN. These constants give the kernel-level hard limits,
  57. but some real-time signals may be used internally by glibc. Do not
  58. use these constants in application code; use SIGRTMIN and SIGRTMAX
  59. (defined in signal.h) instead. */
  60. /* Include system specific bits. */
  61. #include <bits/signum-arch.h>
  62. /* Biggest signal number + 1 (including real-time signals). */
  63. #define _NSIG (__SIGRTMAX + 1)
  64. #endif /* bits/signum-generic.h. */