GNU Linux-libre 4.14.266-gnu1
[releases.git] / security / apparmor / include / sig_names.h
1 #include <linux/signal.h>
2
3 #define SIGUNKNOWN 0
4 #define MAXMAPPED_SIG 35
5 #define MAXMAPPED_SIGNAME (MAXMAPPED_SIG + 1)
6
7 /* provide a mapping of arch signal to internal signal # for mediation
8  * those that are always an alias SIGCLD for SIGCLHD and SIGPOLL for SIGIO
9  * map to the same entry those that may/or may not get a separate entry
10  */
11 static const int sig_map[MAXMAPPED_SIG] = {
12         [0] = MAXMAPPED_SIG,    /* existence test */
13         [SIGHUP] = 1,
14         [SIGINT] = 2,
15         [SIGQUIT] = 3,
16         [SIGILL] = 4,
17         [SIGTRAP] = 5,          /* -, 5, - */
18         [SIGABRT] = 6,          /*  SIGIOT: -, 6, - */
19         [SIGBUS] = 7,           /* 10, 7, 10 */
20         [SIGFPE] = 8,
21         [SIGKILL] = 9,
22         [SIGUSR1] = 10,         /* 30, 10, 16 */
23         [SIGSEGV] = 11,
24         [SIGUSR2] = 12,         /* 31, 12, 17 */
25         [SIGPIPE] = 13,
26         [SIGALRM] = 14,
27         [SIGTERM] = 15,
28 #ifdef SIGSTKFLT
29         [SIGSTKFLT] = 16,       /* -, 16, - */
30 #endif
31         [SIGCHLD] = 17,         /* 20, 17, 18.  SIGCHLD -, -, 18 */
32         [SIGCONT] = 18,         /* 19, 18, 25 */
33         [SIGSTOP] = 19,         /* 17, 19, 23 */
34         [SIGTSTP] = 20,         /* 18, 20, 24 */
35         [SIGTTIN] = 21,         /* 21, 21, 26 */
36         [SIGTTOU] = 22,         /* 22, 22, 27 */
37         [SIGURG] = 23,          /* 16, 23, 21 */
38         [SIGXCPU] = 24,         /* 24, 24, 30 */
39         [SIGXFSZ] = 25,         /* 25, 25, 31 */
40         [SIGVTALRM] = 26,       /* 26, 26, 28 */
41         [SIGPROF] = 27,         /* 27, 27, 29 */
42         [SIGWINCH] = 28,        /* 28, 28, 20 */
43         [SIGIO] = 29,           /* SIGPOLL: 23, 29, 22 */
44         [SIGPWR] = 30,          /* 29, 30, 19.  SIGINFO 29, -, - */
45 #ifdef SIGSYS
46         [SIGSYS] = 31,          /* 12, 31, 12. often SIG LOST/UNUSED */
47 #endif
48 #ifdef SIGEMT
49         [SIGEMT] = 32,          /* 7, - , 7 */
50 #endif
51 #if defined(SIGLOST) && SIGPWR != SIGLOST               /* sparc */
52         [SIGLOST] = 33,         /* unused on Linux */
53 #endif
54 #if defined(SIGUNUSED) && \
55     defined(SIGLOST) && defined(SIGSYS) && SIGLOST != SIGSYS
56         [SIGUNUSED] = 34,       /* -, 31, - */
57 #endif
58 };
59
60 /* this table is ordered post sig_map[sig] mapping */
61 static const char *const sig_names[MAXMAPPED_SIGNAME] = {
62         "unknown",
63         "hup",
64         "int",
65         "quit",
66         "ill",
67         "trap",
68         "abrt",
69         "bus",
70         "fpe",
71         "kill",
72         "usr1",
73         "segv",
74         "usr2",
75         "pipe",
76         "alrm",
77         "term",
78         "stkflt",
79         "chld",
80         "cont",
81         "stop",
82         "stp",
83         "ttin",
84         "ttou",
85         "urg",
86         "xcpu",
87         "xfsz",
88         "vtalrm",
89         "prof",
90         "winch",
91         "io",
92         "pwr",
93         "sys",
94         "emt",
95         "lost",
96         "unused",
97
98         "exists",       /* always last existence test mapped to MAXMAPPED_SIG */
99 };
100