| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: setemul.c,v 1.29 2011/04/26 16:57:42 joerg Exp $ */ | | 1 | /* $NetBSD: setemul.c,v 1.30 2018/12/19 16:27:26 martin Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 2000 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 2000 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright | | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
| @@ -52,86 +52,80 @@ | | | @@ -52,86 +52,80 @@ |
52 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | | 52 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
53 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | | 53 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
54 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | | 54 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
55 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 55 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
56 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 56 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
57 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 57 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
58 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 58 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
59 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 59 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
60 | * SUCH DAMAGE. | | 60 | * SUCH DAMAGE. |
61 | */ | | 61 | */ |
62 | | | 62 | |
63 | #include <sys/cdefs.h> | | 63 | #include <sys/cdefs.h> |
64 | #ifndef lint | | 64 | #ifndef lint |
65 | __RCSID("$NetBSD: setemul.c,v 1.29 2011/04/26 16:57:42 joerg Exp $"); | | 65 | __RCSID("$NetBSD: setemul.c,v 1.30 2018/12/19 16:27:26 martin Exp $"); |
66 | #endif /* not lint */ | | 66 | #endif /* not lint */ |
67 | | | 67 | |
68 | #include <sys/param.h> | | 68 | #include <sys/param.h> |
69 | #include <sys/errno.h> | | 69 | #include <sys/errno.h> |
70 | #include <sys/time.h> | | 70 | #include <sys/time.h> |
71 | #include <sys/queue.h> | | 71 | #include <sys/queue.h> |
72 | | | 72 | |
73 | #include <err.h> | | 73 | #include <err.h> |
74 | #include <stdio.h> | | 74 | #include <stdio.h> |
75 | #include <stdlib.h> | | 75 | #include <stdlib.h> |
76 | #include <string.h> | | 76 | #include <string.h> |
77 | #include <unistd.h> | | 77 | #include <unistd.h> |
78 | #include <vis.h> | | 78 | #include <vis.h> |
79 | | | 79 | |
80 | #include "setemul.h" | | 80 | #include "setemul.h" |
81 | | | 81 | |
82 | #include <sys/syscall.h> | | 82 | #include <sys/syscall.h> |
83 | | | 83 | |
84 | #include "../../sys/compat/netbsd32/netbsd32_syscall.h" | | 84 | #include "../../sys/compat/netbsd32/netbsd32_syscall.h" |
85 | #include "../../sys/compat/freebsd/freebsd_syscall.h" | | 85 | #include "../../sys/compat/freebsd/freebsd_syscall.h" |
86 | #include "../../sys/compat/ibcs2/ibcs2_syscall.h" | | 86 | #include "../../sys/compat/ibcs2/ibcs2_syscall.h" |
87 | #include "../../sys/compat/linux/linux_syscall.h" | | 87 | #include "../../sys/compat/linux/linux_syscall.h" |
88 | #include "../../sys/compat/linux32/linux32_syscall.h" | | 88 | #include "../../sys/compat/linux32/linux32_syscall.h" |
89 | #include "../../sys/compat/osf1/osf1_syscall.h" | | 89 | #include "../../sys/compat/osf1/osf1_syscall.h" |
90 | #include "../../sys/compat/sunos32/sunos32_syscall.h" | | 90 | #include "../../sys/compat/sunos32/sunos32_syscall.h" |
91 | #include "../../sys/compat/sunos/sunos_syscall.h" | | 91 | #include "../../sys/compat/sunos/sunos_syscall.h" |
92 | #include "../../sys/compat/svr4/svr4_syscall.h" | | | |
93 | #include "../../sys/compat/svr4_32/svr4_32_syscall.h" | | | |
94 | #include "../../sys/compat/ultrix/ultrix_syscall.h" | | 92 | #include "../../sys/compat/ultrix/ultrix_syscall.h" |
95 | #ifdef __m68k__ | | 93 | #ifdef __m68k__ |
96 | #include "../../sys/compat/aoutm68k/aoutm68k_syscall.h" | | 94 | #include "../../sys/compat/aoutm68k/aoutm68k_syscall.h" |
97 | #endif | | 95 | #endif |
98 | | | 96 | |
99 | #define KTRACE | | 97 | #define KTRACE |
100 | #include "../../sys/kern/syscalls.c" | | 98 | #include "../../sys/kern/syscalls.c" |
101 | | | 99 | |
102 | #include "../../sys/compat/netbsd32/netbsd32_syscalls.c" | | 100 | #include "../../sys/compat/netbsd32/netbsd32_syscalls.c" |
103 | #include "../../sys/compat/freebsd/freebsd_syscalls.c" | | 101 | #include "../../sys/compat/freebsd/freebsd_syscalls.c" |
104 | #include "../../sys/compat/ibcs2/ibcs2_syscalls.c" | | 102 | #include "../../sys/compat/ibcs2/ibcs2_syscalls.c" |
105 | #include "../../sys/compat/linux/linux_syscalls.c" | | 103 | #include "../../sys/compat/linux/linux_syscalls.c" |
106 | #include "../../sys/compat/linux32/linux32_syscalls.c" | | 104 | #include "../../sys/compat/linux32/linux32_syscalls.c" |
107 | #include "../../sys/compat/osf1/osf1_syscalls.c" | | 105 | #include "../../sys/compat/osf1/osf1_syscalls.c" |
108 | #include "../../sys/compat/sunos/sunos_syscalls.c" | | 106 | #include "../../sys/compat/sunos/sunos_syscalls.c" |
109 | #include "../../sys/compat/sunos32/sunos32_syscalls.c" | | 107 | #include "../../sys/compat/sunos32/sunos32_syscalls.c" |
110 | #include "../../sys/compat/svr4/svr4_syscalls.c" | | | |
111 | #include "../../sys/compat/svr4_32/svr4_32_syscalls.c" | | | |
112 | #include "../../sys/compat/ultrix/ultrix_syscalls.c" | | 108 | #include "../../sys/compat/ultrix/ultrix_syscalls.c" |
113 | #ifdef __m68k__ | | 109 | #ifdef __m68k__ |
114 | #include "../../sys/compat/aoutm68k/aoutm68k_syscalls.c" | | 110 | #include "../../sys/compat/aoutm68k/aoutm68k_syscalls.c" |
115 | #endif | | 111 | #endif |
116 | | | 112 | |
117 | #include "../../sys/compat/svr4/svr4_errno.c" | | | |
118 | #include "../../sys/compat/ibcs2/ibcs2_errno.c" | | 113 | #include "../../sys/compat/ibcs2/ibcs2_errno.c" |
119 | #include "../../sys/compat/osf1/osf1_errno.c" | | 114 | #include "../../sys/compat/osf1/osf1_errno.c" |
120 | #include "../../sys/compat/linux/common/linux_errno.c" | | 115 | #include "../../sys/compat/linux/common/linux_errno.c" |
121 | #undef KTRACE | | 116 | #undef KTRACE |
122 | | | 117 | |
123 | #define SIGRTMIN 33 /* XXX */ | | 118 | #define SIGRTMIN 33 /* XXX */ |
124 | #include "../../sys/compat/svr4/svr4_signo.c" | | | |
125 | #include "../../sys/compat/ibcs2/ibcs2_signo.c" | | 119 | #include "../../sys/compat/ibcs2/ibcs2_signo.c" |
126 | #include "../../sys/compat/osf1/osf1_signo.c" | | 120 | #include "../../sys/compat/osf1/osf1_signo.c" |
127 | #include "../../sys/compat/linux/common/linux_signo.c" | | 121 | #include "../../sys/compat/linux/common/linux_signo.c" |
128 | | | 122 | |
129 | #define NELEM(a) (sizeof(a) / sizeof(a[0])) | | 123 | #define NELEM(a) (sizeof(a) / sizeof(a[0])) |
130 | | | 124 | |
131 | /* static */ | | 125 | /* static */ |
132 | const struct emulation emulations[] = { | | 126 | const struct emulation emulations[] = { |
133 | { "netbsd", syscallnames, SYS_MAXSYSCALL, | | 127 | { "netbsd", syscallnames, SYS_MAXSYSCALL, |
134 | NULL, 0, | | 128 | NULL, 0, |
135 | NULL, 0, 0 }, | | 129 | NULL, 0, 0 }, |
136 | | | 130 | |
137 | { "netbsd32", netbsd32_syscallnames, SYS_MAXSYSCALL, | | 131 | { "netbsd32", netbsd32_syscallnames, SYS_MAXSYSCALL, |
| @@ -156,34 +150,26 @@ const struct emulation emulations[] = { | | | @@ -156,34 +150,26 @@ const struct emulation emulations[] = { |
156 | | | 150 | |
157 | { "osf1", osf1_syscallnames, OSF1_SYS_MAXSYSCALL, | | 151 | { "osf1", osf1_syscallnames, OSF1_SYS_MAXSYSCALL, |
158 | native_to_osf1_errno, NELEM(native_to_osf1_errno), | | 152 | native_to_osf1_errno, NELEM(native_to_osf1_errno), |
159 | osf1_to_native_signo, NSIG, 0 }, | | 153 | osf1_to_native_signo, NSIG, 0 }, |
160 | | | 154 | |
161 | { "sunos32", sunos32_syscallnames, SUNOS32_SYS_MAXSYSCALL, | | 155 | { "sunos32", sunos32_syscallnames, SUNOS32_SYS_MAXSYSCALL, |
162 | NULL, 0, | | 156 | NULL, 0, |
163 | NULL, 0, EMUL_FLAG_NETBSD32 }, | | 157 | NULL, 0, EMUL_FLAG_NETBSD32 }, |
164 | | | 158 | |
165 | { "sunos", sunos_syscallnames, SUNOS_SYS_MAXSYSCALL, | | 159 | { "sunos", sunos_syscallnames, SUNOS_SYS_MAXSYSCALL, |
166 | NULL, 0, | | 160 | NULL, 0, |
167 | NULL, 0, 0 }, | | 161 | NULL, 0, 0 }, |
168 | | | 162 | |
169 | { "svr4", svr4_syscallnames, SVR4_SYS_MAXSYSCALL, | | | |
170 | native_to_svr4_errno, NELEM(native_to_svr4_errno), | | | |
171 | svr4_to_native_signo, NSIG, 0 }, | | | |
172 | | | | |
173 | { "svr4_32", svr4_syscallnames, SVR4_SYS_MAXSYSCALL, | | | |
174 | native_to_svr4_errno, NELEM(native_to_svr4_errno), | | | |
175 | svr4_to_native_signo, NSIG, EMUL_FLAG_NETBSD32 }, | | | |
176 | | | | |
177 | { "ultrix", ultrix_syscallnames, ULTRIX_SYS_MAXSYSCALL, | | 163 | { "ultrix", ultrix_syscallnames, ULTRIX_SYS_MAXSYSCALL, |
178 | NULL, 0, | | 164 | NULL, 0, |
179 | NULL, 0, 0 }, | | 165 | NULL, 0, 0 }, |
180 | | | 166 | |
181 | #ifdef __m68k__ | | 167 | #ifdef __m68k__ |
182 | { "aoutm68k", aoutm68k_syscallnames, AOUTM68K_SYS_MAXSYSCALL, | | 168 | { "aoutm68k", aoutm68k_syscallnames, AOUTM68K_SYS_MAXSYSCALL, |
183 | NULL, 0, | | 169 | NULL, 0, |
184 | NULL, 0, 0 }, | | 170 | NULL, 0, 0 }, |
185 | #endif | | 171 | #endif |
186 | | | 172 | |
187 | { NULL, NULL, 0, | | 173 | { NULL, NULL, 0, |
188 | NULL, 0, | | 174 | NULL, 0, |
189 | NULL, 0, 0 } | | 175 | NULL, 0, 0 } |