netbsd32_compat_14_sysv.c revision 1.1.2.2 1 1.1.2.2 pgoyette /* $NetBSD: netbsd32_compat_14_sysv.c,v 1.1.2.2 2019/01/03 10:57:32 pgoyette Exp $ */
2 1.1.2.1 pgoyette
3 1.1.2.1 pgoyette /*
4 1.1.2.1 pgoyette * Copyright (c) 1999 Eduardo E. Horvath
5 1.1.2.1 pgoyette * All rights reserved.
6 1.1.2.1 pgoyette *
7 1.1.2.1 pgoyette * Redistribution and use in source and binary forms, with or without
8 1.1.2.1 pgoyette * modification, are permitted provided that the following conditions
9 1.1.2.1 pgoyette * are met:
10 1.1.2.1 pgoyette * 1. Redistributions of source code must retain the above copyright
11 1.1.2.1 pgoyette * notice, this list of conditions and the following disclaimer.
12 1.1.2.1 pgoyette * 2. Redistributions in binary form must reproduce the above copyright
13 1.1.2.1 pgoyette * notice, this list of conditions and the following disclaimer in the
14 1.1.2.1 pgoyette * documentation and/or other materials provided with the distribution.
15 1.1.2.1 pgoyette * 3. The name of the author may not be used to endorse or promote products
16 1.1.2.1 pgoyette * derived from this software without specific prior written permission.
17 1.1.2.1 pgoyette *
18 1.1.2.1 pgoyette * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19 1.1.2.1 pgoyette * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 1.1.2.1 pgoyette * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 1.1.2.1 pgoyette * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 1.1.2.1 pgoyette * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 1.1.2.1 pgoyette * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 1.1.2.1 pgoyette * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
25 1.1.2.1 pgoyette * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 1.1.2.1 pgoyette * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 1.1.2.1 pgoyette * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 1.1.2.1 pgoyette * SUCH DAMAGE.
29 1.1.2.1 pgoyette */
30 1.1.2.1 pgoyette
31 1.1.2.1 pgoyette #include <sys/cdefs.h>
32 1.1.2.2 pgoyette __KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_14_sysv.c,v 1.1.2.2 2019/01/03 10:57:32 pgoyette Exp $");
33 1.1.2.1 pgoyette
34 1.1.2.1 pgoyette #ifdef _KERNEL_OPT
35 1.1.2.1 pgoyette #include "opt_sysv.h"
36 1.1.2.1 pgoyette #include "opt_compat_netbsd.h"
37 1.1.2.1 pgoyette #endif
38 1.1.2.1 pgoyette
39 1.1.2.1 pgoyette #include <sys/param.h>
40 1.1.2.1 pgoyette #include <sys/ipc.h>
41 1.1.2.1 pgoyette #include <sys/systm.h>
42 1.1.2.1 pgoyette #include <sys/module.h>
43 1.1.2.1 pgoyette #include <sys/signal.h>
44 1.1.2.1 pgoyette #include <sys/proc.h>
45 1.1.2.1 pgoyette #include <sys/mount.h>
46 1.1.2.1 pgoyette #include <sys/msg.h>
47 1.1.2.1 pgoyette #include <sys/sem.h>
48 1.1.2.1 pgoyette #include <sys/shm.h>
49 1.1.2.1 pgoyette
50 1.1.2.1 pgoyette #include <sys/syscallargs.h>
51 1.1.2.1 pgoyette #include <sys/syscallvar.h>
52 1.1.2.1 pgoyette
53 1.1.2.1 pgoyette #include <compat/netbsd32/netbsd32.h>
54 1.1.2.1 pgoyette #include <compat/netbsd32/netbsd32_syscall.h>
55 1.1.2.1 pgoyette #include <compat/netbsd32/netbsd32_syscallargs.h>
56 1.1.2.1 pgoyette #include <compat/sys/siginfo.h>
57 1.1.2.1 pgoyette #include <compat/sys/shm.h>
58 1.1.2.1 pgoyette
59 1.1.2.1 pgoyette #if defined(COMPAT_14)
60 1.1.2.1 pgoyette
61 1.1.2.1 pgoyette #if defined(SYSVMSG)
62 1.1.2.1 pgoyette static inline void
63 1.1.2.1 pgoyette netbsd32_ipc_perm14_to_native(struct netbsd32_ipc_perm14 *operm, struct ipc_perm *perm)
64 1.1.2.1 pgoyette {
65 1.1.2.1 pgoyette
66 1.1.2.1 pgoyette #define CVT(x) perm->x = operm->x
67 1.1.2.1 pgoyette CVT(uid);
68 1.1.2.1 pgoyette CVT(gid);
69 1.1.2.1 pgoyette CVT(cuid);
70 1.1.2.1 pgoyette CVT(cgid);
71 1.1.2.1 pgoyette CVT(mode);
72 1.1.2.1 pgoyette #undef CVT
73 1.1.2.1 pgoyette }
74 1.1.2.1 pgoyette
75 1.1.2.1 pgoyette static inline void
76 1.1.2.1 pgoyette native_to_netbsd32_ipc_perm14(struct ipc_perm *perm, struct netbsd32_ipc_perm14 *operm)
77 1.1.2.1 pgoyette {
78 1.1.2.1 pgoyette
79 1.1.2.1 pgoyette #define CVT(x) operm->x = perm->x
80 1.1.2.1 pgoyette CVT(uid);
81 1.1.2.1 pgoyette CVT(gid);
82 1.1.2.1 pgoyette CVT(cuid);
83 1.1.2.1 pgoyette CVT(cgid);
84 1.1.2.1 pgoyette CVT(mode);
85 1.1.2.1 pgoyette #undef CVT
86 1.1.2.1 pgoyette
87 1.1.2.1 pgoyette /*
88 1.1.2.1 pgoyette * Not part of the API, but some programs might look at it.
89 1.1.2.1 pgoyette */
90 1.1.2.1 pgoyette operm->seq = perm->_seq;
91 1.1.2.1 pgoyette operm->key = (key_t)perm->_key;
92 1.1.2.1 pgoyette }
93 1.1.2.1 pgoyette
94 1.1.2.1 pgoyette static inline void
95 1.1.2.1 pgoyette netbsd32_msqid_ds14_to_native(struct netbsd32_msqid_ds14 *omsqbuf, struct msqid_ds *msqbuf)
96 1.1.2.1 pgoyette {
97 1.1.2.1 pgoyette
98 1.1.2.1 pgoyette netbsd32_ipc_perm14_to_native(&omsqbuf->msg_perm, &msqbuf->msg_perm);
99 1.1.2.1 pgoyette
100 1.1.2.1 pgoyette #define CVT(x) msqbuf->x = omsqbuf->x
101 1.1.2.1 pgoyette CVT(msg_qnum);
102 1.1.2.1 pgoyette CVT(msg_qbytes);
103 1.1.2.1 pgoyette CVT(msg_lspid);
104 1.1.2.1 pgoyette CVT(msg_lrpid);
105 1.1.2.1 pgoyette CVT(msg_stime);
106 1.1.2.1 pgoyette CVT(msg_rtime);
107 1.1.2.1 pgoyette CVT(msg_ctime);
108 1.1.2.1 pgoyette #undef CVT
109 1.1.2.1 pgoyette }
110 1.1.2.1 pgoyette
111 1.1.2.1 pgoyette static inline void
112 1.1.2.1 pgoyette native_to_netbsd32_msqid_ds14(struct msqid_ds *msqbuf, struct netbsd32_msqid_ds14 *omsqbuf)
113 1.1.2.1 pgoyette {
114 1.1.2.1 pgoyette
115 1.1.2.2 pgoyette memset(omsqbuf, 0, sizeof(*omsqbuf));
116 1.1.2.1 pgoyette native_to_netbsd32_ipc_perm14(&msqbuf->msg_perm, &omsqbuf->msg_perm);
117 1.1.2.1 pgoyette
118 1.1.2.1 pgoyette #define CVT(x) omsqbuf->x = msqbuf->x
119 1.1.2.1 pgoyette CVT(msg_qnum);
120 1.1.2.1 pgoyette CVT(msg_qbytes);
121 1.1.2.1 pgoyette CVT(msg_lspid);
122 1.1.2.1 pgoyette CVT(msg_lrpid);
123 1.1.2.1 pgoyette CVT(msg_stime);
124 1.1.2.1 pgoyette CVT(msg_rtime);
125 1.1.2.1 pgoyette CVT(msg_ctime);
126 1.1.2.1 pgoyette #undef CVT
127 1.1.2.1 pgoyette
128 1.1.2.1 pgoyette /*
129 1.1.2.1 pgoyette * Not part of the API, but some programs might look at it.
130 1.1.2.1 pgoyette */
131 1.1.2.1 pgoyette omsqbuf->msg_cbytes = msqbuf->_msg_cbytes;
132 1.1.2.1 pgoyette }
133 1.1.2.1 pgoyette #endif
134 1.1.2.1 pgoyette
135 1.1.2.1 pgoyette #if defined(SYSVSEM)
136 1.1.2.1 pgoyette static inline void
137 1.1.2.1 pgoyette netbsd32_semid_ds14_to_native(struct netbsd32_semid_ds14 *osembuf, struct semid_ds *sembuf)
138 1.1.2.1 pgoyette {
139 1.1.2.1 pgoyette
140 1.1.2.1 pgoyette netbsd32_ipc_perm14_to_native(&osembuf->sem_perm, &sembuf->sem_perm);
141 1.1.2.1 pgoyette
142 1.1.2.1 pgoyette #define CVT(x) sembuf->x = osembuf->x
143 1.1.2.1 pgoyette CVT(sem_nsems);
144 1.1.2.1 pgoyette CVT(sem_otime);
145 1.1.2.1 pgoyette CVT(sem_ctime);
146 1.1.2.1 pgoyette #undef CVT
147 1.1.2.1 pgoyette }
148 1.1.2.1 pgoyette
149 1.1.2.1 pgoyette static inline void
150 1.1.2.1 pgoyette native_to_netbsd32_semid_ds14(struct semid_ds *sembuf, struct netbsd32_semid_ds14 *osembuf)
151 1.1.2.1 pgoyette {
152 1.1.2.1 pgoyette
153 1.1.2.1 pgoyette native_to_netbsd32_ipc_perm14(&sembuf->sem_perm, &osembuf->sem_perm);
154 1.1.2.1 pgoyette
155 1.1.2.1 pgoyette #define CVT(x) osembuf->x = sembuf->x
156 1.1.2.1 pgoyette CVT(sem_nsems);
157 1.1.2.1 pgoyette CVT(sem_otime);
158 1.1.2.1 pgoyette CVT(sem_ctime);
159 1.1.2.1 pgoyette #undef CVT
160 1.1.2.1 pgoyette }
161 1.1.2.1 pgoyette
162 1.1.2.1 pgoyette static inline void
163 1.1.2.1 pgoyette netbsd32_shmid_ds14_to_native(struct netbsd32_shmid_ds14 *oshmbuf, struct shmid_ds *shmbuf)
164 1.1.2.1 pgoyette {
165 1.1.2.1 pgoyette
166 1.1.2.1 pgoyette netbsd32_ipc_perm14_to_native(&oshmbuf->shm_perm, &shmbuf->shm_perm);
167 1.1.2.1 pgoyette
168 1.1.2.1 pgoyette #define CVT(x) shmbuf->x = oshmbuf->x
169 1.1.2.1 pgoyette CVT(shm_segsz);
170 1.1.2.1 pgoyette CVT(shm_lpid);
171 1.1.2.1 pgoyette CVT(shm_cpid);
172 1.1.2.1 pgoyette CVT(shm_nattch);
173 1.1.2.1 pgoyette CVT(shm_atime);
174 1.1.2.1 pgoyette CVT(shm_dtime);
175 1.1.2.1 pgoyette CVT(shm_ctime);
176 1.1.2.1 pgoyette #undef CVT
177 1.1.2.1 pgoyette }
178 1.1.2.1 pgoyette
179 1.1.2.1 pgoyette static inline void
180 1.1.2.1 pgoyette native_to_netbsd32_shmid_ds14(struct shmid_ds *shmbuf, struct netbsd32_shmid_ds14 *oshmbuf)
181 1.1.2.1 pgoyette {
182 1.1.2.1 pgoyette
183 1.1.2.1 pgoyette native_to_netbsd32_ipc_perm14(&shmbuf->shm_perm, &oshmbuf->shm_perm);
184 1.1.2.1 pgoyette
185 1.1.2.1 pgoyette #define CVT(x) oshmbuf->x = shmbuf->x
186 1.1.2.1 pgoyette CVT(shm_segsz);
187 1.1.2.1 pgoyette CVT(shm_lpid);
188 1.1.2.1 pgoyette CVT(shm_cpid);
189 1.1.2.1 pgoyette CVT(shm_nattch);
190 1.1.2.1 pgoyette CVT(shm_atime);
191 1.1.2.1 pgoyette CVT(shm_dtime);
192 1.1.2.1 pgoyette CVT(shm_ctime);
193 1.1.2.1 pgoyette #undef CVT
194 1.1.2.1 pgoyette }
195 1.1.2.1 pgoyette
196 1.1.2.1 pgoyette /*
197 1.1.2.1 pgoyette * the compat_14 system calls
198 1.1.2.1 pgoyette */
199 1.1.2.1 pgoyette int
200 1.1.2.1 pgoyette compat_14_netbsd32_msgctl(struct lwp *l, const struct compat_14_netbsd32_msgctl_args *uap, register_t *retval)
201 1.1.2.1 pgoyette {
202 1.1.2.1 pgoyette /* {
203 1.1.2.1 pgoyette syscallarg(int) msqid;
204 1.1.2.1 pgoyette syscallarg(int) cmd;
205 1.1.2.1 pgoyette syscallarg(struct msqid_ds14 *) buf;
206 1.1.2.1 pgoyette } */
207 1.1.2.1 pgoyette struct msqid_ds msqbuf;
208 1.1.2.1 pgoyette struct netbsd32_msqid_ds14 omsqbuf;
209 1.1.2.1 pgoyette int cmd, error;
210 1.1.2.1 pgoyette
211 1.1.2.1 pgoyette cmd = SCARG(uap, cmd);
212 1.1.2.1 pgoyette
213 1.1.2.1 pgoyette if (cmd == IPC_SET) {
214 1.1.2.1 pgoyette error = copyin(SCARG_P32(uap, buf),
215 1.1.2.1 pgoyette &omsqbuf, sizeof(omsqbuf));
216 1.1.2.1 pgoyette if (error)
217 1.1.2.1 pgoyette return (error);
218 1.1.2.1 pgoyette netbsd32_msqid_ds14_to_native(&omsqbuf, &msqbuf);
219 1.1.2.1 pgoyette }
220 1.1.2.1 pgoyette
221 1.1.2.1 pgoyette error = msgctl1(l, SCARG(uap, msqid), cmd,
222 1.1.2.1 pgoyette (cmd == IPC_SET || cmd == IPC_STAT) ? &msqbuf : NULL);
223 1.1.2.1 pgoyette
224 1.1.2.1 pgoyette if (error == 0 && cmd == IPC_STAT) {
225 1.1.2.1 pgoyette native_to_netbsd32_msqid_ds14(&msqbuf, &omsqbuf);
226 1.1.2.1 pgoyette error = copyout(&omsqbuf,
227 1.1.2.1 pgoyette SCARG_P32(uap, buf), sizeof(omsqbuf));
228 1.1.2.1 pgoyette }
229 1.1.2.1 pgoyette
230 1.1.2.1 pgoyette return (error);
231 1.1.2.1 pgoyette }
232 1.1.2.1 pgoyette #endif
233 1.1.2.1 pgoyette
234 1.1.2.1 pgoyette #if defined(SYSVSEM)
235 1.1.2.1 pgoyette int
236 1.1.2.1 pgoyette compat_14_netbsd32___semctl(struct lwp *l, const struct compat_14_netbsd32___semctl_args *uap, register_t *retval)
237 1.1.2.1 pgoyette {
238 1.1.2.1 pgoyette /* {
239 1.1.2.1 pgoyette syscallarg(int) semid;
240 1.1.2.1 pgoyette syscallarg(int) semnum;
241 1.1.2.1 pgoyette syscallarg(int) cmd;
242 1.1.2.1 pgoyette syscallarg(union __semun *) arg;
243 1.1.2.1 pgoyette } */
244 1.1.2.1 pgoyette union __semun arg;
245 1.1.2.1 pgoyette struct semid_ds sembuf;
246 1.1.2.1 pgoyette struct netbsd32_semid_ds14 osembuf;
247 1.1.2.1 pgoyette int cmd, error;
248 1.1.2.1 pgoyette void *pass_arg = NULL;
249 1.1.2.1 pgoyette
250 1.1.2.1 pgoyette cmd = SCARG(uap, cmd);
251 1.1.2.1 pgoyette
252 1.1.2.1 pgoyette switch (cmd) {
253 1.1.2.1 pgoyette case IPC_SET:
254 1.1.2.1 pgoyette case IPC_STAT:
255 1.1.2.1 pgoyette pass_arg = &sembuf;
256 1.1.2.1 pgoyette break;
257 1.1.2.1 pgoyette
258 1.1.2.1 pgoyette case GETALL:
259 1.1.2.1 pgoyette case SETVAL:
260 1.1.2.1 pgoyette case SETALL:
261 1.1.2.1 pgoyette pass_arg = &arg;
262 1.1.2.1 pgoyette break;
263 1.1.2.1 pgoyette }
264 1.1.2.1 pgoyette
265 1.1.2.1 pgoyette if (pass_arg != NULL) {
266 1.1.2.1 pgoyette error = copyin(NETBSD32IPTR64(SCARG(uap, arg)), &arg,
267 1.1.2.1 pgoyette sizeof(arg));
268 1.1.2.1 pgoyette if (error)
269 1.1.2.1 pgoyette return (error);
270 1.1.2.1 pgoyette if (cmd == IPC_SET) {
271 1.1.2.1 pgoyette error = copyin(arg.buf, &osembuf, sizeof(osembuf));
272 1.1.2.1 pgoyette if (error)
273 1.1.2.1 pgoyette return (error);
274 1.1.2.1 pgoyette netbsd32_semid_ds14_to_native(&osembuf, &sembuf);
275 1.1.2.1 pgoyette }
276 1.1.2.1 pgoyette }
277 1.1.2.1 pgoyette
278 1.1.2.1 pgoyette error = semctl1(l, SCARG(uap, semid), SCARG(uap, semnum), cmd,
279 1.1.2.1 pgoyette pass_arg, retval);
280 1.1.2.1 pgoyette
281 1.1.2.1 pgoyette if (error == 0 && cmd == IPC_STAT) {
282 1.1.2.1 pgoyette native_to_netbsd32_semid_ds14(&sembuf, &osembuf);
283 1.1.2.1 pgoyette error = copyout(&osembuf, arg.buf, sizeof(osembuf));
284 1.1.2.1 pgoyette }
285 1.1.2.1 pgoyette
286 1.1.2.1 pgoyette return (error);
287 1.1.2.1 pgoyette }
288 1.1.2.1 pgoyette #endif
289 1.1.2.1 pgoyette
290 1.1.2.1 pgoyette #if defined(SYSVSHM)
291 1.1.2.1 pgoyette int
292 1.1.2.1 pgoyette compat_14_netbsd32_shmctl(struct lwp *l, const struct compat_14_netbsd32_shmctl_args *uap, register_t *retval)
293 1.1.2.1 pgoyette {
294 1.1.2.1 pgoyette /* {
295 1.1.2.1 pgoyette syscallarg(int) shmid;
296 1.1.2.1 pgoyette syscallarg(int) cmd;
297 1.1.2.1 pgoyette syscallarg(struct netbsd32_shmid_ds14 *) buf;
298 1.1.2.1 pgoyette } */
299 1.1.2.1 pgoyette struct shmid_ds shmbuf;
300 1.1.2.1 pgoyette struct netbsd32_shmid_ds14 oshmbuf;
301 1.1.2.1 pgoyette int cmd, error;
302 1.1.2.1 pgoyette
303 1.1.2.1 pgoyette cmd = SCARG(uap, cmd);
304 1.1.2.1 pgoyette
305 1.1.2.1 pgoyette if (cmd == IPC_SET) {
306 1.1.2.1 pgoyette error = copyin(SCARG_P32(uap, buf), &oshmbuf, sizeof(oshmbuf));
307 1.1.2.1 pgoyette if (error)
308 1.1.2.1 pgoyette return (error);
309 1.1.2.1 pgoyette netbsd32_shmid_ds14_to_native(&oshmbuf, &shmbuf);
310 1.1.2.1 pgoyette }
311 1.1.2.1 pgoyette
312 1.1.2.1 pgoyette error = shmctl1(l, SCARG(uap, shmid), cmd,
313 1.1.2.1 pgoyette (cmd == IPC_SET || cmd == IPC_STAT) ? &shmbuf : NULL);
314 1.1.2.1 pgoyette
315 1.1.2.1 pgoyette if (error == 0 && cmd == IPC_STAT) {
316 1.1.2.1 pgoyette native_to_netbsd32_shmid_ds14(&shmbuf, &oshmbuf);
317 1.1.2.1 pgoyette error = copyout(&oshmbuf, SCARG_P32(uap, buf), sizeof(oshmbuf));
318 1.1.2.1 pgoyette }
319 1.1.2.1 pgoyette
320 1.1.2.1 pgoyette return (error);
321 1.1.2.1 pgoyette }
322 1.1.2.1 pgoyette #endif
323 1.1.2.1 pgoyette
324 1.1.2.1 pgoyette #define REQ1 "sysv_ipc,compat_sysv_14,"
325 1.1.2.1 pgoyette #define REQ2 "compat_netbsd32,compat_netbsd32_sysvipc,"
326 1.1.2.1 pgoyette #define REQ3 "compat_netbsd32_sysvipc_50"
327 1.1.2.1 pgoyette
328 1.1.2.1 pgoyette #define _PKG_ENTRY(name) \
329 1.1.2.1 pgoyette { NETBSD32_SYS_ ## name, 0, (sy_call_t *)name }
330 1.1.2.1 pgoyette
331 1.1.2.1 pgoyette static const struct syscall_package compat_sysvipc_14_syscalls[] = {
332 1.1.2.1 pgoyette #if defined(SYSVSEM)
333 1.1.2.1 pgoyette _PKG_ENTRY(compat_14_netbsd32___semctl),
334 1.1.2.1 pgoyette #endif
335 1.1.2.1 pgoyette #if defined(SYSVSHM)
336 1.1.2.1 pgoyette _PKG_ENTRY(compat_14_netbsd32_shmctl),
337 1.1.2.1 pgoyette #endif
338 1.1.2.1 pgoyette #if defined(SYSVMSG)
339 1.1.2.1 pgoyette _PKG_ENTRY(compat_14_netbsd32_msgctl),
340 1.1.2.1 pgoyette #endif
341 1.1.2.1 pgoyette { 0, 0, NULL }
342 1.1.2.1 pgoyette };
343 1.1.2.1 pgoyette
344 1.1.2.1 pgoyette #define REQ1 "sysv_ipc,compat_sysv_14,"
345 1.1.2.1 pgoyette #define REQ2 "compat_netbsd32,compat_netbsd32_sysvipc,"
346 1.1.2.1 pgoyette #define REQ3 "compat_netbsd32_sysvipc_50"
347 1.1.2.1 pgoyette
348 1.1.2.1 pgoyette MODULE(MODULE_CLASS_EXEC, compat_netbsd32_sysvipc_14, REQ1 REQ2 REQ3 );
349 1.1.2.1 pgoyette
350 1.1.2.1 pgoyette static int
351 1.1.2.1 pgoyette compat_netbsd32_sysvipc_14_modcmd(modcmd_t cmd, void *arg)
352 1.1.2.1 pgoyette {
353 1.1.2.1 pgoyette
354 1.1.2.1 pgoyette switch (cmd) {
355 1.1.2.1 pgoyette case MODULE_CMD_INIT:
356 1.1.2.1 pgoyette return syscall_establish(&emul_netbsd32,
357 1.1.2.1 pgoyette compat_sysvipc_14_syscalls);
358 1.1.2.1 pgoyette
359 1.1.2.1 pgoyette case MODULE_CMD_FINI:
360 1.1.2.1 pgoyette return syscall_disestablish(&emul_netbsd32,
361 1.1.2.1 pgoyette compat_sysvipc_14_syscalls);
362 1.1.2.1 pgoyette
363 1.1.2.1 pgoyette default:
364 1.1.2.1 pgoyette return ENOTTY;
365 1.1.2.1 pgoyette }
366 1.1.2.1 pgoyette }
367 1.1.2.1 pgoyette
368 1.1.2.1 pgoyette #endif /* COMPAT_14 */
369