netbsd32_netbsd.c revision 1.77 1 1.77 atatat /* $NetBSD: netbsd32_netbsd.c,v 1.77 2003/12/04 19:38:23 atatat Exp $ */
2 1.1 mrg
3 1.1 mrg /*
4 1.57 mrg * Copyright (c) 1998, 2001 Matthew R. Green
5 1.1 mrg * All rights reserved.
6 1.1 mrg *
7 1.1 mrg * Redistribution and use in source and binary forms, with or without
8 1.1 mrg * modification, are permitted provided that the following conditions
9 1.1 mrg * are met:
10 1.1 mrg * 1. Redistributions of source code must retain the above copyright
11 1.1 mrg * notice, this list of conditions and the following disclaimer.
12 1.1 mrg * 2. Redistributions in binary form must reproduce the above copyright
13 1.1 mrg * notice, this list of conditions and the following disclaimer in the
14 1.1 mrg * documentation and/or other materials provided with the distribution.
15 1.1 mrg * 3. The name of the author may not be used to endorse or promote products
16 1.1 mrg * derived from this software without specific prior written permission.
17 1.1 mrg *
18 1.1 mrg * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19 1.1 mrg * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 1.1 mrg * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 1.1 mrg * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 1.1 mrg * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 1.1 mrg * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 1.1 mrg * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
25 1.1 mrg * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 1.1 mrg * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 1.1 mrg * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 1.1 mrg * SUCH DAMAGE.
29 1.1 mrg */
30 1.62 lukem
31 1.62 lukem #include <sys/cdefs.h>
32 1.77 atatat __KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.77 2003/12/04 19:38:23 atatat Exp $");
33 1.1 mrg
34 1.58 mrg #if defined(_KERNEL_OPT)
35 1.28 eeh #include "opt_ddb.h"
36 1.4 eeh #include "opt_ktrace.h"
37 1.6 eeh #include "opt_ntp.h"
38 1.20 eeh #include "opt_compat_netbsd.h"
39 1.7 drochner #include "opt_compat_43.h"
40 1.20 eeh #include "opt_sysv.h"
41 1.71 martin #include "opt_nfsserver.h"
42 1.71 martin #include "opt_syscall_debug.h"
43 1.7 drochner
44 1.6 eeh #include "fs_lfs.h"
45 1.6 eeh #include "fs_nfs.h"
46 1.42 jdolecek #endif
47 1.42 jdolecek
48 1.42 jdolecek /*
49 1.42 jdolecek * Though COMPAT_OLDSOCK is needed only for COMPAT_43, SunOS, Linux,
50 1.42 jdolecek * HP-UX, FreeBSD, Ultrix, OSF1, we define it unconditionally so that
51 1.42 jdolecek * this would be LKM-safe.
52 1.42 jdolecek */
53 1.42 jdolecek #define COMPAT_OLDSOCK /* used by <sys/socket.h> */
54 1.4 eeh
55 1.1 mrg #include <sys/param.h>
56 1.1 mrg #include <sys/systm.h>
57 1.6 eeh #include <sys/kernel.h>
58 1.57 mrg //#define msg __msg /* Don't ask me! */
59 1.1 mrg #include <sys/malloc.h>
60 1.1 mrg #include <sys/mount.h>
61 1.1 mrg #include <sys/socket.h>
62 1.1 mrg #include <sys/sockio.h>
63 1.6 eeh #include <sys/socketvar.h>
64 1.6 eeh #include <sys/mbuf.h>
65 1.1 mrg #include <sys/stat.h>
66 1.1 mrg #include <sys/time.h>
67 1.4 eeh #include <sys/signalvar.h>
68 1.6 eeh #include <sys/ptrace.h>
69 1.6 eeh #include <sys/ktrace.h>
70 1.6 eeh #include <sys/trace.h>
71 1.6 eeh #include <sys/resourcevar.h>
72 1.6 eeh #include <sys/pool.h>
73 1.6 eeh #include <sys/vnode.h>
74 1.6 eeh #include <sys/file.h>
75 1.6 eeh #include <sys/filedesc.h>
76 1.6 eeh #include <sys/namei.h>
77 1.29 mrg
78 1.29 mrg #include <uvm/uvm_extern.h>
79 1.29 mrg
80 1.70 thorpej #include <sys/sa.h>
81 1.1 mrg #include <sys/syscallargs.h>
82 1.6 eeh #include <sys/proc.h>
83 1.20 eeh #include <sys/acct.h>
84 1.20 eeh #include <sys/exec.h>
85 1.1 mrg
86 1.1 mrg #include <net/if.h>
87 1.1 mrg
88 1.10 mrg #include <compat/netbsd32/netbsd32.h>
89 1.75 christos #include <compat/netbsd32/netbsd32_exec.h>
90 1.42 jdolecek #include <compat/netbsd32/netbsd32_syscall.h>
91 1.10 mrg #include <compat/netbsd32/netbsd32_syscallargs.h>
92 1.56 mrg #include <compat/netbsd32/netbsd32_conv.h>
93 1.1 mrg
94 1.4 eeh #include <machine/frame.h>
95 1.28 eeh
96 1.28 eeh #if defined(DDB)
97 1.28 eeh #include <ddb/ddbvar.h>
98 1.28 eeh #endif
99 1.4 eeh
100 1.42 jdolecek extern char netbsd32_sigcode[], netbsd32_esigcode[];
101 1.42 jdolecek extern struct sysent netbsd32_sysent[];
102 1.42 jdolecek #ifdef SYSCALL_DEBUG
103 1.42 jdolecek extern const char * const netbsd32_syscallnames[];
104 1.42 jdolecek #endif
105 1.46 mycroft #ifdef __HAVE_SYSCALL_INTERN
106 1.60 fvdl void netbsd32_syscall_intern __P((struct proc *));
107 1.46 mycroft #else
108 1.45 jdolecek void syscall __P((void));
109 1.46 mycroft #endif
110 1.42 jdolecek
111 1.74 chs struct uvm_object *emul_netbsd32_object;
112 1.77 atatat extern struct sysctlnode netbsd32_sysctl_root;
113 1.74 chs
114 1.42 jdolecek const struct emul emul_netbsd32 = {
115 1.42 jdolecek "netbsd32",
116 1.42 jdolecek "/emul/netbsd32",
117 1.46 mycroft #ifndef __HAVE_MINIMAL_EMUL
118 1.46 mycroft 0,
119 1.42 jdolecek NULL,
120 1.42 jdolecek netbsd32_SYS_syscall,
121 1.67 jdolecek netbsd32_SYS_NSYSENT,
122 1.46 mycroft #endif
123 1.42 jdolecek netbsd32_sysent,
124 1.42 jdolecek #ifdef SYSCALL_DEBUG
125 1.42 jdolecek netbsd32_syscallnames,
126 1.42 jdolecek #else
127 1.42 jdolecek NULL,
128 1.42 jdolecek #endif
129 1.46 mycroft netbsd32_sendsig,
130 1.59 christos trapsignal,
131 1.76 manu NULL,
132 1.42 jdolecek netbsd32_sigcode,
133 1.42 jdolecek netbsd32_esigcode,
134 1.74 chs &emul_netbsd32_object,
135 1.61 jdolecek netbsd32_setregs,
136 1.45 jdolecek NULL,
137 1.45 jdolecek NULL,
138 1.45 jdolecek NULL,
139 1.46 mycroft #ifdef __HAVE_SYSCALL_INTERN
140 1.60 fvdl netbsd32_syscall_intern,
141 1.46 mycroft #else
142 1.46 mycroft syscall,
143 1.46 mycroft #endif
144 1.77 atatat &netbsd32_sysctl_root,
145 1.65 manu NULL,
146 1.42 jdolecek };
147 1.42 jdolecek
148 1.1 mrg /*
149 1.1 mrg * below are all the standard NetBSD system calls, in the 32bit
150 1.32 mrg * environment, with the necessary conversions to 64bit before
151 1.57 mrg * calling the real syscall. anything that needs special
152 1.57 mrg * attention is handled elsewhere.
153 1.1 mrg */
154 1.1 mrg
155 1.6 eeh int
156 1.70 thorpej netbsd32_exit(l, v, retval)
157 1.70 thorpej struct lwp *l;
158 1.6 eeh void *v;
159 1.6 eeh register_t *retval;
160 1.6 eeh {
161 1.19 eeh struct netbsd32_exit_args /* {
162 1.6 eeh syscallarg(int) rval;
163 1.6 eeh } */ *uap = v;
164 1.6 eeh struct sys_exit_args ua;
165 1.6 eeh
166 1.11 mrg NETBSD32TO64_UAP(rval);
167 1.70 thorpej return sys_exit(l, &ua, retval);
168 1.6 eeh }
169 1.6 eeh
170 1.1 mrg int
171 1.70 thorpej netbsd32_read(l, v, retval)
172 1.70 thorpej struct lwp *l;
173 1.1 mrg void *v;
174 1.1 mrg register_t *retval;
175 1.1 mrg {
176 1.19 eeh struct netbsd32_read_args /* {
177 1.1 mrg syscallarg(int) fd;
178 1.10 mrg syscallarg(netbsd32_voidp) buf;
179 1.10 mrg syscallarg(netbsd32_size_t) nbyte;
180 1.1 mrg } */ *uap = v;
181 1.1 mrg struct sys_read_args ua;
182 1.1 mrg
183 1.11 mrg NETBSD32TO64_UAP(fd);
184 1.11 mrg NETBSD32TOP_UAP(buf, void *);
185 1.11 mrg NETBSD32TOX_UAP(nbyte, size_t);
186 1.70 thorpej return sys_read(l, &ua, retval);
187 1.1 mrg }
188 1.1 mrg
189 1.1 mrg int
190 1.70 thorpej netbsd32_write(l, v, retval)
191 1.70 thorpej struct lwp *l;
192 1.1 mrg void *v;
193 1.1 mrg register_t *retval;
194 1.1 mrg {
195 1.19 eeh struct netbsd32_write_args /* {
196 1.1 mrg syscallarg(int) fd;
197 1.10 mrg syscallarg(const netbsd32_voidp) buf;
198 1.10 mrg syscallarg(netbsd32_size_t) nbyte;
199 1.1 mrg } */ *uap = v;
200 1.1 mrg struct sys_write_args ua;
201 1.1 mrg
202 1.11 mrg NETBSD32TO64_UAP(fd);
203 1.11 mrg NETBSD32TOP_UAP(buf, void *);
204 1.11 mrg NETBSD32TOX_UAP(nbyte, size_t);
205 1.70 thorpej return sys_write(l, &ua, retval);
206 1.6 eeh }
207 1.6 eeh
208 1.6 eeh int
209 1.70 thorpej netbsd32_close(l, v, retval)
210 1.70 thorpej struct lwp *l;
211 1.6 eeh void *v;
212 1.6 eeh register_t *retval;
213 1.6 eeh {
214 1.19 eeh struct netbsd32_close_args /* {
215 1.6 eeh syscallarg(int) fd;
216 1.6 eeh } */ *uap = v;
217 1.6 eeh struct sys_close_args ua;
218 1.1 mrg
219 1.11 mrg NETBSD32TO64_UAP(fd);
220 1.70 thorpej return sys_close(l, &ua, retval);
221 1.1 mrg }
222 1.1 mrg
223 1.1 mrg int
224 1.70 thorpej netbsd32_open(l, v, retval)
225 1.70 thorpej struct lwp *l;
226 1.1 mrg void *v;
227 1.1 mrg register_t *retval;
228 1.1 mrg {
229 1.19 eeh struct netbsd32_open_args /* {
230 1.10 mrg syscallarg(const netbsd32_charp) path;
231 1.1 mrg syscallarg(int) flags;
232 1.1 mrg syscallarg(mode_t) mode;
233 1.1 mrg } */ *uap = v;
234 1.1 mrg struct sys_open_args ua;
235 1.1 mrg caddr_t sg;
236 1.1 mrg
237 1.11 mrg NETBSD32TOP_UAP(path, const char);
238 1.11 mrg NETBSD32TO64_UAP(flags);
239 1.11 mrg NETBSD32TO64_UAP(mode);
240 1.70 thorpej sg = stackgap_init(l->l_proc, 0);
241 1.73 fvdl CHECK_ALT_EXIST(l->l_proc, &sg, SCARG(&ua, path));
242 1.1 mrg
243 1.70 thorpej return (sys_open(l, &ua, retval));
244 1.1 mrg }
245 1.1 mrg
246 1.1 mrg int
247 1.70 thorpej netbsd32_link(l, v, retval)
248 1.70 thorpej struct lwp *l;
249 1.1 mrg void *v;
250 1.1 mrg register_t *retval;
251 1.1 mrg {
252 1.19 eeh struct netbsd32_link_args /* {
253 1.10 mrg syscallarg(const netbsd32_charp) path;
254 1.10 mrg syscallarg(const netbsd32_charp) link;
255 1.1 mrg } */ *uap = v;
256 1.1 mrg struct sys_link_args ua;
257 1.1 mrg
258 1.11 mrg NETBSD32TOP_UAP(path, const char);
259 1.11 mrg NETBSD32TOP_UAP(link, const char);
260 1.70 thorpej return (sys_link(l, &ua, retval));
261 1.1 mrg }
262 1.1 mrg
263 1.1 mrg int
264 1.70 thorpej netbsd32_unlink(l, v, retval)
265 1.70 thorpej struct lwp *l;
266 1.1 mrg void *v;
267 1.1 mrg register_t *retval;
268 1.1 mrg {
269 1.19 eeh struct netbsd32_unlink_args /* {
270 1.10 mrg syscallarg(const netbsd32_charp) path;
271 1.1 mrg } */ *uap = v;
272 1.1 mrg struct sys_unlink_args ua;
273 1.1 mrg
274 1.11 mrg NETBSD32TOP_UAP(path, const char);
275 1.1 mrg
276 1.70 thorpej return (sys_unlink(l, &ua, retval));
277 1.1 mrg }
278 1.1 mrg
279 1.1 mrg int
280 1.70 thorpej netbsd32_chdir(l, v, retval)
281 1.70 thorpej struct lwp *l;
282 1.1 mrg void *v;
283 1.1 mrg register_t *retval;
284 1.1 mrg {
285 1.19 eeh struct netbsd32_chdir_args /* {
286 1.10 mrg syscallarg(const netbsd32_charp) path;
287 1.1 mrg } */ *uap = v;
288 1.1 mrg struct sys_chdir_args ua;
289 1.1 mrg
290 1.11 mrg NETBSD32TOP_UAP(path, const char);
291 1.1 mrg
292 1.70 thorpej return (sys_chdir(l, &ua, retval));
293 1.1 mrg }
294 1.1 mrg
295 1.1 mrg int
296 1.70 thorpej netbsd32_fchdir(l, v, retval)
297 1.70 thorpej struct lwp *l;
298 1.6 eeh void *v;
299 1.6 eeh register_t *retval;
300 1.6 eeh {
301 1.19 eeh struct netbsd32_fchdir_args /* {
302 1.6 eeh syscallarg(int) fd;
303 1.6 eeh } */ *uap = v;
304 1.6 eeh struct sys_fchdir_args ua;
305 1.6 eeh
306 1.11 mrg NETBSD32TO64_UAP(fd);
307 1.6 eeh
308 1.70 thorpej return (sys_fchdir(l, &ua, retval));
309 1.6 eeh }
310 1.6 eeh
311 1.6 eeh int
312 1.70 thorpej netbsd32_mknod(l, v, retval)
313 1.70 thorpej struct lwp *l;
314 1.1 mrg void *v;
315 1.1 mrg register_t *retval;
316 1.1 mrg {
317 1.19 eeh struct netbsd32_mknod_args /* {
318 1.10 mrg syscallarg(const netbsd32_charp) path;
319 1.1 mrg syscallarg(mode_t) mode;
320 1.1 mrg syscallarg(dev_t) dev;
321 1.1 mrg } */ *uap = v;
322 1.1 mrg struct sys_mknod_args ua;
323 1.1 mrg
324 1.11 mrg NETBSD32TOP_UAP(path, const char);
325 1.11 mrg NETBSD32TO64_UAP(dev);
326 1.11 mrg NETBSD32TO64_UAP(mode);
327 1.1 mrg
328 1.70 thorpej return (sys_mknod(l, &ua, retval));
329 1.1 mrg }
330 1.1 mrg
331 1.1 mrg int
332 1.70 thorpej netbsd32_chmod(l, v, retval)
333 1.70 thorpej struct lwp *l;
334 1.1 mrg void *v;
335 1.1 mrg register_t *retval;
336 1.1 mrg {
337 1.19 eeh struct netbsd32_chmod_args /* {
338 1.10 mrg syscallarg(const netbsd32_charp) path;
339 1.1 mrg syscallarg(mode_t) mode;
340 1.1 mrg } */ *uap = v;
341 1.1 mrg struct sys_chmod_args ua;
342 1.1 mrg
343 1.11 mrg NETBSD32TOP_UAP(path, const char);
344 1.11 mrg NETBSD32TO64_UAP(mode);
345 1.1 mrg
346 1.70 thorpej return (sys_chmod(l, &ua, retval));
347 1.1 mrg }
348 1.1 mrg
349 1.1 mrg int
350 1.70 thorpej netbsd32_chown(l, v, retval)
351 1.70 thorpej struct lwp *l;
352 1.1 mrg void *v;
353 1.1 mrg register_t *retval;
354 1.1 mrg {
355 1.19 eeh struct netbsd32_chown_args /* {
356 1.10 mrg syscallarg(const netbsd32_charp) path;
357 1.1 mrg syscallarg(uid_t) uid;
358 1.1 mrg syscallarg(gid_t) gid;
359 1.1 mrg } */ *uap = v;
360 1.1 mrg struct sys_chown_args ua;
361 1.1 mrg
362 1.11 mrg NETBSD32TOP_UAP(path, const char);
363 1.11 mrg NETBSD32TO64_UAP(uid);
364 1.11 mrg NETBSD32TO64_UAP(gid);
365 1.1 mrg
366 1.70 thorpej return (sys_chown(l, &ua, retval));
367 1.1 mrg }
368 1.1 mrg
369 1.1 mrg int
370 1.70 thorpej netbsd32_break(l, v, retval)
371 1.70 thorpej struct lwp *l;
372 1.1 mrg void *v;
373 1.1 mrg register_t *retval;
374 1.1 mrg {
375 1.19 eeh struct netbsd32_break_args /* {
376 1.10 mrg syscallarg(netbsd32_charp) nsize;
377 1.1 mrg } */ *uap = v;
378 1.1 mrg struct sys_obreak_args ua;
379 1.1 mrg
380 1.66 scw SCARG(&ua, nsize) = (char *)NETBSD32PTR64(SCARG(uap, nsize));
381 1.11 mrg NETBSD32TOP_UAP(nsize, char);
382 1.70 thorpej return (sys_obreak(l, &ua, retval));
383 1.1 mrg }
384 1.1 mrg
385 1.1 mrg int
386 1.70 thorpej netbsd32_mount(l, v, retval)
387 1.70 thorpej struct lwp *l;
388 1.1 mrg void *v;
389 1.1 mrg register_t *retval;
390 1.1 mrg {
391 1.19 eeh struct netbsd32_mount_args /* {
392 1.10 mrg syscallarg(const netbsd32_charp) type;
393 1.10 mrg syscallarg(const netbsd32_charp) path;
394 1.1 mrg syscallarg(int) flags;
395 1.10 mrg syscallarg(netbsd32_voidp) data;
396 1.1 mrg } */ *uap = v;
397 1.1 mrg struct sys_mount_args ua;
398 1.1 mrg
399 1.11 mrg NETBSD32TOP_UAP(type, const char);
400 1.11 mrg NETBSD32TOP_UAP(path, const char);
401 1.11 mrg NETBSD32TO64_UAP(flags);
402 1.11 mrg NETBSD32TOP_UAP(data, void);
403 1.70 thorpej return (sys_mount(l, &ua, retval));
404 1.1 mrg }
405 1.1 mrg
406 1.1 mrg int
407 1.70 thorpej netbsd32_unmount(l, v, retval)
408 1.70 thorpej struct lwp *l;
409 1.1 mrg void *v;
410 1.1 mrg register_t *retval;
411 1.1 mrg {
412 1.19 eeh struct netbsd32_unmount_args /* {
413 1.10 mrg syscallarg(const netbsd32_charp) path;
414 1.1 mrg syscallarg(int) flags;
415 1.1 mrg } */ *uap = v;
416 1.1 mrg struct sys_unmount_args ua;
417 1.1 mrg
418 1.11 mrg NETBSD32TOP_UAP(path, const char);
419 1.11 mrg NETBSD32TO64_UAP(flags);
420 1.70 thorpej return (sys_unmount(l, &ua, retval));
421 1.1 mrg }
422 1.1 mrg
423 1.1 mrg int
424 1.70 thorpej netbsd32_setuid(l, v, retval)
425 1.70 thorpej struct lwp *l;
426 1.6 eeh void *v;
427 1.6 eeh register_t *retval;
428 1.6 eeh {
429 1.19 eeh struct netbsd32_setuid_args /* {
430 1.6 eeh syscallarg(uid_t) uid;
431 1.6 eeh } */ *uap = v;
432 1.6 eeh struct sys_setuid_args ua;
433 1.6 eeh
434 1.11 mrg NETBSD32TO64_UAP(uid);
435 1.70 thorpej return (sys_setuid(l, &ua, retval));
436 1.6 eeh }
437 1.6 eeh
438 1.6 eeh int
439 1.70 thorpej netbsd32_ptrace(l, v, retval)
440 1.70 thorpej struct lwp *l;
441 1.1 mrg void *v;
442 1.1 mrg register_t *retval;
443 1.1 mrg {
444 1.19 eeh struct netbsd32_ptrace_args /* {
445 1.1 mrg syscallarg(int) req;
446 1.1 mrg syscallarg(pid_t) pid;
447 1.10 mrg syscallarg(netbsd32_caddr_t) addr;
448 1.1 mrg syscallarg(int) data;
449 1.1 mrg } */ *uap = v;
450 1.1 mrg struct sys_ptrace_args ua;
451 1.1 mrg
452 1.11 mrg NETBSD32TO64_UAP(req);
453 1.11 mrg NETBSD32TO64_UAP(pid);
454 1.11 mrg NETBSD32TOX64_UAP(addr, caddr_t);
455 1.11 mrg NETBSD32TO64_UAP(data);
456 1.70 thorpej return (sys_ptrace(l, &ua, retval));
457 1.1 mrg }
458 1.1 mrg
459 1.1 mrg int
460 1.70 thorpej netbsd32_accept(l, v, retval)
461 1.70 thorpej struct lwp *l;
462 1.1 mrg void *v;
463 1.1 mrg register_t *retval;
464 1.1 mrg {
465 1.19 eeh struct netbsd32_accept_args /* {
466 1.1 mrg syscallarg(int) s;
467 1.10 mrg syscallarg(netbsd32_sockaddrp_t) name;
468 1.10 mrg syscallarg(netbsd32_intp) anamelen;
469 1.1 mrg } */ *uap = v;
470 1.1 mrg struct sys_accept_args ua;
471 1.1 mrg
472 1.11 mrg NETBSD32TO64_UAP(s);
473 1.11 mrg NETBSD32TOP_UAP(name, struct sockaddr);
474 1.11 mrg NETBSD32TOP_UAP(anamelen, int);
475 1.70 thorpej return (sys_accept(l, &ua, retval));
476 1.1 mrg }
477 1.1 mrg
478 1.1 mrg int
479 1.70 thorpej netbsd32_getpeername(l, v, retval)
480 1.70 thorpej struct lwp *l;
481 1.1 mrg void *v;
482 1.1 mrg register_t *retval;
483 1.1 mrg {
484 1.19 eeh struct netbsd32_getpeername_args /* {
485 1.1 mrg syscallarg(int) fdes;
486 1.10 mrg syscallarg(netbsd32_sockaddrp_t) asa;
487 1.10 mrg syscallarg(netbsd32_intp) alen;
488 1.1 mrg } */ *uap = v;
489 1.1 mrg struct sys_getpeername_args ua;
490 1.1 mrg
491 1.11 mrg NETBSD32TO64_UAP(fdes);
492 1.11 mrg NETBSD32TOP_UAP(asa, struct sockaddr);
493 1.11 mrg NETBSD32TOP_UAP(alen, int);
494 1.6 eeh /* NB: do the protocol specific sockaddrs need to be converted? */
495 1.70 thorpej return (sys_getpeername(l, &ua, retval));
496 1.1 mrg }
497 1.1 mrg
498 1.1 mrg int
499 1.70 thorpej netbsd32_getsockname(l, v, retval)
500 1.70 thorpej struct lwp *l;
501 1.1 mrg void *v;
502 1.1 mrg register_t *retval;
503 1.1 mrg {
504 1.19 eeh struct netbsd32_getsockname_args /* {
505 1.1 mrg syscallarg(int) fdes;
506 1.10 mrg syscallarg(netbsd32_sockaddrp_t) asa;
507 1.10 mrg syscallarg(netbsd32_intp) alen;
508 1.1 mrg } */ *uap = v;
509 1.1 mrg struct sys_getsockname_args ua;
510 1.1 mrg
511 1.11 mrg NETBSD32TO64_UAP(fdes);
512 1.11 mrg NETBSD32TOP_UAP(asa, struct sockaddr);
513 1.11 mrg NETBSD32TOP_UAP(alen, int);
514 1.70 thorpej return (sys_getsockname(l, &ua, retval));
515 1.1 mrg }
516 1.1 mrg
517 1.1 mrg int
518 1.70 thorpej netbsd32_access(l, v, retval)
519 1.70 thorpej struct lwp *l;
520 1.1 mrg void *v;
521 1.1 mrg register_t *retval;
522 1.1 mrg {
523 1.19 eeh struct netbsd32_access_args /* {
524 1.10 mrg syscallarg(const netbsd32_charp) path;
525 1.1 mrg syscallarg(int) flags;
526 1.1 mrg } */ *uap = v;
527 1.1 mrg struct sys_access_args ua;
528 1.1 mrg caddr_t sg;
529 1.1 mrg
530 1.11 mrg NETBSD32TOP_UAP(path, const char);
531 1.11 mrg NETBSD32TO64_UAP(flags);
532 1.70 thorpej sg = stackgap_init(l->l_proc, 0);
533 1.73 fvdl CHECK_ALT_EXIST(l->l_proc, &sg, SCARG(&ua, path));
534 1.1 mrg
535 1.70 thorpej return (sys_access(l, &ua, retval));
536 1.1 mrg }
537 1.1 mrg
538 1.1 mrg int
539 1.70 thorpej netbsd32_chflags(l, v, retval)
540 1.70 thorpej struct lwp *l;
541 1.1 mrg void *v;
542 1.1 mrg register_t *retval;
543 1.1 mrg {
544 1.19 eeh struct netbsd32_chflags_args /* {
545 1.10 mrg syscallarg(const netbsd32_charp) path;
546 1.10 mrg syscallarg(netbsd32_u_long) flags;
547 1.1 mrg } */ *uap = v;
548 1.1 mrg struct sys_chflags_args ua;
549 1.1 mrg
550 1.11 mrg NETBSD32TOP_UAP(path, const char);
551 1.11 mrg NETBSD32TO64_UAP(flags);
552 1.1 mrg
553 1.70 thorpej return (sys_chflags(l, &ua, retval));
554 1.1 mrg }
555 1.1 mrg
556 1.1 mrg int
557 1.70 thorpej netbsd32_fchflags(l, v, retval)
558 1.70 thorpej struct lwp *l;
559 1.1 mrg void *v;
560 1.1 mrg register_t *retval;
561 1.1 mrg {
562 1.19 eeh struct netbsd32_fchflags_args /* {
563 1.1 mrg syscallarg(int) fd;
564 1.10 mrg syscallarg(netbsd32_u_long) flags;
565 1.1 mrg } */ *uap = v;
566 1.1 mrg struct sys_fchflags_args ua;
567 1.1 mrg
568 1.11 mrg NETBSD32TO64_UAP(fd);
569 1.11 mrg NETBSD32TO64_UAP(flags);
570 1.1 mrg
571 1.70 thorpej return (sys_fchflags(l, &ua, retval));
572 1.1 mrg }
573 1.1 mrg
574 1.1 mrg int
575 1.70 thorpej netbsd32_lchflags(l, v, retval)
576 1.70 thorpej struct lwp *l;
577 1.50 mrg void *v;
578 1.50 mrg register_t *retval;
579 1.50 mrg {
580 1.50 mrg struct netbsd32_lchflags_args /* {
581 1.50 mrg syscallarg(int) fd;
582 1.50 mrg syscallarg(netbsd32_u_long) flags;
583 1.50 mrg } */ *uap = v;
584 1.50 mrg struct sys_lchflags_args ua;
585 1.50 mrg
586 1.50 mrg NETBSD32TOP_UAP(path, const char);
587 1.50 mrg NETBSD32TO64_UAP(flags);
588 1.50 mrg
589 1.70 thorpej return (sys_lchflags(l, &ua, retval));
590 1.50 mrg }
591 1.50 mrg
592 1.50 mrg int
593 1.70 thorpej netbsd32_kill(l, v, retval)
594 1.70 thorpej struct lwp *l;
595 1.6 eeh void *v;
596 1.6 eeh register_t *retval;
597 1.6 eeh {
598 1.19 eeh struct netbsd32_kill_args /* {
599 1.6 eeh syscallarg(int) pid;
600 1.6 eeh syscallarg(int) signum;
601 1.6 eeh } */ *uap = v;
602 1.6 eeh struct sys_kill_args ua;
603 1.6 eeh
604 1.11 mrg NETBSD32TO64_UAP(pid);
605 1.11 mrg NETBSD32TO64_UAP(signum);
606 1.6 eeh
607 1.70 thorpej return (sys_kill(l, &ua, retval));
608 1.6 eeh }
609 1.6 eeh
610 1.6 eeh int
611 1.70 thorpej netbsd32_dup(l, v, retval)
612 1.70 thorpej struct lwp *l;
613 1.6 eeh void *v;
614 1.6 eeh register_t *retval;
615 1.6 eeh {
616 1.19 eeh struct netbsd32_dup_args /* {
617 1.6 eeh syscallarg(int) fd;
618 1.6 eeh } */ *uap = v;
619 1.6 eeh struct sys_dup_args ua;
620 1.6 eeh
621 1.11 mrg NETBSD32TO64_UAP(fd);
622 1.6 eeh
623 1.70 thorpej return (sys_dup(l, &ua, retval));
624 1.6 eeh }
625 1.6 eeh
626 1.6 eeh int
627 1.70 thorpej netbsd32_profil(l, v, retval)
628 1.70 thorpej struct lwp *l;
629 1.1 mrg void *v;
630 1.1 mrg register_t *retval;
631 1.1 mrg {
632 1.19 eeh struct netbsd32_profil_args /* {
633 1.10 mrg syscallarg(netbsd32_caddr_t) samples;
634 1.10 mrg syscallarg(netbsd32_size_t) size;
635 1.10 mrg syscallarg(netbsd32_u_long) offset;
636 1.1 mrg syscallarg(u_int) scale;
637 1.1 mrg } */ *uap = v;
638 1.1 mrg struct sys_profil_args ua;
639 1.1 mrg
640 1.11 mrg NETBSD32TOX64_UAP(samples, caddr_t);
641 1.11 mrg NETBSD32TOX_UAP(size, size_t);
642 1.11 mrg NETBSD32TOX_UAP(offset, u_long);
643 1.11 mrg NETBSD32TO64_UAP(scale);
644 1.70 thorpej return (sys_profil(l, &ua, retval));
645 1.1 mrg }
646 1.1 mrg
647 1.42 jdolecek #ifdef KTRACE
648 1.1 mrg int
649 1.70 thorpej netbsd32_ktrace(l, v, retval)
650 1.70 thorpej struct lwp *l;
651 1.1 mrg void *v;
652 1.1 mrg register_t *retval;
653 1.1 mrg {
654 1.19 eeh struct netbsd32_ktrace_args /* {
655 1.10 mrg syscallarg(const netbsd32_charp) fname;
656 1.1 mrg syscallarg(int) ops;
657 1.1 mrg syscallarg(int) facs;
658 1.1 mrg syscallarg(int) pid;
659 1.1 mrg } */ *uap = v;
660 1.1 mrg struct sys_ktrace_args ua;
661 1.1 mrg
662 1.11 mrg NETBSD32TOP_UAP(fname, const char);
663 1.11 mrg NETBSD32TO64_UAP(ops);
664 1.11 mrg NETBSD32TO64_UAP(facs);
665 1.11 mrg NETBSD32TO64_UAP(pid);
666 1.70 thorpej return (sys_ktrace(l, &ua, retval));
667 1.1 mrg }
668 1.42 jdolecek #endif /* KTRACE */
669 1.50 mrg
670 1.50 mrg int
671 1.70 thorpej netbsd32_utrace(l, v, retval)
672 1.70 thorpej struct lwp *l;
673 1.50 mrg void *v;
674 1.50 mrg register_t *retval;
675 1.50 mrg {
676 1.50 mrg struct netbsd32_utrace_args /* {
677 1.50 mrg syscallarg(const netbsd32_charp) label;
678 1.50 mrg syscallarg(netbsd32_voidp) addr;
679 1.50 mrg syscallarg(netbsd32_size_t) len;
680 1.50 mrg } */ *uap = v;
681 1.50 mrg struct sys_utrace_args ua;
682 1.50 mrg
683 1.50 mrg NETBSD32TOP_UAP(label, const char);
684 1.50 mrg NETBSD32TOP_UAP(addr, void);
685 1.50 mrg NETBSD32TO64_UAP(len);
686 1.70 thorpej return (sys_utrace(l, &ua, retval));
687 1.50 mrg }
688 1.1 mrg
689 1.1 mrg int
690 1.70 thorpej netbsd32___getlogin(l, v, retval)
691 1.70 thorpej struct lwp *l;
692 1.1 mrg void *v;
693 1.1 mrg register_t *retval;
694 1.1 mrg {
695 1.19 eeh struct netbsd32___getlogin_args /* {
696 1.10 mrg syscallarg(netbsd32_charp) namebuf;
697 1.1 mrg syscallarg(u_int) namelen;
698 1.1 mrg } */ *uap = v;
699 1.1 mrg struct sys___getlogin_args ua;
700 1.1 mrg
701 1.11 mrg NETBSD32TOP_UAP(namebuf, char);
702 1.11 mrg NETBSD32TO64_UAP(namelen);
703 1.70 thorpej return (sys___getlogin(l, &ua, retval));
704 1.1 mrg }
705 1.1 mrg
706 1.1 mrg int
707 1.70 thorpej netbsd32_setlogin(l, v, retval)
708 1.70 thorpej struct lwp *l;
709 1.1 mrg void *v;
710 1.1 mrg register_t *retval;
711 1.1 mrg {
712 1.19 eeh struct netbsd32_setlogin_args /* {
713 1.10 mrg syscallarg(const netbsd32_charp) namebuf;
714 1.1 mrg } */ *uap = v;
715 1.70 thorpej struct sys___setlogin_args ua;
716 1.1 mrg
717 1.11 mrg NETBSD32TOP_UAP(namebuf, char);
718 1.70 thorpej return (sys___setlogin(l, &ua, retval));
719 1.1 mrg }
720 1.1 mrg
721 1.1 mrg int
722 1.70 thorpej netbsd32_acct(l, v, retval)
723 1.70 thorpej struct lwp *l;
724 1.1 mrg void *v;
725 1.1 mrg register_t *retval;
726 1.1 mrg {
727 1.19 eeh struct netbsd32_acct_args /* {
728 1.10 mrg syscallarg(const netbsd32_charp) path;
729 1.1 mrg } */ *uap = v;
730 1.1 mrg struct sys_acct_args ua;
731 1.1 mrg
732 1.11 mrg NETBSD32TOP_UAP(path, const char);
733 1.70 thorpej return (sys_acct(l, &ua, retval));
734 1.1 mrg }
735 1.1 mrg
736 1.1 mrg int
737 1.70 thorpej netbsd32_revoke(l, v, retval)
738 1.70 thorpej struct lwp *l;
739 1.1 mrg void *v;
740 1.1 mrg register_t *retval;
741 1.1 mrg {
742 1.19 eeh struct netbsd32_revoke_args /* {
743 1.10 mrg syscallarg(const netbsd32_charp) path;
744 1.1 mrg } */ *uap = v;
745 1.1 mrg struct sys_revoke_args ua;
746 1.1 mrg caddr_t sg;
747 1.1 mrg
748 1.11 mrg NETBSD32TOP_UAP(path, const char);
749 1.70 thorpej sg = stackgap_init(l->l_proc, 0);
750 1.73 fvdl CHECK_ALT_EXIST(l->l_proc, &sg, SCARG(&ua, path));
751 1.1 mrg
752 1.70 thorpej return (sys_revoke(l, &ua, retval));
753 1.1 mrg }
754 1.1 mrg
755 1.1 mrg int
756 1.70 thorpej netbsd32_symlink(l, v, retval)
757 1.70 thorpej struct lwp *l;
758 1.1 mrg void *v;
759 1.1 mrg register_t *retval;
760 1.1 mrg {
761 1.19 eeh struct netbsd32_symlink_args /* {
762 1.10 mrg syscallarg(const netbsd32_charp) path;
763 1.10 mrg syscallarg(const netbsd32_charp) link;
764 1.1 mrg } */ *uap = v;
765 1.1 mrg struct sys_symlink_args ua;
766 1.1 mrg
767 1.11 mrg NETBSD32TOP_UAP(path, const char);
768 1.11 mrg NETBSD32TOP_UAP(link, const char);
769 1.1 mrg
770 1.70 thorpej return (sys_symlink(l, &ua, retval));
771 1.1 mrg }
772 1.1 mrg
773 1.1 mrg int
774 1.70 thorpej netbsd32_readlink(l, v, retval)
775 1.70 thorpej struct lwp *l;
776 1.1 mrg void *v;
777 1.1 mrg register_t *retval;
778 1.1 mrg {
779 1.19 eeh struct netbsd32_readlink_args /* {
780 1.10 mrg syscallarg(const netbsd32_charp) path;
781 1.10 mrg syscallarg(netbsd32_charp) buf;
782 1.10 mrg syscallarg(netbsd32_size_t) count;
783 1.1 mrg } */ *uap = v;
784 1.1 mrg struct sys_readlink_args ua;
785 1.1 mrg caddr_t sg;
786 1.1 mrg
787 1.11 mrg NETBSD32TOP_UAP(path, const char);
788 1.11 mrg NETBSD32TOP_UAP(buf, char);
789 1.11 mrg NETBSD32TOX_UAP(count, size_t);
790 1.70 thorpej sg = stackgap_init(l->l_proc, 0);
791 1.73 fvdl CHECK_ALT_SYMLINK(l->l_proc, &sg, SCARG(&ua, path));
792 1.1 mrg
793 1.70 thorpej return (sys_readlink(l, &ua, retval));
794 1.1 mrg }
795 1.1 mrg
796 1.1 mrg int
797 1.70 thorpej netbsd32_umask(l, v, retval)
798 1.70 thorpej struct lwp *l;
799 1.6 eeh void *v;
800 1.6 eeh register_t *retval;
801 1.6 eeh {
802 1.19 eeh struct netbsd32_umask_args /* {
803 1.6 eeh syscallarg(mode_t) newmask;
804 1.6 eeh } */ *uap = v;
805 1.6 eeh struct sys_umask_args ua;
806 1.6 eeh
807 1.11 mrg NETBSD32TO64_UAP(newmask);
808 1.70 thorpej return (sys_umask(l, &ua, retval));
809 1.6 eeh }
810 1.6 eeh
811 1.6 eeh int
812 1.70 thorpej netbsd32_chroot(l, v, retval)
813 1.70 thorpej struct lwp *l;
814 1.1 mrg void *v;
815 1.1 mrg register_t *retval;
816 1.1 mrg {
817 1.19 eeh struct netbsd32_chroot_args /* {
818 1.10 mrg syscallarg(const netbsd32_charp) path;
819 1.1 mrg } */ *uap = v;
820 1.1 mrg struct sys_chroot_args ua;
821 1.1 mrg
822 1.11 mrg NETBSD32TOP_UAP(path, const char);
823 1.70 thorpej return (sys_chroot(l, &ua, retval));
824 1.1 mrg }
825 1.1 mrg
826 1.1 mrg int
827 1.70 thorpej netbsd32_sbrk(l, v, retval)
828 1.70 thorpej struct lwp *l;
829 1.6 eeh void *v;
830 1.6 eeh register_t *retval;
831 1.6 eeh {
832 1.19 eeh struct netbsd32_sbrk_args /* {
833 1.6 eeh syscallarg(int) incr;
834 1.6 eeh } */ *uap = v;
835 1.6 eeh struct sys_sbrk_args ua;
836 1.6 eeh
837 1.11 mrg NETBSD32TO64_UAP(incr);
838 1.70 thorpej return (sys_sbrk(l, &ua, retval));
839 1.6 eeh }
840 1.6 eeh
841 1.6 eeh int
842 1.70 thorpej netbsd32_sstk(l, v, retval)
843 1.70 thorpej struct lwp *l;
844 1.6 eeh void *v;
845 1.6 eeh register_t *retval;
846 1.6 eeh {
847 1.19 eeh struct netbsd32_sstk_args /* {
848 1.6 eeh syscallarg(int) incr;
849 1.6 eeh } */ *uap = v;
850 1.6 eeh struct sys_sstk_args ua;
851 1.6 eeh
852 1.11 mrg NETBSD32TO64_UAP(incr);
853 1.70 thorpej return (sys_sstk(l, &ua, retval));
854 1.6 eeh }
855 1.6 eeh
856 1.6 eeh int
857 1.70 thorpej netbsd32_munmap(l, v, retval)
858 1.70 thorpej struct lwp *l;
859 1.1 mrg void *v;
860 1.1 mrg register_t *retval;
861 1.1 mrg {
862 1.19 eeh struct netbsd32_munmap_args /* {
863 1.10 mrg syscallarg(netbsd32_voidp) addr;
864 1.10 mrg syscallarg(netbsd32_size_t) len;
865 1.1 mrg } */ *uap = v;
866 1.1 mrg struct sys_munmap_args ua;
867 1.1 mrg
868 1.11 mrg NETBSD32TOP_UAP(addr, void);
869 1.11 mrg NETBSD32TOX_UAP(len, size_t);
870 1.70 thorpej return (sys_munmap(l, &ua, retval));
871 1.1 mrg }
872 1.1 mrg
873 1.1 mrg int
874 1.70 thorpej netbsd32_mprotect(l, v, retval)
875 1.70 thorpej struct lwp *l;
876 1.1 mrg void *v;
877 1.1 mrg register_t *retval;
878 1.1 mrg {
879 1.19 eeh struct netbsd32_mprotect_args /* {
880 1.10 mrg syscallarg(netbsd32_voidp) addr;
881 1.10 mrg syscallarg(netbsd32_size_t) len;
882 1.1 mrg syscallarg(int) prot;
883 1.1 mrg } */ *uap = v;
884 1.1 mrg struct sys_mprotect_args ua;
885 1.1 mrg
886 1.11 mrg NETBSD32TOP_UAP(addr, void);
887 1.11 mrg NETBSD32TOX_UAP(len, size_t);
888 1.11 mrg NETBSD32TO64_UAP(prot);
889 1.70 thorpej return (sys_mprotect(l, &ua, retval));
890 1.1 mrg }
891 1.1 mrg
892 1.1 mrg int
893 1.70 thorpej netbsd32_madvise(l, v, retval)
894 1.70 thorpej struct lwp *l;
895 1.1 mrg void *v;
896 1.1 mrg register_t *retval;
897 1.1 mrg {
898 1.19 eeh struct netbsd32_madvise_args /* {
899 1.10 mrg syscallarg(netbsd32_voidp) addr;
900 1.10 mrg syscallarg(netbsd32_size_t) len;
901 1.1 mrg syscallarg(int) behav;
902 1.1 mrg } */ *uap = v;
903 1.1 mrg struct sys_madvise_args ua;
904 1.1 mrg
905 1.11 mrg NETBSD32TOP_UAP(addr, void);
906 1.11 mrg NETBSD32TOX_UAP(len, size_t);
907 1.11 mrg NETBSD32TO64_UAP(behav);
908 1.70 thorpej return (sys_madvise(l, &ua, retval));
909 1.1 mrg }
910 1.1 mrg
911 1.1 mrg int
912 1.70 thorpej netbsd32_mincore(l, v, retval)
913 1.70 thorpej struct lwp *l;
914 1.1 mrg void *v;
915 1.1 mrg register_t *retval;
916 1.1 mrg {
917 1.19 eeh struct netbsd32_mincore_args /* {
918 1.10 mrg syscallarg(netbsd32_caddr_t) addr;
919 1.10 mrg syscallarg(netbsd32_size_t) len;
920 1.10 mrg syscallarg(netbsd32_charp) vec;
921 1.1 mrg } */ *uap = v;
922 1.1 mrg struct sys_mincore_args ua;
923 1.1 mrg
924 1.11 mrg NETBSD32TOX64_UAP(addr, caddr_t);
925 1.11 mrg NETBSD32TOX_UAP(len, size_t);
926 1.11 mrg NETBSD32TOP_UAP(vec, char);
927 1.70 thorpej return (sys_mincore(l, &ua, retval));
928 1.1 mrg }
929 1.1 mrg
930 1.57 mrg /* XXX MOVE ME XXX ? */
931 1.1 mrg int
932 1.70 thorpej netbsd32_getgroups(l, v, retval)
933 1.70 thorpej struct lwp *l;
934 1.1 mrg void *v;
935 1.1 mrg register_t *retval;
936 1.1 mrg {
937 1.19 eeh struct netbsd32_getgroups_args /* {
938 1.1 mrg syscallarg(int) gidsetsize;
939 1.10 mrg syscallarg(netbsd32_gid_tp) gidset;
940 1.1 mrg } */ *uap = v;
941 1.70 thorpej struct pcred *pc = l->l_proc->p_cred;
942 1.25 augustss int ngrp;
943 1.6 eeh int error;
944 1.1 mrg
945 1.6 eeh ngrp = SCARG(uap, gidsetsize);
946 1.6 eeh if (ngrp == 0) {
947 1.6 eeh *retval = pc->pc_ucred->cr_ngroups;
948 1.6 eeh return (0);
949 1.6 eeh }
950 1.6 eeh if (ngrp < pc->pc_ucred->cr_ngroups)
951 1.6 eeh return (EINVAL);
952 1.6 eeh ngrp = pc->pc_ucred->cr_ngroups;
953 1.10 mrg /* Should convert gid_t to netbsd32_gid_t, but they're the same */
954 1.6 eeh error = copyout((caddr_t)pc->pc_ucred->cr_groups,
955 1.66 scw (caddr_t)NETBSD32PTR64(SCARG(uap, gidset)), ngrp * sizeof(gid_t));
956 1.6 eeh if (error)
957 1.6 eeh return (error);
958 1.6 eeh *retval = ngrp;
959 1.6 eeh return (0);
960 1.1 mrg }
961 1.1 mrg
962 1.1 mrg int
963 1.70 thorpej netbsd32_setgroups(l, v, retval)
964 1.70 thorpej struct lwp *l;
965 1.1 mrg void *v;
966 1.1 mrg register_t *retval;
967 1.1 mrg {
968 1.19 eeh struct netbsd32_setgroups_args /* {
969 1.1 mrg syscallarg(int) gidsetsize;
970 1.10 mrg syscallarg(const netbsd32_gid_tp) gidset;
971 1.1 mrg } */ *uap = v;
972 1.1 mrg struct sys_setgroups_args ua;
973 1.1 mrg
974 1.11 mrg NETBSD32TO64_UAP(gidsetsize);
975 1.11 mrg NETBSD32TOP_UAP(gidset, gid_t);
976 1.70 thorpej return (sys_setgroups(l, &ua, retval));
977 1.1 mrg }
978 1.1 mrg
979 1.1 mrg int
980 1.70 thorpej netbsd32_setpgid(l, v, retval)
981 1.70 thorpej struct lwp *l;
982 1.6 eeh void *v;
983 1.6 eeh register_t *retval;
984 1.6 eeh {
985 1.19 eeh struct netbsd32_setpgid_args /* {
986 1.6 eeh syscallarg(int) pid;
987 1.6 eeh syscallarg(int) pgid;
988 1.6 eeh } */ *uap = v;
989 1.6 eeh struct sys_setpgid_args ua;
990 1.6 eeh
991 1.11 mrg NETBSD32TO64_UAP(pid);
992 1.11 mrg NETBSD32TO64_UAP(pgid);
993 1.70 thorpej return (sys_setpgid(l, &ua, retval));
994 1.6 eeh }
995 1.6 eeh
996 1.1 mrg int
997 1.70 thorpej netbsd32_fcntl(l, v, retval)
998 1.70 thorpej struct lwp *l;
999 1.1 mrg void *v;
1000 1.1 mrg register_t *retval;
1001 1.1 mrg {
1002 1.19 eeh struct netbsd32_fcntl_args /* {
1003 1.1 mrg syscallarg(int) fd;
1004 1.1 mrg syscallarg(int) cmd;
1005 1.10 mrg syscallarg(netbsd32_voidp) arg;
1006 1.1 mrg } */ *uap = v;
1007 1.1 mrg struct sys_fcntl_args ua;
1008 1.1 mrg
1009 1.11 mrg NETBSD32TO64_UAP(fd);
1010 1.11 mrg NETBSD32TO64_UAP(cmd);
1011 1.11 mrg NETBSD32TOP_UAP(arg, void);
1012 1.54 mrg /* we can do this because `struct flock' doesn't change */
1013 1.70 thorpej return (sys_fcntl(l, &ua, retval));
1014 1.1 mrg }
1015 1.1 mrg
1016 1.1 mrg int
1017 1.70 thorpej netbsd32_dup2(l, v, retval)
1018 1.70 thorpej struct lwp *l;
1019 1.6 eeh void *v;
1020 1.6 eeh register_t *retval;
1021 1.6 eeh {
1022 1.19 eeh struct netbsd32_dup2_args /* {
1023 1.6 eeh syscallarg(int) from;
1024 1.6 eeh syscallarg(int) to;
1025 1.6 eeh } */ *uap = v;
1026 1.6 eeh struct sys_dup2_args ua;
1027 1.6 eeh
1028 1.11 mrg NETBSD32TO64_UAP(from);
1029 1.11 mrg NETBSD32TO64_UAP(to);
1030 1.70 thorpej return (sys_dup2(l, &ua, retval));
1031 1.6 eeh }
1032 1.6 eeh
1033 1.6 eeh int
1034 1.70 thorpej netbsd32_fsync(l, v, retval)
1035 1.70 thorpej struct lwp *l;
1036 1.6 eeh void *v;
1037 1.6 eeh register_t *retval;
1038 1.6 eeh {
1039 1.19 eeh struct netbsd32_fsync_args /* {
1040 1.6 eeh syscallarg(int) fd;
1041 1.6 eeh } */ *uap = v;
1042 1.6 eeh struct sys_fsync_args ua;
1043 1.1 mrg
1044 1.11 mrg NETBSD32TO64_UAP(fd);
1045 1.70 thorpej return (sys_fsync(l, &ua, retval));
1046 1.6 eeh }
1047 1.6 eeh
1048 1.6 eeh int
1049 1.70 thorpej netbsd32_setpriority(l, v, retval)
1050 1.70 thorpej struct lwp *l;
1051 1.6 eeh void *v;
1052 1.6 eeh register_t *retval;
1053 1.6 eeh {
1054 1.19 eeh struct netbsd32_setpriority_args /* {
1055 1.6 eeh syscallarg(int) which;
1056 1.6 eeh syscallarg(int) who;
1057 1.6 eeh syscallarg(int) prio;
1058 1.6 eeh } */ *uap = v;
1059 1.6 eeh struct sys_setpriority_args ua;
1060 1.6 eeh
1061 1.11 mrg NETBSD32TO64_UAP(which);
1062 1.11 mrg NETBSD32TO64_UAP(who);
1063 1.11 mrg NETBSD32TO64_UAP(prio);
1064 1.70 thorpej return (sys_setpriority(l, &ua, retval));
1065 1.6 eeh }
1066 1.6 eeh
1067 1.6 eeh int
1068 1.70 thorpej netbsd32_socket(l, v, retval)
1069 1.70 thorpej struct lwp *l;
1070 1.6 eeh void *v;
1071 1.6 eeh register_t *retval;
1072 1.6 eeh {
1073 1.19 eeh struct netbsd32_socket_args /* {
1074 1.6 eeh syscallarg(int) domain;
1075 1.6 eeh syscallarg(int) type;
1076 1.6 eeh syscallarg(int) protocol;
1077 1.6 eeh } */ *uap = v;
1078 1.6 eeh struct sys_socket_args ua;
1079 1.6 eeh
1080 1.11 mrg NETBSD32TO64_UAP(domain);
1081 1.11 mrg NETBSD32TO64_UAP(type);
1082 1.11 mrg NETBSD32TO64_UAP(protocol);
1083 1.70 thorpej return (sys_socket(l, &ua, retval));
1084 1.1 mrg }
1085 1.1 mrg
1086 1.1 mrg int
1087 1.70 thorpej netbsd32_connect(l, v, retval)
1088 1.70 thorpej struct lwp *l;
1089 1.1 mrg void *v;
1090 1.1 mrg register_t *retval;
1091 1.1 mrg {
1092 1.19 eeh struct netbsd32_connect_args /* {
1093 1.1 mrg syscallarg(int) s;
1094 1.10 mrg syscallarg(const netbsd32_sockaddrp_t) name;
1095 1.1 mrg syscallarg(int) namelen;
1096 1.1 mrg } */ *uap = v;
1097 1.1 mrg struct sys_connect_args ua;
1098 1.1 mrg
1099 1.11 mrg NETBSD32TO64_UAP(s);
1100 1.11 mrg NETBSD32TOP_UAP(name, struct sockaddr);
1101 1.11 mrg NETBSD32TO64_UAP(namelen);
1102 1.70 thorpej return (sys_connect(l, &ua, retval));
1103 1.1 mrg }
1104 1.1 mrg
1105 1.6 eeh int
1106 1.70 thorpej netbsd32_getpriority(l, v, retval)
1107 1.70 thorpej struct lwp *l;
1108 1.6 eeh void *v;
1109 1.6 eeh register_t *retval;
1110 1.6 eeh {
1111 1.19 eeh struct netbsd32_getpriority_args /* {
1112 1.6 eeh syscallarg(int) which;
1113 1.6 eeh syscallarg(int) who;
1114 1.6 eeh } */ *uap = v;
1115 1.6 eeh struct sys_getpriority_args ua;
1116 1.6 eeh
1117 1.11 mrg NETBSD32TO64_UAP(which);
1118 1.11 mrg NETBSD32TO64_UAP(who);
1119 1.70 thorpej return (sys_getpriority(l, &ua, retval));
1120 1.6 eeh }
1121 1.6 eeh
1122 1.1 mrg int
1123 1.70 thorpej netbsd32_bind(l, v, retval)
1124 1.70 thorpej struct lwp *l;
1125 1.1 mrg void *v;
1126 1.1 mrg register_t *retval;
1127 1.1 mrg {
1128 1.19 eeh struct netbsd32_bind_args /* {
1129 1.1 mrg syscallarg(int) s;
1130 1.10 mrg syscallarg(const netbsd32_sockaddrp_t) name;
1131 1.1 mrg syscallarg(int) namelen;
1132 1.1 mrg } */ *uap = v;
1133 1.6 eeh struct sys_bind_args ua;
1134 1.1 mrg
1135 1.11 mrg NETBSD32TO64_UAP(s);
1136 1.11 mrg NETBSD32TOP_UAP(name, struct sockaddr);
1137 1.11 mrg NETBSD32TO64_UAP(namelen);
1138 1.70 thorpej return (sys_bind(l, &ua, retval));
1139 1.1 mrg }
1140 1.1 mrg
1141 1.1 mrg int
1142 1.70 thorpej netbsd32_setsockopt(l, v, retval)
1143 1.70 thorpej struct lwp *l;
1144 1.1 mrg void *v;
1145 1.1 mrg register_t *retval;
1146 1.1 mrg {
1147 1.19 eeh struct netbsd32_setsockopt_args /* {
1148 1.1 mrg syscallarg(int) s;
1149 1.1 mrg syscallarg(int) level;
1150 1.1 mrg syscallarg(int) name;
1151 1.10 mrg syscallarg(const netbsd32_voidp) val;
1152 1.1 mrg syscallarg(int) valsize;
1153 1.1 mrg } */ *uap = v;
1154 1.1 mrg struct sys_setsockopt_args ua;
1155 1.1 mrg
1156 1.11 mrg NETBSD32TO64_UAP(s);
1157 1.11 mrg NETBSD32TO64_UAP(level);
1158 1.11 mrg NETBSD32TO64_UAP(name);
1159 1.11 mrg NETBSD32TOP_UAP(val, void);
1160 1.11 mrg NETBSD32TO64_UAP(valsize);
1161 1.6 eeh /* may be more efficient to do this inline. */
1162 1.70 thorpej return (sys_setsockopt(l, &ua, retval));
1163 1.1 mrg }
1164 1.1 mrg
1165 1.1 mrg int
1166 1.70 thorpej netbsd32_listen(l, v, retval)
1167 1.70 thorpej struct lwp *l;
1168 1.6 eeh void *v;
1169 1.6 eeh register_t *retval;
1170 1.6 eeh {
1171 1.19 eeh struct netbsd32_listen_args /* {
1172 1.6 eeh syscallarg(int) s;
1173 1.6 eeh syscallarg(int) backlog;
1174 1.6 eeh } */ *uap = v;
1175 1.6 eeh struct sys_listen_args ua;
1176 1.6 eeh
1177 1.11 mrg NETBSD32TO64_UAP(s);
1178 1.11 mrg NETBSD32TO64_UAP(backlog);
1179 1.70 thorpej return (sys_listen(l, &ua, retval));
1180 1.6 eeh }
1181 1.6 eeh
1182 1.6 eeh int
1183 1.70 thorpej netbsd32_fchown(l, v, retval)
1184 1.70 thorpej struct lwp *l;
1185 1.1 mrg void *v;
1186 1.1 mrg register_t *retval;
1187 1.1 mrg {
1188 1.57 mrg struct netbsd32_fchown_args /* {
1189 1.57 mrg syscallarg(int) fd;
1190 1.57 mrg syscallarg(uid_t) uid;
1191 1.57 mrg syscallarg(gid_t) gid;
1192 1.1 mrg } */ *uap = v;
1193 1.57 mrg struct sys_fchown_args ua;
1194 1.6 eeh
1195 1.11 mrg NETBSD32TO64_UAP(fd);
1196 1.11 mrg NETBSD32TO64_UAP(uid);
1197 1.11 mrg NETBSD32TO64_UAP(gid);
1198 1.70 thorpej return (sys_fchown(l, &ua, retval));
1199 1.6 eeh }
1200 1.6 eeh
1201 1.6 eeh int
1202 1.70 thorpej netbsd32_fchmod(l, v, retval)
1203 1.70 thorpej struct lwp *l;
1204 1.6 eeh void *v;
1205 1.6 eeh register_t *retval;
1206 1.6 eeh {
1207 1.19 eeh struct netbsd32_fchmod_args /* {
1208 1.6 eeh syscallarg(int) fd;
1209 1.6 eeh syscallarg(mode_t) mode;
1210 1.6 eeh } */ *uap = v;
1211 1.6 eeh struct sys_fchmod_args ua;
1212 1.6 eeh
1213 1.11 mrg NETBSD32TO64_UAP(fd);
1214 1.11 mrg NETBSD32TO64_UAP(mode);
1215 1.70 thorpej return (sys_fchmod(l, &ua, retval));
1216 1.6 eeh }
1217 1.6 eeh
1218 1.6 eeh int
1219 1.70 thorpej netbsd32_setreuid(l, v, retval)
1220 1.70 thorpej struct lwp *l;
1221 1.6 eeh void *v;
1222 1.6 eeh register_t *retval;
1223 1.6 eeh {
1224 1.19 eeh struct netbsd32_setreuid_args /* {
1225 1.6 eeh syscallarg(uid_t) ruid;
1226 1.6 eeh syscallarg(uid_t) euid;
1227 1.6 eeh } */ *uap = v;
1228 1.6 eeh struct sys_setreuid_args ua;
1229 1.6 eeh
1230 1.11 mrg NETBSD32TO64_UAP(ruid);
1231 1.11 mrg NETBSD32TO64_UAP(euid);
1232 1.70 thorpej return (sys_setreuid(l, &ua, retval));
1233 1.6 eeh }
1234 1.1 mrg
1235 1.6 eeh int
1236 1.70 thorpej netbsd32_setregid(l, v, retval)
1237 1.70 thorpej struct lwp *l;
1238 1.6 eeh void *v;
1239 1.6 eeh register_t *retval;
1240 1.6 eeh {
1241 1.19 eeh struct netbsd32_setregid_args /* {
1242 1.6 eeh syscallarg(gid_t) rgid;
1243 1.6 eeh syscallarg(gid_t) egid;
1244 1.6 eeh } */ *uap = v;
1245 1.6 eeh struct sys_setregid_args ua;
1246 1.6 eeh
1247 1.11 mrg NETBSD32TO64_UAP(rgid);
1248 1.11 mrg NETBSD32TO64_UAP(egid);
1249 1.70 thorpej return (sys_setregid(l, &ua, retval));
1250 1.1 mrg }
1251 1.1 mrg
1252 1.1 mrg int
1253 1.70 thorpej netbsd32_getsockopt(l, v, retval)
1254 1.70 thorpej struct lwp *l;
1255 1.1 mrg void *v;
1256 1.1 mrg register_t *retval;
1257 1.1 mrg {
1258 1.19 eeh struct netbsd32_getsockopt_args /* {
1259 1.1 mrg syscallarg(int) s;
1260 1.1 mrg syscallarg(int) level;
1261 1.1 mrg syscallarg(int) name;
1262 1.10 mrg syscallarg(netbsd32_voidp) val;
1263 1.10 mrg syscallarg(netbsd32_intp) avalsize;
1264 1.1 mrg } */ *uap = v;
1265 1.1 mrg struct sys_getsockopt_args ua;
1266 1.1 mrg
1267 1.11 mrg NETBSD32TO64_UAP(s);
1268 1.11 mrg NETBSD32TO64_UAP(level);
1269 1.11 mrg NETBSD32TO64_UAP(name);
1270 1.11 mrg NETBSD32TOP_UAP(val, void);
1271 1.11 mrg NETBSD32TOP_UAP(avalsize, int);
1272 1.70 thorpej return (sys_getsockopt(l, &ua, retval));
1273 1.1 mrg }
1274 1.1 mrg
1275 1.1 mrg int
1276 1.70 thorpej netbsd32_rename(l, v, retval)
1277 1.70 thorpej struct lwp *l;
1278 1.1 mrg void *v;
1279 1.1 mrg register_t *retval;
1280 1.1 mrg {
1281 1.19 eeh struct netbsd32_rename_args /* {
1282 1.10 mrg syscallarg(const netbsd32_charp) from;
1283 1.10 mrg syscallarg(const netbsd32_charp) to;
1284 1.1 mrg } */ *uap = v;
1285 1.1 mrg struct sys_rename_args ua;
1286 1.1 mrg
1287 1.20 eeh NETBSD32TOP_UAP(from, const char);
1288 1.20 eeh NETBSD32TOP_UAP(to, const char)
1289 1.6 eeh
1290 1.70 thorpej return (sys_rename(l, &ua, retval));
1291 1.1 mrg }
1292 1.1 mrg
1293 1.1 mrg int
1294 1.70 thorpej netbsd32_flock(l, v, retval)
1295 1.70 thorpej struct lwp *l;
1296 1.6 eeh void *v;
1297 1.6 eeh register_t *retval;
1298 1.6 eeh {
1299 1.19 eeh struct netbsd32_flock_args /* {
1300 1.6 eeh syscallarg(int) fd;
1301 1.6 eeh syscallarg(int) how;
1302 1.6 eeh } */ *uap = v;
1303 1.6 eeh struct sys_flock_args ua;
1304 1.6 eeh
1305 1.11 mrg NETBSD32TO64_UAP(fd);
1306 1.11 mrg NETBSD32TO64_UAP(how)
1307 1.6 eeh
1308 1.70 thorpej return (sys_flock(l, &ua, retval));
1309 1.6 eeh }
1310 1.6 eeh
1311 1.6 eeh int
1312 1.70 thorpej netbsd32_mkfifo(l, v, retval)
1313 1.70 thorpej struct lwp *l;
1314 1.1 mrg void *v;
1315 1.1 mrg register_t *retval;
1316 1.1 mrg {
1317 1.19 eeh struct netbsd32_mkfifo_args /* {
1318 1.10 mrg syscallarg(const netbsd32_charp) path;
1319 1.1 mrg syscallarg(mode_t) mode;
1320 1.1 mrg } */ *uap = v;
1321 1.1 mrg struct sys_mkfifo_args ua;
1322 1.1 mrg
1323 1.11 mrg NETBSD32TOP_UAP(path, const char)
1324 1.11 mrg NETBSD32TO64_UAP(mode);
1325 1.70 thorpej return (sys_mkfifo(l, &ua, retval));
1326 1.1 mrg }
1327 1.1 mrg
1328 1.1 mrg int
1329 1.70 thorpej netbsd32_shutdown(l, v, retval)
1330 1.70 thorpej struct lwp *l;
1331 1.6 eeh void *v;
1332 1.6 eeh register_t *retval;
1333 1.6 eeh {
1334 1.19 eeh struct netbsd32_shutdown_args /* {
1335 1.6 eeh syscallarg(int) s;
1336 1.6 eeh syscallarg(int) how;
1337 1.6 eeh } */ *uap = v;
1338 1.6 eeh struct sys_shutdown_args ua;
1339 1.6 eeh
1340 1.11 mrg NETBSD32TO64_UAP(s)
1341 1.11 mrg NETBSD32TO64_UAP(how);
1342 1.70 thorpej return (sys_shutdown(l, &ua, retval));
1343 1.6 eeh }
1344 1.6 eeh
1345 1.6 eeh int
1346 1.70 thorpej netbsd32_socketpair(l, v, retval)
1347 1.70 thorpej struct lwp *l;
1348 1.6 eeh void *v;
1349 1.6 eeh register_t *retval;
1350 1.6 eeh {
1351 1.19 eeh struct netbsd32_socketpair_args /* {
1352 1.6 eeh syscallarg(int) domain;
1353 1.6 eeh syscallarg(int) type;
1354 1.6 eeh syscallarg(int) protocol;
1355 1.10 mrg syscallarg(netbsd32_intp) rsv;
1356 1.6 eeh } */ *uap = v;
1357 1.6 eeh struct sys_socketpair_args ua;
1358 1.6 eeh
1359 1.11 mrg NETBSD32TO64_UAP(domain);
1360 1.11 mrg NETBSD32TO64_UAP(type);
1361 1.11 mrg NETBSD32TO64_UAP(protocol);
1362 1.11 mrg NETBSD32TOP_UAP(rsv, int);
1363 1.6 eeh /* Since we're just copying out two `int's we can do this */
1364 1.70 thorpej return (sys_socketpair(l, &ua, retval));
1365 1.6 eeh }
1366 1.6 eeh
1367 1.6 eeh int
1368 1.70 thorpej netbsd32_mkdir(l, v, retval)
1369 1.70 thorpej struct lwp *l;
1370 1.1 mrg void *v;
1371 1.1 mrg register_t *retval;
1372 1.1 mrg {
1373 1.19 eeh struct netbsd32_mkdir_args /* {
1374 1.10 mrg syscallarg(const netbsd32_charp) path;
1375 1.1 mrg syscallarg(mode_t) mode;
1376 1.1 mrg } */ *uap = v;
1377 1.1 mrg struct sys_mkdir_args ua;
1378 1.1 mrg
1379 1.11 mrg NETBSD32TOP_UAP(path, const char)
1380 1.11 mrg NETBSD32TO64_UAP(mode);
1381 1.70 thorpej return (sys_mkdir(l, &ua, retval));
1382 1.1 mrg }
1383 1.1 mrg
1384 1.1 mrg int
1385 1.70 thorpej netbsd32_rmdir(l, v, retval)
1386 1.70 thorpej struct lwp *l;
1387 1.1 mrg void *v;
1388 1.1 mrg register_t *retval;
1389 1.1 mrg {
1390 1.19 eeh struct netbsd32_rmdir_args /* {
1391 1.10 mrg syscallarg(const netbsd32_charp) path;
1392 1.1 mrg } */ *uap = v;
1393 1.1 mrg struct sys_rmdir_args ua;
1394 1.1 mrg
1395 1.11 mrg NETBSD32TOP_UAP(path, const char);
1396 1.70 thorpej return (sys_rmdir(l, &ua, retval));
1397 1.1 mrg }
1398 1.1 mrg
1399 1.1 mrg int
1400 1.70 thorpej netbsd32_quotactl(l, v, retval)
1401 1.70 thorpej struct lwp *l;
1402 1.1 mrg void *v;
1403 1.1 mrg register_t *retval;
1404 1.1 mrg {
1405 1.19 eeh struct netbsd32_quotactl_args /* {
1406 1.10 mrg syscallarg(const netbsd32_charp) path;
1407 1.1 mrg syscallarg(int) cmd;
1408 1.1 mrg syscallarg(int) uid;
1409 1.10 mrg syscallarg(netbsd32_caddr_t) arg;
1410 1.1 mrg } */ *uap = v;
1411 1.1 mrg struct sys_quotactl_args ua;
1412 1.1 mrg
1413 1.11 mrg NETBSD32TOP_UAP(path, const char);
1414 1.11 mrg NETBSD32TO64_UAP(cmd);
1415 1.11 mrg NETBSD32TO64_UAP(uid);
1416 1.11 mrg NETBSD32TOX64_UAP(arg, caddr_t);
1417 1.70 thorpej return (sys_quotactl(l, &ua, retval));
1418 1.1 mrg }
1419 1.1 mrg
1420 1.6 eeh #if defined(NFS) || defined(NFSSERVER)
1421 1.1 mrg int
1422 1.70 thorpej netbsd32_nfssvc(l, v, retval)
1423 1.70 thorpej struct lwp *l;
1424 1.1 mrg void *v;
1425 1.1 mrg register_t *retval;
1426 1.1 mrg {
1427 1.6 eeh #if 0
1428 1.19 eeh struct netbsd32_nfssvc_args /* {
1429 1.1 mrg syscallarg(int) flag;
1430 1.10 mrg syscallarg(netbsd32_voidp) argp;
1431 1.1 mrg } */ *uap = v;
1432 1.1 mrg struct sys_nfssvc_args ua;
1433 1.1 mrg
1434 1.11 mrg NETBSD32TO64_UAP(flag);
1435 1.11 mrg NETBSD32TOP_UAP(argp, void);
1436 1.70 thorpej return (sys_nfssvc(l, &ua, retval));
1437 1.6 eeh #else
1438 1.6 eeh /* Why would we want to support a 32-bit nfsd? */
1439 1.6 eeh return (ENOSYS);
1440 1.6 eeh #endif
1441 1.1 mrg }
1442 1.6 eeh #endif
1443 1.1 mrg
1444 1.6 eeh #if defined(NFS) || defined(NFSSERVER)
1445 1.1 mrg int
1446 1.70 thorpej netbsd32_getfh(l, v, retval)
1447 1.70 thorpej struct lwp *l;
1448 1.1 mrg void *v;
1449 1.1 mrg register_t *retval;
1450 1.1 mrg {
1451 1.19 eeh struct netbsd32_getfh_args /* {
1452 1.10 mrg syscallarg(const netbsd32_charp) fname;
1453 1.10 mrg syscallarg(netbsd32_fhandlep_t) fhp;
1454 1.1 mrg } */ *uap = v;
1455 1.1 mrg struct sys_getfh_args ua;
1456 1.1 mrg
1457 1.11 mrg NETBSD32TOP_UAP(fname, const char);
1458 1.11 mrg NETBSD32TOP_UAP(fhp, struct fhandle);
1459 1.6 eeh /* Lucky for us a fhandlep_t doesn't change sizes */
1460 1.70 thorpej return (sys_getfh(l, &ua, retval));
1461 1.1 mrg }
1462 1.6 eeh #endif
1463 1.1 mrg
1464 1.1 mrg int
1465 1.70 thorpej netbsd32_pread(l, v, retval)
1466 1.70 thorpej struct lwp *l;
1467 1.1 mrg void *v;
1468 1.1 mrg register_t *retval;
1469 1.1 mrg {
1470 1.19 eeh struct netbsd32_pread_args /* {
1471 1.1 mrg syscallarg(int) fd;
1472 1.10 mrg syscallarg(netbsd32_voidp) buf;
1473 1.10 mrg syscallarg(netbsd32_size_t) nbyte;
1474 1.1 mrg syscallarg(int) pad;
1475 1.1 mrg syscallarg(off_t) offset;
1476 1.1 mrg } */ *uap = v;
1477 1.1 mrg struct sys_pread_args ua;
1478 1.1 mrg ssize_t rt;
1479 1.1 mrg int error;
1480 1.1 mrg
1481 1.11 mrg NETBSD32TO64_UAP(fd);
1482 1.11 mrg NETBSD32TOP_UAP(buf, void);
1483 1.11 mrg NETBSD32TOX_UAP(nbyte, size_t);
1484 1.11 mrg NETBSD32TO64_UAP(pad);
1485 1.11 mrg NETBSD32TO64_UAP(offset);
1486 1.70 thorpej error = sys_pread(l, &ua, (register_t *)&rt);
1487 1.32 mrg *retval = rt;
1488 1.1 mrg return (error);
1489 1.1 mrg }
1490 1.1 mrg
1491 1.1 mrg int
1492 1.70 thorpej netbsd32_pwrite(l, v, retval)
1493 1.70 thorpej struct lwp *l;
1494 1.1 mrg void *v;
1495 1.1 mrg register_t *retval;
1496 1.1 mrg {
1497 1.19 eeh struct netbsd32_pwrite_args /* {
1498 1.1 mrg syscallarg(int) fd;
1499 1.10 mrg syscallarg(const netbsd32_voidp) buf;
1500 1.10 mrg syscallarg(netbsd32_size_t) nbyte;
1501 1.1 mrg syscallarg(int) pad;
1502 1.1 mrg syscallarg(off_t) offset;
1503 1.1 mrg } */ *uap = v;
1504 1.1 mrg struct sys_pwrite_args ua;
1505 1.1 mrg ssize_t rt;
1506 1.1 mrg int error;
1507 1.1 mrg
1508 1.11 mrg NETBSD32TO64_UAP(fd);
1509 1.11 mrg NETBSD32TOP_UAP(buf, void);
1510 1.11 mrg NETBSD32TOX_UAP(nbyte, size_t);
1511 1.11 mrg NETBSD32TO64_UAP(pad);
1512 1.11 mrg NETBSD32TO64_UAP(offset);
1513 1.70 thorpej error = sys_pwrite(l, &ua, (register_t *)&rt);
1514 1.32 mrg *retval = rt;
1515 1.1 mrg return (error);
1516 1.1 mrg }
1517 1.1 mrg
1518 1.6 eeh int
1519 1.70 thorpej netbsd32_setgid(l, v, retval)
1520 1.70 thorpej struct lwp *l;
1521 1.6 eeh void *v;
1522 1.6 eeh register_t *retval;
1523 1.6 eeh {
1524 1.19 eeh struct netbsd32_setgid_args /* {
1525 1.6 eeh syscallarg(gid_t) gid;
1526 1.6 eeh } */ *uap = v;
1527 1.6 eeh struct sys_setgid_args ua;
1528 1.6 eeh
1529 1.11 mrg NETBSD32TO64_UAP(gid);
1530 1.70 thorpej return (sys_setgid(l, v, retval));
1531 1.6 eeh }
1532 1.6 eeh
1533 1.6 eeh int
1534 1.70 thorpej netbsd32_setegid(l, v, retval)
1535 1.70 thorpej struct lwp *l;
1536 1.6 eeh void *v;
1537 1.6 eeh register_t *retval;
1538 1.6 eeh {
1539 1.19 eeh struct netbsd32_setegid_args /* {
1540 1.6 eeh syscallarg(gid_t) egid;
1541 1.6 eeh } */ *uap = v;
1542 1.6 eeh struct sys_setegid_args ua;
1543 1.6 eeh
1544 1.11 mrg NETBSD32TO64_UAP(egid);
1545 1.70 thorpej return (sys_setegid(l, v, retval));
1546 1.6 eeh }
1547 1.6 eeh
1548 1.6 eeh int
1549 1.70 thorpej netbsd32_seteuid(l, v, retval)
1550 1.70 thorpej struct lwp *l;
1551 1.6 eeh void *v;
1552 1.6 eeh register_t *retval;
1553 1.6 eeh {
1554 1.19 eeh struct netbsd32_seteuid_args /* {
1555 1.6 eeh syscallarg(gid_t) euid;
1556 1.6 eeh } */ *uap = v;
1557 1.6 eeh struct sys_seteuid_args ua;
1558 1.6 eeh
1559 1.11 mrg NETBSD32TO64_UAP(euid);
1560 1.70 thorpej return (sys_seteuid(l, v, retval));
1561 1.1 mrg }
1562 1.1 mrg
1563 1.6 eeh #ifdef LFS
1564 1.1 mrg int
1565 1.70 thorpej netbsd32_sys_lfs_bmapv(l, v, retval)
1566 1.70 thorpej struct lwp *l;
1567 1.1 mrg void *v;
1568 1.1 mrg register_t *retval;
1569 1.1 mrg {
1570 1.1 mrg
1571 1.1 mrg return (ENOSYS); /* XXX */
1572 1.1 mrg }
1573 1.1 mrg
1574 1.1 mrg int
1575 1.70 thorpej netbsd32_sys_lfs_markv(l, v, retval)
1576 1.70 thorpej struct lwp *l;
1577 1.1 mrg void *v;
1578 1.1 mrg register_t *retval;
1579 1.1 mrg {
1580 1.1 mrg
1581 1.1 mrg return (ENOSYS); /* XXX */
1582 1.1 mrg }
1583 1.1 mrg
1584 1.1 mrg int
1585 1.70 thorpej netbsd32_sys_lfs_segclean(l, v, retval)
1586 1.70 thorpej struct lwp *l;
1587 1.1 mrg void *v;
1588 1.1 mrg register_t *retval;
1589 1.1 mrg {
1590 1.20 eeh
1591 1.1 mrg return (ENOSYS); /* XXX */
1592 1.1 mrg }
1593 1.1 mrg
1594 1.1 mrg int
1595 1.70 thorpej netbsd32_sys_lfs_segwait(l, v, retval)
1596 1.70 thorpej struct lwp *l;
1597 1.1 mrg void *v;
1598 1.1 mrg register_t *retval;
1599 1.1 mrg {
1600 1.20 eeh
1601 1.1 mrg return (ENOSYS); /* XXX */
1602 1.1 mrg }
1603 1.6 eeh #endif
1604 1.1 mrg
1605 1.1 mrg int
1606 1.70 thorpej netbsd32_pathconf(l, v, retval)
1607 1.70 thorpej struct lwp *l;
1608 1.1 mrg void *v;
1609 1.1 mrg register_t *retval;
1610 1.1 mrg {
1611 1.19 eeh struct netbsd32_pathconf_args /* {
1612 1.1 mrg syscallarg(int) fd;
1613 1.1 mrg syscallarg(int) name;
1614 1.1 mrg } */ *uap = v;
1615 1.1 mrg struct sys_pathconf_args ua;
1616 1.1 mrg long rt;
1617 1.1 mrg int error;
1618 1.1 mrg
1619 1.11 mrg NETBSD32TOP_UAP(path, const char);
1620 1.11 mrg NETBSD32TO64_UAP(name);
1621 1.70 thorpej error = sys_pathconf(l, &ua, (register_t *)&rt);
1622 1.32 mrg *retval = rt;
1623 1.1 mrg return (error);
1624 1.1 mrg }
1625 1.1 mrg
1626 1.1 mrg int
1627 1.70 thorpej netbsd32_fpathconf(l, v, retval)
1628 1.70 thorpej struct lwp *l;
1629 1.1 mrg void *v;
1630 1.1 mrg register_t *retval;
1631 1.1 mrg {
1632 1.19 eeh struct netbsd32_fpathconf_args /* {
1633 1.1 mrg syscallarg(int) fd;
1634 1.1 mrg syscallarg(int) name;
1635 1.1 mrg } */ *uap = v;
1636 1.1 mrg struct sys_fpathconf_args ua;
1637 1.1 mrg long rt;
1638 1.1 mrg int error;
1639 1.1 mrg
1640 1.11 mrg NETBSD32TO64_UAP(fd);
1641 1.11 mrg NETBSD32TO64_UAP(name);
1642 1.70 thorpej error = sys_fpathconf(l, &ua, (register_t *)&rt);
1643 1.32 mrg *retval = rt;
1644 1.1 mrg return (error);
1645 1.1 mrg }
1646 1.1 mrg
1647 1.1 mrg int
1648 1.70 thorpej netbsd32_getrlimit(l, v, retval)
1649 1.70 thorpej struct lwp *l;
1650 1.1 mrg void *v;
1651 1.1 mrg register_t *retval;
1652 1.1 mrg {
1653 1.19 eeh struct netbsd32_getrlimit_args /* {
1654 1.1 mrg syscallarg(int) which;
1655 1.10 mrg syscallarg(netbsd32_rlimitp_t) rlp;
1656 1.1 mrg } */ *uap = v;
1657 1.6 eeh int which = SCARG(uap, which);
1658 1.1 mrg
1659 1.6 eeh if ((u_int)which >= RLIM_NLIMITS)
1660 1.6 eeh return (EINVAL);
1661 1.70 thorpej return (copyout(&l->l_proc->p_rlimit[which],
1662 1.66 scw (caddr_t)NETBSD32PTR64(SCARG(uap, rlp)), sizeof(struct rlimit)));
1663 1.1 mrg }
1664 1.1 mrg
1665 1.1 mrg int
1666 1.70 thorpej netbsd32_setrlimit(l, v, retval)
1667 1.70 thorpej struct lwp *l;
1668 1.1 mrg void *v;
1669 1.1 mrg register_t *retval;
1670 1.1 mrg {
1671 1.19 eeh struct netbsd32_setrlimit_args /* {
1672 1.1 mrg syscallarg(int) which;
1673 1.10 mrg syscallarg(const netbsd32_rlimitp_t) rlp;
1674 1.1 mrg } */ *uap = v;
1675 1.6 eeh int which = SCARG(uap, which);
1676 1.6 eeh struct rlimit alim;
1677 1.6 eeh int error;
1678 1.70 thorpej struct proc *p = l->l_proc;
1679 1.1 mrg
1680 1.66 scw error = copyin((caddr_t)NETBSD32PTR64(SCARG(uap, rlp)), &alim,
1681 1.66 scw sizeof(struct rlimit));
1682 1.6 eeh if (error)
1683 1.6 eeh return (error);
1684 1.18 bouyer return (dosetrlimit(p, p->p_cred, which, &alim));
1685 1.1 mrg }
1686 1.1 mrg
1687 1.1 mrg int
1688 1.70 thorpej netbsd32_mmap(l, v, retval)
1689 1.70 thorpej struct lwp *l;
1690 1.1 mrg void *v;
1691 1.1 mrg register_t *retval;
1692 1.1 mrg {
1693 1.19 eeh struct netbsd32_mmap_args /* {
1694 1.10 mrg syscallarg(netbsd32_voidp) addr;
1695 1.10 mrg syscallarg(netbsd32_size_t) len;
1696 1.1 mrg syscallarg(int) prot;
1697 1.1 mrg syscallarg(int) flags;
1698 1.1 mrg syscallarg(int) fd;
1699 1.10 mrg syscallarg(netbsd32_long) pad;
1700 1.1 mrg syscallarg(off_t) pos;
1701 1.1 mrg } */ *uap = v;
1702 1.1 mrg struct sys_mmap_args ua;
1703 1.1 mrg int error;
1704 1.1 mrg
1705 1.11 mrg NETBSD32TOP_UAP(addr, void);
1706 1.11 mrg NETBSD32TOX_UAP(len, size_t);
1707 1.11 mrg NETBSD32TO64_UAP(prot);
1708 1.11 mrg NETBSD32TO64_UAP(flags);
1709 1.11 mrg NETBSD32TO64_UAP(fd);
1710 1.11 mrg NETBSD32TOX_UAP(pad, long);
1711 1.11 mrg NETBSD32TOX_UAP(pos, off_t);
1712 1.70 thorpej error = sys_mmap(l, &ua, retval);
1713 1.69 scw if ((u_long)*retval > (u_long)UINT_MAX) {
1714 1.69 scw printf("netbsd32_mmap: retval out of range: 0x%lx",
1715 1.69 scw (u_long)*retval);
1716 1.55 eeh /* Should try to recover and return an error here. */
1717 1.55 eeh }
1718 1.1 mrg return (error);
1719 1.1 mrg }
1720 1.1 mrg
1721 1.1 mrg int
1722 1.70 thorpej netbsd32_lseek(l, v, retval)
1723 1.70 thorpej struct lwp *l;
1724 1.6 eeh void *v;
1725 1.6 eeh register_t *retval;
1726 1.6 eeh {
1727 1.19 eeh struct netbsd32_lseek_args /* {
1728 1.6 eeh syscallarg(int) fd;
1729 1.6 eeh syscallarg(int) pad;
1730 1.6 eeh syscallarg(off_t) offset;
1731 1.6 eeh syscallarg(int) whence;
1732 1.6 eeh } */ *uap = v;
1733 1.6 eeh struct sys_lseek_args ua;
1734 1.6 eeh
1735 1.11 mrg NETBSD32TO64_UAP(fd);
1736 1.11 mrg NETBSD32TO64_UAP(pad);
1737 1.11 mrg NETBSD32TO64_UAP(offset);
1738 1.11 mrg NETBSD32TO64_UAP(whence);
1739 1.70 thorpej return (sys_lseek(l, &ua, retval));
1740 1.6 eeh }
1741 1.6 eeh
1742 1.6 eeh int
1743 1.70 thorpej netbsd32_truncate(l, v, retval)
1744 1.70 thorpej struct lwp *l;
1745 1.1 mrg void *v;
1746 1.1 mrg register_t *retval;
1747 1.1 mrg {
1748 1.19 eeh struct netbsd32_truncate_args /* {
1749 1.10 mrg syscallarg(const netbsd32_charp) path;
1750 1.1 mrg syscallarg(int) pad;
1751 1.1 mrg syscallarg(off_t) length;
1752 1.1 mrg } */ *uap = v;
1753 1.1 mrg struct sys_truncate_args ua;
1754 1.1 mrg
1755 1.11 mrg NETBSD32TOP_UAP(path, const char);
1756 1.11 mrg NETBSD32TO64_UAP(pad);
1757 1.11 mrg NETBSD32TO64_UAP(length);
1758 1.70 thorpej return (sys_truncate(l, &ua, retval));
1759 1.1 mrg }
1760 1.1 mrg
1761 1.1 mrg int
1762 1.70 thorpej netbsd32_ftruncate(l, v, retval)
1763 1.70 thorpej struct lwp *l;
1764 1.6 eeh void *v;
1765 1.6 eeh register_t *retval;
1766 1.6 eeh {
1767 1.19 eeh struct netbsd32_ftruncate_args /* {
1768 1.6 eeh syscallarg(int) fd;
1769 1.6 eeh syscallarg(int) pad;
1770 1.6 eeh syscallarg(off_t) length;
1771 1.6 eeh } */ *uap = v;
1772 1.6 eeh struct sys_ftruncate_args ua;
1773 1.6 eeh
1774 1.11 mrg NETBSD32TO64_UAP(fd);
1775 1.11 mrg NETBSD32TO64_UAP(pad);
1776 1.11 mrg NETBSD32TO64_UAP(length);
1777 1.70 thorpej return (sys_ftruncate(l, &ua, retval));
1778 1.6 eeh }
1779 1.6 eeh
1780 1.53 mrg int
1781 1.70 thorpej netbsd32_mlock(l, v, retval)
1782 1.70 thorpej struct lwp *l;
1783 1.57 mrg void *v;
1784 1.57 mrg register_t *retval;
1785 1.53 mrg {
1786 1.57 mrg struct netbsd32_mlock_args /* {
1787 1.57 mrg syscallarg(const netbsd32_voidp) addr;
1788 1.57 mrg syscallarg(netbsd32_size_t) len;
1789 1.57 mrg } */ *uap = v;
1790 1.57 mrg struct sys_mlock_args ua;
1791 1.53 mrg
1792 1.57 mrg NETBSD32TOP_UAP(addr, const void);
1793 1.57 mrg NETBSD32TO64_UAP(len);
1794 1.70 thorpej return (sys_mlock(l, &ua, retval));
1795 1.53 mrg }
1796 1.53 mrg
1797 1.6 eeh int
1798 1.70 thorpej netbsd32_munlock(l, v, retval)
1799 1.70 thorpej struct lwp *l;
1800 1.1 mrg void *v;
1801 1.1 mrg register_t *retval;
1802 1.1 mrg {
1803 1.57 mrg struct netbsd32_munlock_args /* {
1804 1.57 mrg syscallarg(const netbsd32_voidp) addr;
1805 1.57 mrg syscallarg(netbsd32_size_t) len;
1806 1.1 mrg } */ *uap = v;
1807 1.1 mrg struct sys_munlock_args ua;
1808 1.1 mrg
1809 1.11 mrg NETBSD32TOP_UAP(addr, const void);
1810 1.11 mrg NETBSD32TO64_UAP(len);
1811 1.70 thorpej return (sys_munlock(l, &ua, retval));
1812 1.1 mrg }
1813 1.1 mrg
1814 1.1 mrg int
1815 1.70 thorpej netbsd32_undelete(l, v, retval)
1816 1.70 thorpej struct lwp *l;
1817 1.1 mrg void *v;
1818 1.1 mrg register_t *retval;
1819 1.1 mrg {
1820 1.19 eeh struct netbsd32_undelete_args /* {
1821 1.10 mrg syscallarg(const netbsd32_charp) path;
1822 1.1 mrg } */ *uap = v;
1823 1.1 mrg struct sys_undelete_args ua;
1824 1.1 mrg
1825 1.11 mrg NETBSD32TOP_UAP(path, const char);
1826 1.70 thorpej return (sys_undelete(l, &ua, retval));
1827 1.1 mrg }
1828 1.1 mrg
1829 1.6 eeh int
1830 1.70 thorpej netbsd32_getpgid(l, v, retval)
1831 1.70 thorpej struct lwp *l;
1832 1.6 eeh void *v;
1833 1.6 eeh register_t *retval;
1834 1.6 eeh {
1835 1.19 eeh struct netbsd32_getpgid_args /* {
1836 1.6 eeh syscallarg(pid_t) pid;
1837 1.6 eeh } */ *uap = v;
1838 1.6 eeh struct sys_getpgid_args ua;
1839 1.1 mrg
1840 1.11 mrg NETBSD32TO64_UAP(pid);
1841 1.70 thorpej return (sys_getpgid(l, &ua, retval));
1842 1.1 mrg }
1843 1.1 mrg
1844 1.1 mrg int
1845 1.70 thorpej netbsd32_reboot(l, v, retval)
1846 1.70 thorpej struct lwp *l;
1847 1.1 mrg void *v;
1848 1.1 mrg register_t *retval;
1849 1.1 mrg {
1850 1.19 eeh struct netbsd32_reboot_args /* {
1851 1.1 mrg syscallarg(int) opt;
1852 1.10 mrg syscallarg(netbsd32_charp) bootstr;
1853 1.1 mrg } */ *uap = v;
1854 1.1 mrg struct sys_reboot_args ua;
1855 1.1 mrg
1856 1.11 mrg NETBSD32TO64_UAP(opt);
1857 1.11 mrg NETBSD32TOP_UAP(bootstr, char);
1858 1.70 thorpej return (sys_reboot(l, &ua, retval));
1859 1.1 mrg }
1860 1.1 mrg
1861 1.1 mrg int
1862 1.70 thorpej netbsd32_poll(l, v, retval)
1863 1.70 thorpej struct lwp *l;
1864 1.1 mrg void *v;
1865 1.1 mrg register_t *retval;
1866 1.1 mrg {
1867 1.19 eeh struct netbsd32_poll_args /* {
1868 1.10 mrg syscallarg(netbsd32_pollfdp_t) fds;
1869 1.1 mrg syscallarg(u_int) nfds;
1870 1.1 mrg syscallarg(int) timeout;
1871 1.1 mrg } */ *uap = v;
1872 1.1 mrg struct sys_poll_args ua;
1873 1.1 mrg
1874 1.11 mrg NETBSD32TOP_UAP(fds, struct pollfd);
1875 1.11 mrg NETBSD32TO64_UAP(nfds);
1876 1.11 mrg NETBSD32TO64_UAP(timeout);
1877 1.70 thorpej return (sys_poll(l, &ua, retval));
1878 1.1 mrg }
1879 1.1 mrg
1880 1.6 eeh int
1881 1.70 thorpej netbsd32_fdatasync(l, v, retval)
1882 1.70 thorpej struct lwp *l;
1883 1.6 eeh void *v;
1884 1.6 eeh register_t *retval;
1885 1.6 eeh {
1886 1.19 eeh struct netbsd32_fdatasync_args /* {
1887 1.6 eeh syscallarg(int) fd;
1888 1.6 eeh } */ *uap = v;
1889 1.6 eeh struct sys_fdatasync_args ua;
1890 1.6 eeh
1891 1.11 mrg NETBSD32TO64_UAP(fd);
1892 1.70 thorpej return (sys_fdatasync(l, &ua, retval));
1893 1.1 mrg }
1894 1.1 mrg
1895 1.1 mrg int
1896 1.70 thorpej netbsd32___posix_rename(l, v, retval)
1897 1.70 thorpej struct lwp *l;
1898 1.1 mrg void *v;
1899 1.1 mrg register_t *retval;
1900 1.1 mrg {
1901 1.19 eeh struct netbsd32___posix_rename_args /* {
1902 1.10 mrg syscallarg(const netbsd32_charp) from;
1903 1.10 mrg syscallarg(const netbsd32_charp) to;
1904 1.1 mrg } */ *uap = v;
1905 1.1 mrg struct sys___posix_rename_args ua;
1906 1.1 mrg
1907 1.20 eeh NETBSD32TOP_UAP(from, const char);
1908 1.20 eeh NETBSD32TOP_UAP(to, const char);
1909 1.70 thorpej return (sys___posix_rename(l, &ua, retval));
1910 1.1 mrg }
1911 1.1 mrg
1912 1.1 mrg int
1913 1.70 thorpej netbsd32_swapctl(l, v, retval)
1914 1.70 thorpej struct lwp *l;
1915 1.1 mrg void *v;
1916 1.1 mrg register_t *retval;
1917 1.1 mrg {
1918 1.19 eeh struct netbsd32_swapctl_args /* {
1919 1.1 mrg syscallarg(int) cmd;
1920 1.10 mrg syscallarg(const netbsd32_voidp) arg;
1921 1.1 mrg syscallarg(int) misc;
1922 1.1 mrg } */ *uap = v;
1923 1.1 mrg struct sys_swapctl_args ua;
1924 1.1 mrg
1925 1.11 mrg NETBSD32TO64_UAP(cmd);
1926 1.11 mrg NETBSD32TOP_UAP(arg, const void);
1927 1.11 mrg NETBSD32TO64_UAP(misc);
1928 1.70 thorpej return (sys_swapctl(l, &ua, retval));
1929 1.1 mrg }
1930 1.1 mrg
1931 1.1 mrg int
1932 1.70 thorpej netbsd32_minherit(l, v, retval)
1933 1.70 thorpej struct lwp *l;
1934 1.1 mrg void *v;
1935 1.1 mrg register_t *retval;
1936 1.1 mrg {
1937 1.19 eeh struct netbsd32_minherit_args /* {
1938 1.10 mrg syscallarg(netbsd32_voidp) addr;
1939 1.10 mrg syscallarg(netbsd32_size_t) len;
1940 1.1 mrg syscallarg(int) inherit;
1941 1.1 mrg } */ *uap = v;
1942 1.1 mrg struct sys_minherit_args ua;
1943 1.1 mrg
1944 1.11 mrg NETBSD32TOP_UAP(addr, void);
1945 1.11 mrg NETBSD32TOX_UAP(len, size_t);
1946 1.11 mrg NETBSD32TO64_UAP(inherit);
1947 1.70 thorpej return (sys_minherit(l, &ua, retval));
1948 1.1 mrg }
1949 1.1 mrg
1950 1.1 mrg int
1951 1.70 thorpej netbsd32_lchmod(l, v, retval)
1952 1.70 thorpej struct lwp *l;
1953 1.1 mrg void *v;
1954 1.1 mrg register_t *retval;
1955 1.1 mrg {
1956 1.19 eeh struct netbsd32_lchmod_args /* {
1957 1.10 mrg syscallarg(const netbsd32_charp) path;
1958 1.1 mrg syscallarg(mode_t) mode;
1959 1.1 mrg } */ *uap = v;
1960 1.1 mrg struct sys_lchmod_args ua;
1961 1.1 mrg
1962 1.11 mrg NETBSD32TOP_UAP(path, const char);
1963 1.11 mrg NETBSD32TO64_UAP(mode);
1964 1.70 thorpej return (sys_lchmod(l, &ua, retval));
1965 1.1 mrg }
1966 1.1 mrg
1967 1.1 mrg int
1968 1.70 thorpej netbsd32_lchown(l, v, retval)
1969 1.70 thorpej struct lwp *l;
1970 1.1 mrg void *v;
1971 1.1 mrg register_t *retval;
1972 1.1 mrg {
1973 1.19 eeh struct netbsd32_lchown_args /* {
1974 1.10 mrg syscallarg(const netbsd32_charp) path;
1975 1.1 mrg syscallarg(uid_t) uid;
1976 1.1 mrg syscallarg(gid_t) gid;
1977 1.1 mrg } */ *uap = v;
1978 1.1 mrg struct sys_lchown_args ua;
1979 1.1 mrg
1980 1.11 mrg NETBSD32TOP_UAP(path, const char);
1981 1.11 mrg NETBSD32TO64_UAP(uid);
1982 1.11 mrg NETBSD32TO64_UAP(gid);
1983 1.70 thorpej return (sys_lchown(l, &ua, retval));
1984 1.1 mrg }
1985 1.1 mrg
1986 1.1 mrg int
1987 1.70 thorpej netbsd32___msync13(l, v, retval)
1988 1.70 thorpej struct lwp *l;
1989 1.1 mrg void *v;
1990 1.1 mrg register_t *retval;
1991 1.1 mrg {
1992 1.19 eeh struct netbsd32___msync13_args /* {
1993 1.10 mrg syscallarg(netbsd32_voidp) addr;
1994 1.10 mrg syscallarg(netbsd32_size_t) len;
1995 1.1 mrg syscallarg(int) flags;
1996 1.1 mrg } */ *uap = v;
1997 1.1 mrg struct sys___msync13_args ua;
1998 1.1 mrg
1999 1.11 mrg NETBSD32TOP_UAP(addr, void);
2000 1.11 mrg NETBSD32TOX_UAP(len, size_t);
2001 1.11 mrg NETBSD32TO64_UAP(flags);
2002 1.70 thorpej return (sys___msync13(l, &ua, retval));
2003 1.1 mrg }
2004 1.1 mrg
2005 1.1 mrg int
2006 1.70 thorpej netbsd32___posix_chown(l, v, retval)
2007 1.70 thorpej struct lwp *l;
2008 1.1 mrg void *v;
2009 1.1 mrg register_t *retval;
2010 1.1 mrg {
2011 1.19 eeh struct netbsd32___posix_chown_args /* {
2012 1.10 mrg syscallarg(const netbsd32_charp) path;
2013 1.1 mrg syscallarg(uid_t) uid;
2014 1.1 mrg syscallarg(gid_t) gid;
2015 1.1 mrg } */ *uap = v;
2016 1.1 mrg struct sys___posix_chown_args ua;
2017 1.1 mrg
2018 1.11 mrg NETBSD32TOP_UAP(path, const char);
2019 1.11 mrg NETBSD32TO64_UAP(uid);
2020 1.11 mrg NETBSD32TO64_UAP(gid);
2021 1.70 thorpej return (sys___posix_chown(l, &ua, retval));
2022 1.1 mrg }
2023 1.1 mrg
2024 1.1 mrg int
2025 1.70 thorpej netbsd32___posix_fchown(l, v, retval)
2026 1.70 thorpej struct lwp *l;
2027 1.6 eeh void *v;
2028 1.6 eeh register_t *retval;
2029 1.6 eeh {
2030 1.19 eeh struct netbsd32___posix_fchown_args /* {
2031 1.6 eeh syscallarg(int) fd;
2032 1.6 eeh syscallarg(uid_t) uid;
2033 1.6 eeh syscallarg(gid_t) gid;
2034 1.6 eeh } */ *uap = v;
2035 1.6 eeh struct sys___posix_fchown_args ua;
2036 1.6 eeh
2037 1.11 mrg NETBSD32TO64_UAP(fd);
2038 1.11 mrg NETBSD32TO64_UAP(uid);
2039 1.11 mrg NETBSD32TO64_UAP(gid);
2040 1.70 thorpej return (sys___posix_fchown(l, &ua, retval));
2041 1.6 eeh }
2042 1.6 eeh
2043 1.6 eeh int
2044 1.70 thorpej netbsd32___posix_lchown(l, v, retval)
2045 1.70 thorpej struct lwp *l;
2046 1.1 mrg void *v;
2047 1.1 mrg register_t *retval;
2048 1.1 mrg {
2049 1.19 eeh struct netbsd32___posix_lchown_args /* {
2050 1.10 mrg syscallarg(const netbsd32_charp) path;
2051 1.1 mrg syscallarg(uid_t) uid;
2052 1.1 mrg syscallarg(gid_t) gid;
2053 1.1 mrg } */ *uap = v;
2054 1.1 mrg struct sys___posix_lchown_args ua;
2055 1.1 mrg
2056 1.11 mrg NETBSD32TOP_UAP(path, const char);
2057 1.11 mrg NETBSD32TO64_UAP(uid);
2058 1.11 mrg NETBSD32TO64_UAP(gid);
2059 1.70 thorpej return (sys___posix_lchown(l, &ua, retval));
2060 1.1 mrg }
2061 1.1 mrg
2062 1.1 mrg int
2063 1.70 thorpej netbsd32_getsid(l, v, retval)
2064 1.70 thorpej struct lwp *l;
2065 1.6 eeh void *v;
2066 1.6 eeh register_t *retval;
2067 1.6 eeh {
2068 1.19 eeh struct netbsd32_getsid_args /* {
2069 1.6 eeh syscallarg(pid_t) pid;
2070 1.6 eeh } */ *uap = v;
2071 1.6 eeh struct sys_getsid_args ua;
2072 1.6 eeh
2073 1.11 mrg NETBSD32TO64_UAP(pid);
2074 1.70 thorpej return (sys_getsid(l, &ua, retval));
2075 1.6 eeh }
2076 1.6 eeh
2077 1.42 jdolecek #ifdef KTRACE
2078 1.6 eeh int
2079 1.70 thorpej netbsd32_fktrace(l, v, retval)
2080 1.70 thorpej struct lwp *l;
2081 1.6 eeh void *v;
2082 1.6 eeh register_t *retval;
2083 1.6 eeh {
2084 1.19 eeh struct netbsd32_fktrace_args /* {
2085 1.6 eeh syscallarg(const int) fd;
2086 1.6 eeh syscallarg(int) ops;
2087 1.6 eeh syscallarg(int) facs;
2088 1.6 eeh syscallarg(int) pid;
2089 1.6 eeh } */ *uap = v;
2090 1.43 fvdl #if 0
2091 1.6 eeh struct sys_fktrace_args ua;
2092 1.43 fvdl #else
2093 1.43 fvdl /* XXXX */
2094 1.43 fvdl struct sys_fktrace_noconst_args {
2095 1.43 fvdl syscallarg(int) fd;
2096 1.43 fvdl syscallarg(int) ops;
2097 1.43 fvdl syscallarg(int) facs;
2098 1.43 fvdl syscallarg(int) pid;
2099 1.43 fvdl } ua;
2100 1.43 fvdl #endif
2101 1.6 eeh
2102 1.32 mrg NETBSD32TOX_UAP(fd, int);
2103 1.11 mrg NETBSD32TO64_UAP(ops);
2104 1.11 mrg NETBSD32TO64_UAP(facs);
2105 1.11 mrg NETBSD32TO64_UAP(pid);
2106 1.70 thorpej return (sys_fktrace(l, &ua, retval));
2107 1.6 eeh }
2108 1.42 jdolecek #endif /* KTRACE */
2109 1.6 eeh
2110 1.70 thorpej int netbsd32___sigpending14(l, v, retval)
2111 1.70 thorpej struct lwp *l;
2112 1.20 eeh void *v;
2113 1.20 eeh register_t *retval;
2114 1.20 eeh {
2115 1.25 augustss struct netbsd32___sigpending14_args /* {
2116 1.20 eeh syscallarg(sigset_t *) set;
2117 1.20 eeh } */ *uap = v;
2118 1.20 eeh struct sys___sigpending14_args ua;
2119 1.20 eeh
2120 1.20 eeh NETBSD32TOP_UAP(set, sigset_t);
2121 1.70 thorpej return (sys___sigpending14(l, &ua, retval));
2122 1.20 eeh }
2123 1.20 eeh
2124 1.70 thorpej int netbsd32___sigprocmask14(l, v, retval)
2125 1.70 thorpej struct lwp *l;
2126 1.20 eeh void *v;
2127 1.20 eeh register_t *retval;
2128 1.20 eeh {
2129 1.25 augustss struct netbsd32___sigprocmask14_args /* {
2130 1.20 eeh syscallarg(int) how;
2131 1.20 eeh syscallarg(const sigset_t *) set;
2132 1.20 eeh syscallarg(sigset_t *) oset;
2133 1.20 eeh } */ *uap = v;
2134 1.20 eeh struct sys___sigprocmask14_args ua;
2135 1.20 eeh
2136 1.20 eeh NETBSD32TO64_UAP(how);
2137 1.20 eeh NETBSD32TOP_UAP(set, sigset_t);
2138 1.20 eeh NETBSD32TOP_UAP(oset, sigset_t);
2139 1.70 thorpej return (sys___sigprocmask14(l, &ua, retval));
2140 1.20 eeh }
2141 1.20 eeh
2142 1.70 thorpej int netbsd32___sigsuspend14(l, v, retval)
2143 1.70 thorpej struct lwp *l;
2144 1.20 eeh void *v;
2145 1.20 eeh register_t *retval;
2146 1.20 eeh {
2147 1.20 eeh struct netbsd32___sigsuspend14_args /* {
2148 1.20 eeh syscallarg(const sigset_t *) set;
2149 1.20 eeh } */ *uap = v;
2150 1.20 eeh struct sys___sigsuspend14_args ua;
2151 1.20 eeh
2152 1.20 eeh NETBSD32TOP_UAP(set, sigset_t);
2153 1.70 thorpej return (sys___sigsuspend14(l, &ua, retval));
2154 1.20 eeh };
2155 1.20 eeh
2156 1.70 thorpej int netbsd32_fchroot(l, v, retval)
2157 1.70 thorpej struct lwp *l;
2158 1.20 eeh void *v;
2159 1.20 eeh register_t *retval;
2160 1.20 eeh {
2161 1.25 augustss struct netbsd32_fchroot_args /* {
2162 1.20 eeh syscallarg(int) fd;
2163 1.20 eeh } */ *uap = v;
2164 1.20 eeh struct sys_fchroot_args ua;
2165 1.20 eeh
2166 1.20 eeh NETBSD32TO64_UAP(fd);
2167 1.70 thorpej return (sys_fchroot(l, &ua, retval));
2168 1.20 eeh }
2169 1.20 eeh
2170 1.20 eeh /*
2171 1.20 eeh * Open a file given a file handle.
2172 1.20 eeh *
2173 1.20 eeh * Check permissions, allocate an open file structure,
2174 1.20 eeh * and call the device open routine if any.
2175 1.20 eeh */
2176 1.6 eeh int
2177 1.70 thorpej netbsd32_fhopen(l, v, retval)
2178 1.70 thorpej struct lwp *l;
2179 1.20 eeh void *v;
2180 1.20 eeh register_t *retval;
2181 1.20 eeh {
2182 1.25 augustss struct netbsd32_fhopen_args /* {
2183 1.20 eeh syscallarg(const fhandle_t *) fhp;
2184 1.20 eeh syscallarg(int) flags;
2185 1.20 eeh } */ *uap = v;
2186 1.20 eeh struct sys_fhopen_args ua;
2187 1.20 eeh
2188 1.20 eeh NETBSD32TOP_UAP(fhp, fhandle_t);
2189 1.20 eeh NETBSD32TO64_UAP(flags);
2190 1.70 thorpej return (sys_fhopen(l, &ua, retval));
2191 1.20 eeh }
2192 1.20 eeh
2193 1.70 thorpej int netbsd32_fhstat(l, v, retval)
2194 1.70 thorpej struct lwp *l;
2195 1.20 eeh void *v;
2196 1.20 eeh register_t *retval;
2197 1.20 eeh {
2198 1.25 augustss struct netbsd32_fhstat_args /* {
2199 1.20 eeh syscallarg(const netbsd32_fhandlep_t) fhp;
2200 1.20 eeh syscallarg(struct stat *) sb;
2201 1.20 eeh } */ *uap = v;
2202 1.20 eeh struct sys_fhstat_args ua;
2203 1.20 eeh
2204 1.20 eeh NETBSD32TOP_UAP(fhp, const fhandle_t);
2205 1.20 eeh NETBSD32TOP_UAP(sb, struct stat);
2206 1.70 thorpej return (sys_fhstat(l, &ua, retval));
2207 1.20 eeh }
2208 1.20 eeh
2209 1.70 thorpej int netbsd32_fhstatfs(l, v, retval)
2210 1.70 thorpej struct lwp *l;
2211 1.6 eeh void *v;
2212 1.6 eeh register_t *retval;
2213 1.6 eeh {
2214 1.25 augustss struct netbsd32_fhstatfs_args /* {
2215 1.20 eeh syscallarg(const netbsd32_fhandlep_t) fhp;
2216 1.20 eeh syscallarg(struct statfs *) buf;
2217 1.6 eeh } */ *uap = v;
2218 1.20 eeh struct sys_fhstatfs_args ua;
2219 1.1 mrg
2220 1.20 eeh NETBSD32TOP_UAP(fhp, const fhandle_t);
2221 1.20 eeh NETBSD32TOP_UAP(buf, struct statfs);
2222 1.70 thorpej return (sys_fhstatfs(l, &ua, retval));
2223 1.1 mrg }
2224 1.37 martin
2225 1.37 martin /* virtual memory syscalls */
2226 1.37 martin int
2227 1.70 thorpej netbsd32_ovadvise(l, v, retval)
2228 1.70 thorpej struct lwp *l;
2229 1.37 martin void *v;
2230 1.37 martin register_t *retval;
2231 1.37 martin {
2232 1.37 martin struct netbsd32_ovadvise_args /* {
2233 1.37 martin syscallarg(int) anom;
2234 1.37 martin } */ *uap = v;
2235 1.37 martin struct sys_ovadvise_args ua;
2236 1.37 martin
2237 1.37 martin NETBSD32TO64_UAP(anom);
2238 1.70 thorpej return (sys_ovadvise(l, &ua, retval));
2239 1.37 martin }
2240 1.37 martin
2241