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