1/* Signal number constants. Generic template.
2 Copyright (C) 1991-2017 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 <http://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 SIGBUS 10 /* Bus error. */
61#define SIGSYS 12 /* Bad system call. */
62#define SIGPIPE 13 /* Broken pipe. */
63#define SIGALRM 14 /* Alarm clock. */
64
65/* New(er) POSIX signals (1003.1-2008, 1003.1-2013). */
66#define SIGURG 16 /* Urgent data is available at a socket. */
67#define SIGSTOP 17 /* Stop, unblockable. */
68#define SIGTSTP 18 /* Keyboard stop. */
69#define SIGCONT 19 /* Continue. */
70#define SIGCHLD 20 /* Child terminated or stopped. */
71#define SIGTTIN 21 /* Background read from control terminal. */
72#define SIGTTOU 22 /* Background write to control terminal. */
73#define SIGPOLL 23 /* Pollable event occurred (System V). */
74#define SIGXCPU 24 /* CPU time limit exceeded. */
75#define SIGXFSZ 25 /* File size limit exceeded. */
76#define SIGVTALRM 26 /* Virtual timer expired. */
77#define SIGPROF 27 /* Profiling timer expired. */
78#define SIGUSR1 30 /* User-defined signal 1. */
79#define SIGUSR2 31 /* User-defined signal 2. */
80
81/* Nonstandard signals found in all modern POSIX systems
82 (including both BSD and Linux). */
83#define SIGWINCH 28 /* Window size change (4.3 BSD, Sun). */
84
85/* Archaic names for compatibility. */
86#define SIGIO SIGPOLL /* I/O now possible (4.2 BSD). */
87#define SIGIOT SIGABRT /* IOT instruction, abort() on a PDP-11. */
88#define SIGCLD SIGCHLD /* Old System V name */
89
90/* Not all systems support real-time signals. bits/signum.h indicates
91 that they are supported by overriding __SIGRTMAX to a value greater
92 than __SIGRTMIN. These constants give the kernel-level hard limits,
93 but some real-time signals may be used internally by glibc. Do not
94 use these constants in application code; use SIGRTMIN and SIGRTMAX
95 (defined in signal.h) instead. */
96#define __SIGRTMIN 32
97#define __SIGRTMAX __SIGRTMIN
98
99/* Biggest signal number + 1 (including real-time signals). */
100#define _NSIG (__SIGRTMAX + 1)
101
102#endif /* bits/signum-generic.h. */
103