xref: /netbsd-src/lib/librumpuser/rumpuser_sigtrans.c (revision 437e54a70113ad46fd5928efba3564be6b5ff08c)
1*437e54a7Spooka /*	$NetBSD: rumpuser_sigtrans.c,v 1.1 2014/02/20 00:42:27 pooka Exp $	*/
2*437e54a7Spooka 
3*437e54a7Spooka /*
4*437e54a7Spooka  * pseudo-automatically generated.  PLEASE DO EDIT (e.g. in case there
5*437e54a7Spooka  * are errnos which are defined to be the same value)
6*437e54a7Spooka  *
7*437e54a7Spooka  * The body of the switch statement was generated using:
8*437e54a7Spooka  *
9*437e54a7Spooka  * awk '/^#define/ && $2 ~ "^SIG[A-Z]" \
10*437e54a7Spooka  *   {printf "#ifdef %s\n\tcase %d\t: return %s;\n#endif\n", $2, $3, $2}' \
11*437e54a7Spooka  *   signal.h
12*437e54a7Spooka  */
13*437e54a7Spooka 
14*437e54a7Spooka #include <signal.h>
15*437e54a7Spooka 
16*437e54a7Spooka /*
17*437e54a7Spooka  * Translate rump kernel signal number to host signal number
18*437e54a7Spooka  */
19*437e54a7Spooka int rumpuser__sig_rump2host(int); /* a naughty decouple */
20*437e54a7Spooka int
rumpuser__sig_rump2host(int rumpsig)21*437e54a7Spooka rumpuser__sig_rump2host(int rumpsig)
22*437e54a7Spooka {
23*437e54a7Spooka 
24*437e54a7Spooka 	switch(rumpsig) {
25*437e54a7Spooka 	case 0  : return 0;
26*437e54a7Spooka #ifdef SIGHUP
27*437e54a7Spooka 	case 1	: return SIGHUP;
28*437e54a7Spooka #endif
29*437e54a7Spooka #ifdef SIGINT
30*437e54a7Spooka 	case 2	: return SIGINT;
31*437e54a7Spooka #endif
32*437e54a7Spooka #ifdef SIGQUIT
33*437e54a7Spooka 	case 3	: return SIGQUIT;
34*437e54a7Spooka #endif
35*437e54a7Spooka #ifdef SIGILL
36*437e54a7Spooka 	case 4	: return SIGILL;
37*437e54a7Spooka #endif
38*437e54a7Spooka #ifdef SIGTRAP
39*437e54a7Spooka 	case 5	: return SIGTRAP;
40*437e54a7Spooka #endif
41*437e54a7Spooka #ifdef SIGABRT
42*437e54a7Spooka 	case 6	: return SIGABRT;
43*437e54a7Spooka #endif
44*437e54a7Spooka #ifdef SIGEMT
45*437e54a7Spooka 	case 7	: return SIGEMT;
46*437e54a7Spooka #endif
47*437e54a7Spooka #ifdef SIGFPE
48*437e54a7Spooka 	case 8	: return SIGFPE;
49*437e54a7Spooka #endif
50*437e54a7Spooka #ifdef SIGKILL
51*437e54a7Spooka 	case 9	: return SIGKILL;
52*437e54a7Spooka #endif
53*437e54a7Spooka #ifdef SIGBUS
54*437e54a7Spooka 	case 10	: return SIGBUS;
55*437e54a7Spooka #endif
56*437e54a7Spooka #ifdef SIGSEGV
57*437e54a7Spooka 	case 11	: return SIGSEGV;
58*437e54a7Spooka #endif
59*437e54a7Spooka #ifdef SIGSYS
60*437e54a7Spooka 	case 12	: return SIGSYS;
61*437e54a7Spooka #endif
62*437e54a7Spooka #ifdef SIGPIPE
63*437e54a7Spooka 	case 13	: return SIGPIPE;
64*437e54a7Spooka #endif
65*437e54a7Spooka #ifdef SIGALRM
66*437e54a7Spooka 	case 14	: return SIGALRM;
67*437e54a7Spooka #endif
68*437e54a7Spooka #ifdef SIGTERM
69*437e54a7Spooka 	case 15	: return SIGTERM;
70*437e54a7Spooka #endif
71*437e54a7Spooka #ifdef SIGURG
72*437e54a7Spooka 	case 16	: return SIGURG;
73*437e54a7Spooka #endif
74*437e54a7Spooka #ifdef SIGSTOP
75*437e54a7Spooka 	case 17	: return SIGSTOP;
76*437e54a7Spooka #endif
77*437e54a7Spooka #ifdef SIGTSTP
78*437e54a7Spooka 	case 18	: return SIGTSTP;
79*437e54a7Spooka #endif
80*437e54a7Spooka #ifdef SIGCONT
81*437e54a7Spooka 	case 19	: return SIGCONT;
82*437e54a7Spooka #endif
83*437e54a7Spooka #ifdef SIGCHLD
84*437e54a7Spooka 	case 20	: return SIGCHLD;
85*437e54a7Spooka #elif defined(SIGCLD)
86*437e54a7Spooka 	case 20	: return SIGCLD;
87*437e54a7Spooka #endif
88*437e54a7Spooka #ifdef SIGTTIN
89*437e54a7Spooka 	case 21	: return SIGTTIN;
90*437e54a7Spooka #endif
91*437e54a7Spooka #ifdef SIGTTOU
92*437e54a7Spooka 	case 22	: return SIGTTOU;
93*437e54a7Spooka #endif
94*437e54a7Spooka #ifdef SIGIO
95*437e54a7Spooka 	case 23	: return SIGIO;
96*437e54a7Spooka #endif
97*437e54a7Spooka #ifdef SIGXCPU
98*437e54a7Spooka 	case 24	: return SIGXCPU;
99*437e54a7Spooka #endif
100*437e54a7Spooka #ifdef SIGXFSZ
101*437e54a7Spooka 	case 25	: return SIGXFSZ;
102*437e54a7Spooka #endif
103*437e54a7Spooka #ifdef SIGVTALRM
104*437e54a7Spooka 	case 26	: return SIGVTALRM;
105*437e54a7Spooka #endif
106*437e54a7Spooka #ifdef SIGPROF
107*437e54a7Spooka 	case 27	: return SIGPROF;
108*437e54a7Spooka #endif
109*437e54a7Spooka #ifdef SIGWINCH
110*437e54a7Spooka 	case 28	: return SIGWINCH;
111*437e54a7Spooka #endif
112*437e54a7Spooka #ifdef SIGINFO
113*437e54a7Spooka 	case 29	: return SIGINFO;
114*437e54a7Spooka #endif
115*437e54a7Spooka #ifdef SIGUSR1
116*437e54a7Spooka 	case 30	: return SIGUSR1;
117*437e54a7Spooka #endif
118*437e54a7Spooka #ifdef SIGUSR2
119*437e54a7Spooka 	case 31	: return SIGUSR2;
120*437e54a7Spooka #endif
121*437e54a7Spooka #ifdef SIGPWR
122*437e54a7Spooka 	case 32	: return SIGPWR;
123*437e54a7Spooka #endif
124*437e54a7Spooka 	default:	return -1;
125*437e54a7Spooka 	}
126*437e54a7Spooka }
127