freebsd_file.c revision 1.26 1 1.26 dsl /* $NetBSD: freebsd_file.c,v 1.26 2007/07/12 19:41:57 dsl Exp $ */
2 1.1 mycroft
3 1.1 mycroft /*
4 1.1 mycroft * Copyright (c) 1995 Frank van der Linden
5 1.1 mycroft * All rights reserved.
6 1.1 mycroft *
7 1.1 mycroft * Redistribution and use in source and binary forms, with or without
8 1.1 mycroft * modification, are permitted provided that the following conditions
9 1.1 mycroft * are met:
10 1.1 mycroft * 1. Redistributions of source code must retain the above copyright
11 1.1 mycroft * notice, this list of conditions and the following disclaimer.
12 1.1 mycroft * 2. Redistributions in binary form must reproduce the above copyright
13 1.1 mycroft * notice, this list of conditions and the following disclaimer in the
14 1.1 mycroft * documentation and/or other materials provided with the distribution.
15 1.1 mycroft * 3. All advertising materials mentioning features or use of this software
16 1.1 mycroft * must display the following acknowledgement:
17 1.1 mycroft * This product includes software developed for the NetBSD Project
18 1.1 mycroft * by Frank van der Linden
19 1.1 mycroft * 4. The name of the author may not be used to endorse or promote products
20 1.1 mycroft * derived from this software without specific prior written permission
21 1.1 mycroft *
22 1.1 mycroft * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
23 1.1 mycroft * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24 1.1 mycroft * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25 1.1 mycroft * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
26 1.1 mycroft * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 1.1 mycroft * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 1.1 mycroft * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 1.1 mycroft * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 1.1 mycroft * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 1.1 mycroft * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 1.1 mycroft *
33 1.1 mycroft * from: linux_file.c,v 1.3 1995/04/04 04:21:30 mycroft Exp
34 1.1 mycroft */
35 1.15 lukem
36 1.15 lukem #include <sys/cdefs.h>
37 1.26 dsl __KERNEL_RCSID(0, "$NetBSD: freebsd_file.c,v 1.26 2007/07/12 19:41:57 dsl Exp $");
38 1.9 thorpej
39 1.14 mrg #if defined(_KERNEL_OPT)
40 1.9 thorpej #include "fs_nfs.h"
41 1.11 jdolecek #endif
42 1.1 mycroft
43 1.1 mycroft #include <sys/param.h>
44 1.1 mycroft #include <sys/systm.h>
45 1.1 mycroft #include <sys/namei.h>
46 1.1 mycroft #include <sys/proc.h>
47 1.1 mycroft #include <sys/file.h>
48 1.1 mycroft #include <sys/stat.h>
49 1.1 mycroft #include <sys/filedesc.h>
50 1.1 mycroft #include <sys/ioctl.h>
51 1.1 mycroft #include <sys/kernel.h>
52 1.1 mycroft #include <sys/mount.h>
53 1.1 mycroft #include <sys/malloc.h>
54 1.1 mycroft
55 1.1 mycroft #include <sys/syscallargs.h>
56 1.1 mycroft
57 1.1 mycroft #include <compat/freebsd/freebsd_syscallargs.h>
58 1.10 jdolecek #include <compat/common/compat_util.h>
59 1.1 mycroft
60 1.1 mycroft #define ARRAY_LENGTH(array) (sizeof(array)/sizeof(array[0]))
61 1.1 mycroft
62 1.12 jdolecek static const char * convert_from_freebsd_mount_type __P((int));
63 1.3 christos
64 1.12 jdolecek static const char *
65 1.1 mycroft convert_from_freebsd_mount_type(type)
66 1.1 mycroft int type;
67 1.1 mycroft {
68 1.12 jdolecek static const char * const netbsd_mount_type[] = {
69 1.1 mycroft NULL, /* 0 = MOUNT_NONE */
70 1.2 gwr "ffs", /* 1 = "Fast" Filesystem */
71 1.1 mycroft "nfs", /* 2 = Network Filesystem */
72 1.1 mycroft "mfs", /* 3 = Memory Filesystem */
73 1.1 mycroft "msdos", /* 4 = MSDOS Filesystem */
74 1.1 mycroft "lfs", /* 5 = Log-based Filesystem */
75 1.1 mycroft "lofs", /* 6 = Loopback filesystem */
76 1.1 mycroft "fdesc", /* 7 = File Descriptor Filesystem */
77 1.1 mycroft "portal", /* 8 = Portal Filesystem */
78 1.1 mycroft "null", /* 9 = Minimal Filesystem Layer */
79 1.1 mycroft "umap", /* 10 = User/Group Identifier Remapping Filesystem */
80 1.1 mycroft "kernfs", /* 11 = Kernel Information Filesystem */
81 1.1 mycroft "procfs", /* 12 = /proc Filesystem */
82 1.1 mycroft "afs", /* 13 = Andrew Filesystem */
83 1.1 mycroft "cd9660", /* 14 = ISO9660 (aka CDROM) Filesystem */
84 1.1 mycroft "union", /* 15 = Union (translucent) Filesystem */
85 1.1 mycroft NULL, /* 16 = "devfs" - existing device Filesystem */
86 1.1 mycroft #if 0 /* These filesystems don't exist in FreeBSD */
87 1.1 mycroft "adosfs", /* ?? = AmigaDOS Filesystem */
88 1.1 mycroft #endif
89 1.1 mycroft };
90 1.1 mycroft
91 1.1 mycroft if (type < 0 || type >= ARRAY_LENGTH(netbsd_mount_type))
92 1.1 mycroft return (NULL);
93 1.1 mycroft return (netbsd_mount_type[type]);
94 1.1 mycroft }
95 1.1 mycroft
96 1.1 mycroft int
97 1.17 thorpej freebsd_sys_mount(l, v, retval)
98 1.17 thorpej struct lwp *l;
99 1.1 mycroft void *v;
100 1.1 mycroft register_t *retval;
101 1.1 mycroft {
102 1.1 mycroft struct freebsd_sys_mount_args /* {
103 1.1 mycroft syscallarg(int) type;
104 1.1 mycroft syscallarg(char *) path;
105 1.1 mycroft syscallarg(int) flags;
106 1.24 christos syscallarg(void *) data;
107 1.1 mycroft } */ *uap = v;
108 1.12 jdolecek const char *type;
109 1.26 dsl struct vfsops *vfsops;
110 1.26 dsl register_t dummy;
111 1.1 mycroft
112 1.1 mycroft if ((type = convert_from_freebsd_mount_type(SCARG(uap, type))) == NULL)
113 1.1 mycroft return ENODEV;
114 1.26 dsl vfsops = vfs_getopsbyname(type);
115 1.26 dsl if (vfsops == NULL)
116 1.26 dsl return ENODEV;
117 1.26 dsl
118 1.26 dsl return do_sys_mount(l, vfsops, NULL, SCARG(uap, path),
119 1.26 dsl SCARG(uap, flags), SCARG(uap, data), UIO_USERSPACE, 0, &dummy);
120 1.1 mycroft }
121 1.1 mycroft
122 1.1 mycroft /*
123 1.1 mycroft * The following syscalls are only here because of the alternate path check.
124 1.1 mycroft */
125 1.1 mycroft
126 1.24 christos /* XXX - UNIX domain: int freebsd_sys_bind(int s, void *name, int namelen); */
127 1.24 christos /* XXX - UNIX domain: int freebsd_sys_connect(int s, void *name, int namelen); */
128 1.1 mycroft
129 1.1 mycroft
130 1.1 mycroft int
131 1.17 thorpej freebsd_sys_open(l, v, retval)
132 1.17 thorpej struct lwp *l;
133 1.1 mycroft void *v;
134 1.1 mycroft register_t *retval;
135 1.1 mycroft {
136 1.1 mycroft struct freebsd_sys_open_args /* {
137 1.1 mycroft syscallarg(char *) path;
138 1.1 mycroft syscallarg(int) flags;
139 1.1 mycroft syscallarg(int) mode;
140 1.1 mycroft } */ *uap = v;
141 1.1 mycroft
142 1.17 thorpej return sys_open(l, uap, retval);
143 1.1 mycroft }
144 1.1 mycroft
145 1.1 mycroft int
146 1.17 thorpej compat_43_freebsd_sys_creat(l, v, retval)
147 1.17 thorpej struct lwp *l;
148 1.1 mycroft void *v;
149 1.1 mycroft register_t *retval;
150 1.1 mycroft {
151 1.1 mycroft struct compat_43_freebsd_sys_creat_args /* {
152 1.1 mycroft syscallarg(char *) path;
153 1.1 mycroft syscallarg(int) mode;
154 1.1 mycroft } */ *uap = v;
155 1.1 mycroft
156 1.17 thorpej return compat_43_sys_creat(l, uap, retval);
157 1.1 mycroft }
158 1.1 mycroft
159 1.1 mycroft int
160 1.17 thorpej freebsd_sys_link(l, v, retval)
161 1.17 thorpej struct lwp *l;
162 1.1 mycroft void *v;
163 1.1 mycroft register_t *retval;
164 1.1 mycroft {
165 1.1 mycroft struct freebsd_sys_link_args /* {
166 1.1 mycroft syscallarg(char *) path;
167 1.1 mycroft syscallarg(char *) link;
168 1.1 mycroft } */ *uap = v;
169 1.1 mycroft
170 1.17 thorpej return sys_link(l, uap, retval);
171 1.1 mycroft }
172 1.1 mycroft
173 1.1 mycroft int
174 1.17 thorpej freebsd_sys_unlink(l, v, retval)
175 1.17 thorpej struct lwp *l;
176 1.1 mycroft void *v;
177 1.1 mycroft register_t *retval;
178 1.1 mycroft {
179 1.1 mycroft struct freebsd_sys_unlink_args /* {
180 1.1 mycroft syscallarg(char *) path;
181 1.1 mycroft } */ *uap = v;
182 1.1 mycroft
183 1.17 thorpej return sys_unlink(l, uap, retval);
184 1.1 mycroft }
185 1.1 mycroft
186 1.1 mycroft int
187 1.17 thorpej freebsd_sys_chdir(l, v, retval)
188 1.17 thorpej struct lwp *l;
189 1.1 mycroft void *v;
190 1.1 mycroft register_t *retval;
191 1.1 mycroft {
192 1.1 mycroft struct freebsd_sys_chdir_args /* {
193 1.1 mycroft syscallarg(char *) path;
194 1.1 mycroft } */ *uap = v;
195 1.1 mycroft
196 1.17 thorpej return sys_chdir(l, uap, retval);
197 1.1 mycroft }
198 1.1 mycroft
199 1.1 mycroft int
200 1.17 thorpej freebsd_sys_mknod(l, v, retval)
201 1.17 thorpej struct lwp *l;
202 1.1 mycroft void *v;
203 1.1 mycroft register_t *retval;
204 1.1 mycroft {
205 1.1 mycroft struct freebsd_sys_mknod_args /* {
206 1.1 mycroft syscallarg(char *) path;
207 1.1 mycroft syscallarg(int) mode;
208 1.1 mycroft syscallarg(int) dev;
209 1.1 mycroft } */ *uap = v;
210 1.1 mycroft
211 1.17 thorpej return sys_mknod(l, uap, retval);
212 1.1 mycroft }
213 1.1 mycroft
214 1.1 mycroft int
215 1.17 thorpej freebsd_sys_chmod(l, v, retval)
216 1.17 thorpej struct lwp *l;
217 1.1 mycroft void *v;
218 1.1 mycroft register_t *retval;
219 1.1 mycroft {
220 1.1 mycroft struct freebsd_sys_chmod_args /* {
221 1.1 mycroft syscallarg(char *) path;
222 1.1 mycroft syscallarg(int) mode;
223 1.1 mycroft } */ *uap = v;
224 1.1 mycroft
225 1.17 thorpej return sys_chmod(l, uap, retval);
226 1.1 mycroft }
227 1.1 mycroft
228 1.1 mycroft int
229 1.17 thorpej freebsd_sys_chown(l, v, retval)
230 1.17 thorpej struct lwp *l;
231 1.1 mycroft void *v;
232 1.1 mycroft register_t *retval;
233 1.1 mycroft {
234 1.1 mycroft struct freebsd_sys_chown_args /* {
235 1.1 mycroft syscallarg(char *) path;
236 1.1 mycroft syscallarg(int) uid;
237 1.1 mycroft syscallarg(int) gid;
238 1.1 mycroft } */ *uap = v;
239 1.1 mycroft
240 1.17 thorpej return sys_chown(l, uap, retval);
241 1.6 enami }
242 1.6 enami
243 1.6 enami int
244 1.17 thorpej freebsd_sys_lchown(l, v, retval)
245 1.17 thorpej struct lwp *l;
246 1.6 enami void *v;
247 1.6 enami register_t *retval;
248 1.6 enami {
249 1.6 enami struct freebsd_sys_lchown_args /* {
250 1.6 enami syscallarg(char *) path;
251 1.6 enami syscallarg(int) uid;
252 1.6 enami syscallarg(int) gid;
253 1.6 enami } */ *uap = v;
254 1.6 enami
255 1.17 thorpej return sys_lchown(l, uap, retval);
256 1.1 mycroft }
257 1.1 mycroft
258 1.1 mycroft int
259 1.17 thorpej freebsd_sys_unmount(l, v, retval)
260 1.17 thorpej struct lwp *l;
261 1.1 mycroft void *v;
262 1.1 mycroft register_t *retval;
263 1.1 mycroft {
264 1.1 mycroft struct freebsd_sys_unmount_args /* {
265 1.1 mycroft syscallarg(char *) path;
266 1.1 mycroft syscallarg(int) flags;
267 1.1 mycroft } */ *uap = v;
268 1.1 mycroft
269 1.17 thorpej return sys_unmount(l, uap, retval);
270 1.1 mycroft }
271 1.1 mycroft
272 1.1 mycroft int
273 1.17 thorpej freebsd_sys_access(l, v, retval)
274 1.17 thorpej struct lwp *l;
275 1.1 mycroft void *v;
276 1.1 mycroft register_t *retval;
277 1.1 mycroft {
278 1.1 mycroft struct freebsd_sys_access_args /* {
279 1.1 mycroft syscallarg(char *) path;
280 1.1 mycroft syscallarg(int) flags;
281 1.1 mycroft } */ *uap = v;
282 1.1 mycroft
283 1.17 thorpej return sys_access(l, uap, retval);
284 1.1 mycroft }
285 1.1 mycroft
286 1.1 mycroft int
287 1.17 thorpej freebsd_sys_chflags(l, v, retval)
288 1.17 thorpej struct lwp *l;
289 1.1 mycroft void *v;
290 1.1 mycroft register_t *retval;
291 1.1 mycroft {
292 1.1 mycroft struct freebsd_sys_chflags_args /* {
293 1.1 mycroft syscallarg(char *) path;
294 1.1 mycroft syscallarg(int) flags;
295 1.1 mycroft } */ *uap = v;
296 1.1 mycroft
297 1.17 thorpej return sys_chflags(l, uap, retval);
298 1.1 mycroft }
299 1.1 mycroft
300 1.1 mycroft int
301 1.17 thorpej compat_43_freebsd_sys_stat(l, v, retval)
302 1.17 thorpej struct lwp *l;
303 1.1 mycroft void *v;
304 1.1 mycroft register_t *retval;
305 1.1 mycroft {
306 1.1 mycroft struct compat_43_freebsd_sys_stat_args /* {
307 1.1 mycroft syscallarg(char *) path;
308 1.7 christos syscallarg(struct stat43 *) ub;
309 1.1 mycroft } */ *uap = v;
310 1.1 mycroft
311 1.17 thorpej return compat_43_sys_stat(l, uap, retval);
312 1.1 mycroft }
313 1.1 mycroft
314 1.1 mycroft int
315 1.17 thorpej compat_43_freebsd_sys_lstat(l, v, retval)
316 1.17 thorpej struct lwp *l;
317 1.1 mycroft void *v;
318 1.1 mycroft register_t *retval;
319 1.1 mycroft {
320 1.1 mycroft struct compat_43_freebsd_sys_lstat_args /* {
321 1.1 mycroft syscallarg(char *) path;
322 1.7 christos syscallarg(struct stat43 *) ub;
323 1.1 mycroft } */ *uap = v;
324 1.1 mycroft
325 1.17 thorpej return compat_43_sys_lstat(l, uap, retval);
326 1.1 mycroft }
327 1.1 mycroft
328 1.1 mycroft int
329 1.17 thorpej freebsd_sys_revoke(l, v, retval)
330 1.17 thorpej struct lwp *l;
331 1.1 mycroft void *v;
332 1.1 mycroft register_t *retval;
333 1.1 mycroft {
334 1.1 mycroft struct freebsd_sys_revoke_args /* {
335 1.1 mycroft syscallarg(char *) path;
336 1.1 mycroft } */ *uap = v;
337 1.1 mycroft
338 1.17 thorpej return sys_revoke(l, uap, retval);
339 1.1 mycroft }
340 1.1 mycroft
341 1.1 mycroft int
342 1.17 thorpej freebsd_sys_symlink(l, v, retval)
343 1.17 thorpej struct lwp *l;
344 1.1 mycroft void *v;
345 1.1 mycroft register_t *retval;
346 1.1 mycroft {
347 1.1 mycroft struct freebsd_sys_symlink_args /* {
348 1.1 mycroft syscallarg(char *) path;
349 1.1 mycroft syscallarg(char *) link;
350 1.1 mycroft } */ *uap = v;
351 1.1 mycroft
352 1.17 thorpej return sys_symlink(l, uap, retval);
353 1.1 mycroft }
354 1.1 mycroft
355 1.1 mycroft int
356 1.17 thorpej freebsd_sys_readlink(l, v, retval)
357 1.17 thorpej struct lwp *l;
358 1.1 mycroft void *v;
359 1.1 mycroft register_t *retval;
360 1.1 mycroft {
361 1.1 mycroft struct freebsd_sys_readlink_args /* {
362 1.1 mycroft syscallarg(char *) path;
363 1.1 mycroft syscallarg(char *) buf;
364 1.1 mycroft syscallarg(int) count;
365 1.1 mycroft } */ *uap = v;
366 1.1 mycroft
367 1.17 thorpej return sys_readlink(l, uap, retval);
368 1.1 mycroft }
369 1.1 mycroft
370 1.1 mycroft int
371 1.17 thorpej freebsd_sys_execve(l, v, retval)
372 1.17 thorpej struct lwp *l;
373 1.1 mycroft void *v;
374 1.1 mycroft register_t *retval;
375 1.1 mycroft {
376 1.1 mycroft struct freebsd_sys_execve_args /* {
377 1.1 mycroft syscallarg(char *) path;
378 1.1 mycroft syscallarg(char **) argp;
379 1.1 mycroft syscallarg(char **) envp;
380 1.1 mycroft } */ *uap = v;
381 1.4 mycroft struct sys_execve_args ap;
382 1.4 mycroft
383 1.4 mycroft SCARG(&ap, path) = SCARG(uap, path);
384 1.4 mycroft SCARG(&ap, argp) = SCARG(uap, argp);
385 1.4 mycroft SCARG(&ap, envp) = SCARG(uap, envp);
386 1.4 mycroft
387 1.17 thorpej return sys_execve(l, &ap, retval);
388 1.1 mycroft }
389 1.1 mycroft
390 1.1 mycroft int
391 1.17 thorpej freebsd_sys_chroot(l, v, retval)
392 1.17 thorpej struct lwp *l;
393 1.1 mycroft void *v;
394 1.1 mycroft register_t *retval;
395 1.1 mycroft {
396 1.1 mycroft struct freebsd_sys_chroot_args /* {
397 1.1 mycroft syscallarg(char *) path;
398 1.1 mycroft } */ *uap = v;
399 1.1 mycroft
400 1.17 thorpej return sys_chroot(l, uap, retval);
401 1.1 mycroft }
402 1.1 mycroft
403 1.1 mycroft int
404 1.17 thorpej freebsd_sys_rename(l, v, retval)
405 1.17 thorpej struct lwp *l;
406 1.1 mycroft void *v;
407 1.1 mycroft register_t *retval;
408 1.1 mycroft {
409 1.1 mycroft struct freebsd_sys_rename_args /* {
410 1.1 mycroft syscallarg(char *) from;
411 1.1 mycroft syscallarg(char *) to;
412 1.1 mycroft } */ *uap = v;
413 1.1 mycroft
414 1.17 thorpej return sys_rename(l, uap, retval);
415 1.1 mycroft }
416 1.1 mycroft
417 1.1 mycroft int
418 1.17 thorpej compat_43_freebsd_sys_truncate(l, v, retval)
419 1.17 thorpej struct lwp *l;
420 1.1 mycroft void *v;
421 1.1 mycroft register_t *retval;
422 1.1 mycroft {
423 1.1 mycroft struct compat_43_freebsd_sys_truncate_args /* {
424 1.1 mycroft syscallarg(char *) path;
425 1.1 mycroft syscallarg(long) length;
426 1.1 mycroft } */ *uap = v;
427 1.1 mycroft
428 1.17 thorpej return compat_43_sys_truncate(l, uap, retval);
429 1.1 mycroft }
430 1.1 mycroft
431 1.1 mycroft int
432 1.17 thorpej freebsd_sys_mkfifo(l, v, retval)
433 1.17 thorpej struct lwp *l;
434 1.1 mycroft void *v;
435 1.1 mycroft register_t *retval;
436 1.1 mycroft {
437 1.1 mycroft struct freebsd_sys_mkfifo_args /* {
438 1.1 mycroft syscallarg(char *) path;
439 1.1 mycroft syscallarg(int) mode;
440 1.1 mycroft } */ *uap = v;
441 1.1 mycroft
442 1.17 thorpej return sys_mkfifo(l, uap, retval);
443 1.1 mycroft }
444 1.1 mycroft
445 1.1 mycroft int
446 1.17 thorpej freebsd_sys_mkdir(l, v, retval)
447 1.17 thorpej struct lwp *l;
448 1.1 mycroft void *v;
449 1.1 mycroft register_t *retval;
450 1.1 mycroft {
451 1.1 mycroft struct freebsd_sys_mkdir_args /* {
452 1.1 mycroft syscallarg(char *) path;
453 1.1 mycroft syscallarg(int) mode;
454 1.1 mycroft } */ *uap = v;
455 1.1 mycroft
456 1.17 thorpej return sys_mkdir(l, uap, retval);
457 1.1 mycroft }
458 1.1 mycroft
459 1.1 mycroft int
460 1.17 thorpej freebsd_sys_rmdir(l, v, retval)
461 1.17 thorpej struct lwp *l;
462 1.1 mycroft void *v;
463 1.1 mycroft register_t *retval;
464 1.1 mycroft {
465 1.1 mycroft struct freebsd_sys_rmdir_args /* {
466 1.1 mycroft syscallarg(char *) path;
467 1.1 mycroft } */ *uap = v;
468 1.1 mycroft
469 1.17 thorpej return sys_rmdir(l, uap, retval);
470 1.1 mycroft }
471 1.1 mycroft
472 1.1 mycroft int
473 1.17 thorpej freebsd_sys_statfs(l, v, retval)
474 1.17 thorpej struct lwp *l;
475 1.1 mycroft void *v;
476 1.1 mycroft register_t *retval;
477 1.1 mycroft {
478 1.1 mycroft struct freebsd_sys_stat_args /* {
479 1.1 mycroft syscallarg(char *) path;
480 1.20 christos syscallarg(struct statfs12 *) buf;
481 1.1 mycroft } */ *uap = v;
482 1.1 mycroft
483 1.20 christos return compat_20_sys_statfs(l, uap, retval);
484 1.1 mycroft }
485 1.1 mycroft
486 1.5 thorpej #ifdef NFS
487 1.1 mycroft int
488 1.17 thorpej freebsd_sys_getfh(l, v, retval)
489 1.17 thorpej struct lwp *l;
490 1.1 mycroft void *v;
491 1.1 mycroft register_t *retval;
492 1.1 mycroft {
493 1.1 mycroft struct freebsd_sys_getfh_args /* {
494 1.1 mycroft syscallarg(char *) fname;
495 1.1 mycroft syscallarg(fhandle_t *) fhp;
496 1.1 mycroft } */ *uap = v;
497 1.1 mycroft
498 1.22 martin return compat_30_sys_getfh(l, uap, retval);
499 1.1 mycroft }
500 1.5 thorpej #endif /* NFS */
501 1.1 mycroft
502 1.1 mycroft int
503 1.17 thorpej freebsd_sys_stat(l, v, retval)
504 1.17 thorpej struct lwp *l;
505 1.1 mycroft void *v;
506 1.1 mycroft register_t *retval;
507 1.1 mycroft {
508 1.1 mycroft struct freebsd_sys_stat_args /* {
509 1.1 mycroft syscallarg(char *) path;
510 1.8 christos syscallarg(struct stat12 *) ub;
511 1.1 mycroft } */ *uap = v;
512 1.1 mycroft
513 1.17 thorpej return compat_12_sys_stat(l, uap, retval);
514 1.1 mycroft }
515 1.1 mycroft
516 1.1 mycroft int
517 1.17 thorpej freebsd_sys_lstat(l, v, retval)
518 1.17 thorpej struct lwp *l;
519 1.1 mycroft void *v;
520 1.1 mycroft register_t *retval;
521 1.1 mycroft {
522 1.1 mycroft struct freebsd_sys_lstat_args /* {
523 1.1 mycroft syscallarg(char *) path;
524 1.8 christos syscallarg(struct stat12 *) ub;
525 1.1 mycroft } */ *uap = v;
526 1.1 mycroft
527 1.17 thorpej return compat_12_sys_lstat(l, uap, retval);
528 1.1 mycroft }
529 1.1 mycroft
530 1.1 mycroft int
531 1.17 thorpej freebsd_sys_pathconf(l, v, retval)
532 1.17 thorpej struct lwp *l;
533 1.1 mycroft void *v;
534 1.1 mycroft register_t *retval;
535 1.1 mycroft {
536 1.1 mycroft struct freebsd_sys_pathconf_args /* {
537 1.1 mycroft syscallarg(char *) path;
538 1.1 mycroft syscallarg(int) name;
539 1.1 mycroft } */ *uap = v;
540 1.1 mycroft
541 1.17 thorpej return sys_pathconf(l, uap, retval);
542 1.1 mycroft }
543 1.1 mycroft
544 1.1 mycroft int
545 1.17 thorpej freebsd_sys_truncate(l, v, retval)
546 1.17 thorpej struct lwp *l;
547 1.1 mycroft void *v;
548 1.1 mycroft register_t *retval;
549 1.1 mycroft {
550 1.1 mycroft struct freebsd_sys_truncate_args /* {
551 1.1 mycroft syscallarg(char *) path;
552 1.1 mycroft syscallarg(int) pad;
553 1.1 mycroft syscallarg(off_t) length;
554 1.1 mycroft } */ *uap = v;
555 1.1 mycroft
556 1.17 thorpej return sys_truncate(l, uap, retval);
557 1.1 mycroft }
558