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