1*49cdfc7eSAndroid Build Coastguard Worker /*
2*49cdfc7eSAndroid Build Coastguard Worker * Copyright (c) 2014 Fujitsu Ltd.
3*49cdfc7eSAndroid Build Coastguard Worker * Author: Xiaoguang Wang <[email protected]>
4*49cdfc7eSAndroid Build Coastguard Worker *
5*49cdfc7eSAndroid Build Coastguard Worker * This program is free software; you can redistribute it and/or modify it
6*49cdfc7eSAndroid Build Coastguard Worker * under the terms of version 2 of the GNU General Public License as
7*49cdfc7eSAndroid Build Coastguard Worker * published by the Free Software Foundation.
8*49cdfc7eSAndroid Build Coastguard Worker *
9*49cdfc7eSAndroid Build Coastguard Worker * This program is distributed in the hope that it would be useful, but
10*49cdfc7eSAndroid Build Coastguard Worker * WITHOUT ANY WARRANTY; without even the implied warranty of
11*49cdfc7eSAndroid Build Coastguard Worker * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12*49cdfc7eSAndroid Build Coastguard Worker *
13*49cdfc7eSAndroid Build Coastguard Worker * You should have received a copy of the GNU General Public License along
14*49cdfc7eSAndroid Build Coastguard Worker * with this program; if not, write the Free Software Foundation, Inc.,
15*49cdfc7eSAndroid Build Coastguard Worker * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16*49cdfc7eSAndroid Build Coastguard Worker */
17*49cdfc7eSAndroid Build Coastguard Worker
tst_strsig(int sig)18*49cdfc7eSAndroid Build Coastguard Worker const char *tst_strsig(int sig)
19*49cdfc7eSAndroid Build Coastguard Worker {
20*49cdfc7eSAndroid Build Coastguard Worker static const struct pair signal_pairs[] = {
21*49cdfc7eSAndroid Build Coastguard Worker PAIR(SIGHUP)
22*49cdfc7eSAndroid Build Coastguard Worker PAIR(SIGINT)
23*49cdfc7eSAndroid Build Coastguard Worker PAIR(SIGQUIT)
24*49cdfc7eSAndroid Build Coastguard Worker PAIR(SIGILL)
25*49cdfc7eSAndroid Build Coastguard Worker #ifdef SIGTRAP
26*49cdfc7eSAndroid Build Coastguard Worker PAIR(SIGTRAP)
27*49cdfc7eSAndroid Build Coastguard Worker #endif
28*49cdfc7eSAndroid Build Coastguard Worker
29*49cdfc7eSAndroid Build Coastguard Worker #ifdef SIGIOT
30*49cdfc7eSAndroid Build Coastguard Worker /* SIGIOT same as SIGABRT */
31*49cdfc7eSAndroid Build Coastguard Worker STRPAIR(SIGABRT, "SIGIOT/SIGABRT")
32*49cdfc7eSAndroid Build Coastguard Worker #else
33*49cdfc7eSAndroid Build Coastguard Worker PAIR(SIGABRT)
34*49cdfc7eSAndroid Build Coastguard Worker #endif
35*49cdfc7eSAndroid Build Coastguard Worker
36*49cdfc7eSAndroid Build Coastguard Worker #ifdef SIGEMT
37*49cdfc7eSAndroid Build Coastguard Worker PAIR(SIGEMT)
38*49cdfc7eSAndroid Build Coastguard Worker #endif
39*49cdfc7eSAndroid Build Coastguard Worker #ifdef SIGBUS
40*49cdfc7eSAndroid Build Coastguard Worker PAIR(SIGBUS)
41*49cdfc7eSAndroid Build Coastguard Worker #endif
42*49cdfc7eSAndroid Build Coastguard Worker PAIR(SIGFPE)
43*49cdfc7eSAndroid Build Coastguard Worker PAIR(SIGKILL)
44*49cdfc7eSAndroid Build Coastguard Worker PAIR(SIGUSR1)
45*49cdfc7eSAndroid Build Coastguard Worker PAIR(SIGSEGV)
46*49cdfc7eSAndroid Build Coastguard Worker PAIR(SIGUSR2)
47*49cdfc7eSAndroid Build Coastguard Worker PAIR(SIGPIPE)
48*49cdfc7eSAndroid Build Coastguard Worker PAIR(SIGALRM)
49*49cdfc7eSAndroid Build Coastguard Worker PAIR(SIGTERM)
50*49cdfc7eSAndroid Build Coastguard Worker #ifdef SIGSTKFLT
51*49cdfc7eSAndroid Build Coastguard Worker PAIR(SIGSTKFLT)
52*49cdfc7eSAndroid Build Coastguard Worker #endif
53*49cdfc7eSAndroid Build Coastguard Worker PAIR(SIGCHLD)
54*49cdfc7eSAndroid Build Coastguard Worker PAIR(SIGCONT)
55*49cdfc7eSAndroid Build Coastguard Worker PAIR(SIGSTOP)
56*49cdfc7eSAndroid Build Coastguard Worker PAIR(SIGTSTP)
57*49cdfc7eSAndroid Build Coastguard Worker PAIR(SIGTTIN)
58*49cdfc7eSAndroid Build Coastguard Worker PAIR(SIGTTOU)
59*49cdfc7eSAndroid Build Coastguard Worker #ifdef SIGURG
60*49cdfc7eSAndroid Build Coastguard Worker PAIR(SIGURG)
61*49cdfc7eSAndroid Build Coastguard Worker #endif
62*49cdfc7eSAndroid Build Coastguard Worker #ifdef SIGXCPU
63*49cdfc7eSAndroid Build Coastguard Worker PAIR(SIGXCPU)
64*49cdfc7eSAndroid Build Coastguard Worker #endif
65*49cdfc7eSAndroid Build Coastguard Worker #ifdef SIGXFSZ
66*49cdfc7eSAndroid Build Coastguard Worker PAIR(SIGXFSZ)
67*49cdfc7eSAndroid Build Coastguard Worker #endif
68*49cdfc7eSAndroid Build Coastguard Worker #ifdef SIGVTALRM
69*49cdfc7eSAndroid Build Coastguard Worker PAIR(SIGVTALRM)
70*49cdfc7eSAndroid Build Coastguard Worker #endif
71*49cdfc7eSAndroid Build Coastguard Worker #ifdef SIGPROF
72*49cdfc7eSAndroid Build Coastguard Worker PAIR(SIGPROF)
73*49cdfc7eSAndroid Build Coastguard Worker #endif
74*49cdfc7eSAndroid Build Coastguard Worker #ifdef SIGWINCH
75*49cdfc7eSAndroid Build Coastguard Worker PAIR(SIGWINCH)
76*49cdfc7eSAndroid Build Coastguard Worker #endif
77*49cdfc7eSAndroid Build Coastguard Worker
78*49cdfc7eSAndroid Build Coastguard Worker #if defined(SIGIO) && defined(SIGPOLL)
79*49cdfc7eSAndroid Build Coastguard Worker /* SIGPOLL same as SIGIO */
80*49cdfc7eSAndroid Build Coastguard Worker STRPAIR(SIGIO, "SIGIO/SIGPOLL")
81*49cdfc7eSAndroid Build Coastguard Worker #elif defined(SIGIO)
82*49cdfc7eSAndroid Build Coastguard Worker PAIR(SIGIO)
83*49cdfc7eSAndroid Build Coastguard Worker #elif defined(SIGPOLL)
84*49cdfc7eSAndroid Build Coastguard Worker PAIR(SIGPOLL)
85*49cdfc7eSAndroid Build Coastguard Worker #endif
86*49cdfc7eSAndroid Build Coastguard Worker
87*49cdfc7eSAndroid Build Coastguard Worker #ifdef SIGINFO
88*49cdfc7eSAndroid Build Coastguard Worker PAIR(SIGINFO)
89*49cdfc7eSAndroid Build Coastguard Worker #endif
90*49cdfc7eSAndroid Build Coastguard Worker #ifdef SIGLOST
91*49cdfc7eSAndroid Build Coastguard Worker PAIR(SIGLOST)
92*49cdfc7eSAndroid Build Coastguard Worker #endif
93*49cdfc7eSAndroid Build Coastguard Worker #ifdef SIGPWR
94*49cdfc7eSAndroid Build Coastguard Worker PAIR(SIGPWR)
95*49cdfc7eSAndroid Build Coastguard Worker #endif
96*49cdfc7eSAndroid Build Coastguard Worker #if defined(SIGSYS)
97*49cdfc7eSAndroid Build Coastguard Worker /*
98*49cdfc7eSAndroid Build Coastguard Worker * According to signal(7)'s manpage, SIGUNUSED is synonymous
99*49cdfc7eSAndroid Build Coastguard Worker * with SIGSYS on most architectures.
100*49cdfc7eSAndroid Build Coastguard Worker */
101*49cdfc7eSAndroid Build Coastguard Worker STRPAIR(SIGSYS, "SIGSYS/SIGUNUSED")
102*49cdfc7eSAndroid Build Coastguard Worker #endif
103*49cdfc7eSAndroid Build Coastguard Worker };
104*49cdfc7eSAndroid Build Coastguard Worker
105*49cdfc7eSAndroid Build Coastguard Worker PAIR_LOOKUP(signal_pairs, sig);
106*49cdfc7eSAndroid Build Coastguard Worker };
107