Home | History | Annotate | Line # | Download | only in common
vfs_syscalls_30.c revision 1.37
      1  1.37  riastrad /*	$NetBSD: vfs_syscalls_30.c,v 1.37 2018/09/03 16:29:29 riastradh Exp $	*/
      2   1.1  christos 
      3   1.1  christos /*-
      4  1.26        ad  * Copyright (c) 2005, 2008 The NetBSD Foundation, Inc.
      5   1.1  christos  * All rights reserved.
      6   1.1  christos  *
      7   1.1  christos  * This code is derived from software contributed to The NetBSD Foundation
      8   1.1  christos  * by Christos Zoulas.
      9   1.1  christos  *
     10   1.1  christos  * Redistribution and use in source and binary forms, with or without
     11   1.1  christos  * modification, are permitted provided that the following conditions
     12   1.1  christos  * are met:
     13   1.1  christos  * 1. Redistributions of source code must retain the above copyright
     14   1.1  christos  *    notice, this list of conditions and the following disclaimer.
     15   1.1  christos  * 2. Redistributions in binary form must reproduce the above copyright
     16   1.1  christos  *    notice, this list of conditions and the following disclaimer in the
     17   1.1  christos  *    documentation and/or other materials provided with the distribution.
     18   1.1  christos  *
     19   1.1  christos  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     20   1.1  christos  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     21   1.1  christos  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     22   1.1  christos  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     23   1.1  christos  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     24   1.1  christos  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     25   1.1  christos  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     26   1.1  christos  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     27   1.1  christos  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     28   1.1  christos  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     29   1.1  christos  * POSSIBILITY OF SUCH DAMAGE.
     30   1.1  christos  */
     31   1.1  christos #include <sys/cdefs.h>
     32  1.37  riastrad __KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_30.c,v 1.37 2018/09/03 16:29:29 riastradh Exp $");
     33   1.1  christos 
     34   1.1  christos #include <sys/param.h>
     35   1.1  christos #include <sys/systm.h>
     36   1.1  christos #include <sys/namei.h>
     37   1.1  christos #include <sys/filedesc.h>
     38   1.1  christos #include <sys/kernel.h>
     39   1.1  christos #include <sys/file.h>
     40   1.1  christos #include <sys/stat.h>
     41   1.1  christos #include <sys/socketvar.h>
     42   1.1  christos #include <sys/vnode.h>
     43   1.1  christos #include <sys/mount.h>
     44   1.1  christos #include <sys/proc.h>
     45   1.1  christos #include <sys/uio.h>
     46   1.1  christos #include <sys/dirent.h>
     47   1.1  christos #include <sys/malloc.h>
     48   1.9      elad #include <sys/kauth.h>
     49  1.21       dsl #include <sys/vfs_syscalls.h>
     50   1.1  christos 
     51   1.1  christos #include <sys/syscallargs.h>
     52   1.1  christos 
     53   1.1  christos #include <compat/common/compat_util.h>
     54   1.5  christos #include <compat/sys/stat.h>
     55   1.5  christos #include <compat/sys/dirent.h>
     56  1.10    martin #include <compat/sys/mount.h>
     57   1.1  christos 
     58   1.1  christos static void cvtstat(struct stat13 *, const struct stat *);
     59   1.1  christos 
     60   1.1  christos /*
     61   1.1  christos  * Convert from a new to an old stat structure.
     62   1.1  christos  */
     63   1.1  christos static void
     64   1.1  christos cvtstat(struct stat13 *ost, const struct stat *st)
     65   1.1  christos {
     66   1.1  christos 
     67   1.1  christos 	ost->st_dev = st->st_dev;
     68   1.1  christos 	ost->st_ino = (uint32_t)st->st_ino;
     69   1.1  christos 	ost->st_mode = st->st_mode;
     70   1.1  christos 	ost->st_nlink = st->st_nlink;
     71   1.1  christos 	ost->st_uid = st->st_uid;
     72   1.1  christos 	ost->st_gid = st->st_gid;
     73   1.1  christos 	ost->st_rdev = st->st_rdev;
     74  1.29  christos 	timespec_to_timespec50(&st->st_atimespec, &ost->st_atimespec);
     75  1.29  christos 	timespec_to_timespec50(&st->st_mtimespec, &ost->st_mtimespec);
     76  1.29  christos 	timespec_to_timespec50(&st->st_ctimespec, &ost->st_ctimespec);
     77  1.29  christos 	timespec_to_timespec50(&st->st_birthtimespec, &ost->st_birthtimespec);
     78   1.1  christos 	ost->st_size = st->st_size;
     79   1.1  christos 	ost->st_blocks = st->st_blocks;
     80   1.1  christos 	ost->st_blksize = st->st_blksize;
     81   1.1  christos 	ost->st_flags = st->st_flags;
     82   1.1  christos 	ost->st_gen = st->st_gen;
     83   1.1  christos }
     84   1.1  christos 
     85   1.1  christos /*
     86   1.1  christos  * Get file status; this version follows links.
     87   1.1  christos  */
     88   1.1  christos /* ARGSUSED */
     89   1.1  christos int
     90  1.25       dsl compat_30_sys___stat13(struct lwp *l, const struct compat_30_sys___stat13_args *uap, register_t *retval)
     91   1.1  christos {
     92  1.25       dsl 	/* {
     93   1.1  christos 		syscallarg(const char *) path;
     94   1.1  christos 		syscallarg(struct stat13 *) ub;
     95  1.25       dsl 	} */
     96   1.1  christos 	struct stat sb;
     97   1.1  christos 	struct stat13 osb;
     98   1.1  christos 	int error;
     99   1.1  christos 
    100  1.26        ad 	error = do_sys_stat(SCARG(uap, path), FOLLOW, &sb);
    101   1.1  christos 	if (error)
    102   1.1  christos 		return error;
    103   1.1  christos 	cvtstat(&osb, &sb);
    104   1.1  christos 	error = copyout(&osb, SCARG(uap, ub), sizeof (osb));
    105   1.1  christos 	return error;
    106   1.1  christos }
    107   1.1  christos 
    108   1.1  christos 
    109   1.1  christos /*
    110   1.1  christos  * Get file status; this version does not follow links.
    111   1.1  christos  */
    112   1.1  christos /* ARGSUSED */
    113   1.1  christos int
    114  1.25       dsl compat_30_sys___lstat13(struct lwp *l, const struct compat_30_sys___lstat13_args *uap, register_t *retval)
    115   1.1  christos {
    116  1.25       dsl 	/* {
    117   1.1  christos 		syscallarg(const char *) path;
    118   1.1  christos 		syscallarg(struct stat13 *) ub;
    119  1.25       dsl 	} */
    120   1.1  christos 	struct stat sb;
    121   1.1  christos 	struct stat13 osb;
    122   1.1  christos 	int error;
    123   1.1  christos 
    124  1.26        ad 	error = do_sys_stat(SCARG(uap, path), NOFOLLOW, &sb);
    125   1.1  christos 	if (error)
    126   1.1  christos 		return error;
    127   1.1  christos 	cvtstat(&osb, &sb);
    128   1.1  christos 	error = copyout(&osb, SCARG(uap, ub), sizeof (osb));
    129   1.1  christos 	return error;
    130   1.1  christos }
    131   1.1  christos 
    132   1.8  christos /* ARGSUSED */
    133   1.8  christos int
    134  1.25       dsl compat_30_sys_fhstat(struct lwp *l, const struct compat_30_sys_fhstat_args *uap, register_t *retval)
    135   1.8  christos {
    136  1.25       dsl 	/* {
    137  1.10    martin 		syscallarg(const struct compat_30_fhandle *) fhp;
    138   1.8  christos 		syscallarg(struct stat13 *) sb;
    139  1.25       dsl 	} */
    140   1.8  christos 	struct stat sb;
    141   1.8  christos 	struct stat13 osb;
    142   1.8  christos 	int error;
    143  1.10    martin 	struct compat_30_fhandle fh;
    144   1.8  christos 	struct mount *mp;
    145   1.8  christos 	struct vnode *vp;
    146   1.8  christos 
    147   1.8  christos 	/*
    148   1.8  christos 	 * Must be super user
    149   1.8  christos 	 */
    150  1.17      elad 	if ((error = kauth_authorize_system(l->l_cred, KAUTH_SYSTEM_FILEHANDLE,
    151  1.17      elad 	    0, NULL, NULL, NULL)))
    152   1.8  christos 		return (error);
    153   1.8  christos 
    154  1.10    martin 	if ((error = copyin(SCARG(uap, fhp), &fh, sizeof(fh))) != 0)
    155   1.8  christos 		return (error);
    156   1.8  christos 
    157   1.8  christos 	if ((mp = vfs_getvfs(&fh.fh_fsid)) == NULL)
    158   1.8  christos 		return (ESTALE);
    159   1.8  christos 	if (mp->mnt_op->vfs_fhtovp == NULL)
    160   1.8  christos 		return EOPNOTSUPP;
    161  1.10    martin 	if ((error = VFS_FHTOVP(mp, (struct fid*)&fh.fh_fid, &vp)))
    162   1.8  christos 		return (error);
    163  1.26        ad 	error = vn_stat(vp, &sb);
    164   1.8  christos 	vput(vp);
    165   1.8  christos 	if (error)
    166   1.8  christos 		return (error);
    167   1.8  christos 	cvtstat(&osb, &sb);
    168   1.8  christos 	error = copyout(&osb, SCARG(uap, sb), sizeof(sb));
    169   1.8  christos 	return (error);
    170   1.8  christos }
    171   1.8  christos 
    172   1.1  christos /*
    173   1.1  christos  * Return status information about a file descriptor.
    174   1.1  christos  */
    175   1.1  christos /* ARGSUSED */
    176   1.1  christos int
    177  1.25       dsl compat_30_sys___fstat13(struct lwp *l, const struct compat_30_sys___fstat13_args *uap, register_t *retval)
    178   1.1  christos {
    179  1.25       dsl 	/* {
    180   1.1  christos 		syscallarg(int) fd;
    181   1.1  christos 		syscallarg(struct stat13 *) sb;
    182  1.25       dsl 	} */
    183   1.1  christos 	struct stat sb;
    184   1.1  christos 	struct stat13 osb;
    185   1.1  christos 	int error;
    186   1.1  christos 
    187  1.30     njoly 	error = do_sys_fstat(SCARG(uap, fd), &sb);
    188   1.1  christos 	if (error)
    189   1.1  christos 		return error;
    190   1.1  christos 	cvtstat(&osb, &sb);
    191   1.1  christos 	error = copyout(&osb, SCARG(uap, sb), sizeof (osb));
    192   1.1  christos 	return error;
    193   1.1  christos }
    194   1.1  christos 
    195   1.1  christos /*
    196   1.1  christos  * Read a block of directory entries in a file system independent format.
    197   1.1  christos  */
    198   1.1  christos int
    199  1.25       dsl compat_30_sys_getdents(struct lwp *l, const struct compat_30_sys_getdents_args *uap, register_t *retval)
    200   1.1  christos {
    201  1.25       dsl 	/* {
    202   1.1  christos 		syscallarg(int) fd;
    203   1.1  christos 		syscallarg(char *) buf;
    204   1.1  christos 		syscallarg(size_t) count;
    205  1.25       dsl 	} */
    206   1.1  christos 	struct dirent *bdp;
    207   1.1  christos 	struct vnode *vp;
    208  1.20  christos 	char *inp, *tbuf;	/* BSD-format */
    209   1.1  christos 	int len, reclen;	/* BSD-format */
    210  1.20  christos 	char *outp;		/* NetBSD-3.0-format */
    211   1.1  christos 	int resid;
    212   1.1  christos 	struct file *fp;
    213   1.1  christos 	struct uio auio;
    214   1.1  christos 	struct iovec aiov;
    215   1.1  christos 	struct dirent12 idb;
    216   1.1  christos 	off_t off;		/* true file offset */
    217   1.1  christos 	int buflen, error, eofflag;
    218   1.1  christos 	off_t *cookiebuf = NULL, *cookie;
    219   1.1  christos 	int ncookies;
    220   1.1  christos 
    221  1.28        ad 	/* fd_getvnode() will use the descriptor for us */
    222  1.28        ad 	if ((error = fd_getvnode(SCARG(uap, fd), &fp)) != 0)
    223   1.1  christos 		return error;
    224   1.1  christos 
    225   1.1  christos 	if ((fp->f_flag & FREAD) == 0) {
    226   1.1  christos 		error = EBADF;
    227   1.1  christos 		goto out1;
    228   1.1  christos 	}
    229   1.1  christos 
    230  1.34      matt 	vp = fp->f_vnode;
    231   1.1  christos 	if (vp->v_type != VDIR) {
    232   1.1  christos 		error = EINVAL;
    233   1.1  christos 		goto out1;
    234   1.1  christos 	}
    235   1.1  christos 
    236  1.37  riastrad 	buflen = uimin(MAXBSIZE, SCARG(uap, count));
    237   1.1  christos 	tbuf = malloc(buflen, M_TEMP, M_WAITOK);
    238   1.1  christos 	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
    239   1.1  christos 	off = fp->f_offset;
    240   1.1  christos again:
    241   1.1  christos 	aiov.iov_base = tbuf;
    242   1.1  christos 	aiov.iov_len = buflen;
    243   1.1  christos 	auio.uio_iov = &aiov;
    244   1.1  christos 	auio.uio_iovcnt = 1;
    245   1.1  christos 	auio.uio_rw = UIO_READ;
    246   1.1  christos 	auio.uio_resid = buflen;
    247   1.1  christos 	auio.uio_offset = off;
    248   1.7      yamt 	UIO_SETUP_SYSSPACE(&auio);
    249   1.1  christos 	/*
    250   1.1  christos          * First we read into the malloc'ed buffer, then
    251   1.1  christos          * we massage it into user space, one record at a time.
    252   1.1  christos          */
    253   1.1  christos 	error = VOP_READDIR(vp, &auio, fp->f_cred, &eofflag, &cookiebuf,
    254   1.1  christos 	    &ncookies);
    255   1.1  christos 	if (error)
    256   1.1  christos 		goto out;
    257   1.1  christos 
    258   1.1  christos 	inp = tbuf;
    259   1.1  christos 	outp = SCARG(uap, buf);
    260   1.1  christos 	resid = SCARG(uap, count);
    261   1.1  christos 	if ((len = buflen - auio.uio_resid) == 0)
    262   1.1  christos 		goto eof;
    263   1.1  christos 
    264   1.1  christos 	for (cookie = cookiebuf; len > 0; len -= reclen) {
    265   1.1  christos 		bdp = (struct dirent *)inp;
    266   1.1  christos 		reclen = bdp->d_reclen;
    267   1.2  christos 		if (reclen & _DIRENT_ALIGN(bdp))
    268   1.1  christos 			panic("netbsd30_getdents: bad reclen %d", reclen);
    269   1.1  christos 		if (cookie)
    270   1.1  christos 			off = *cookie++; /* each entry points to the next */
    271   1.1  christos 		else
    272   1.1  christos 			off += reclen;
    273   1.1  christos 		if ((off >> 32) != 0) {
    274   1.4      yamt 			compat_offseterr(vp, "netbsd30_getdents");
    275   1.1  christos 			error = EINVAL;
    276   1.1  christos 			goto out;
    277   1.1  christos 		}
    278   1.1  christos 		if (bdp->d_namlen >= sizeof(idb.d_name))
    279   1.1  christos 			idb.d_namlen = sizeof(idb.d_name) - 1;
    280   1.1  christos 		else
    281   1.1  christos 			idb.d_namlen = bdp->d_namlen;
    282   1.1  christos 		idb.d_reclen = _DIRENT_SIZE(&idb);
    283   1.1  christos 		if (reclen > len || resid < idb.d_reclen) {
    284   1.1  christos 			/* entry too big for buffer, so just stop */
    285   1.1  christos 			outp++;
    286   1.1  christos 			break;
    287   1.1  christos 		}
    288   1.1  christos 		/*
    289   1.4      yamt 		 * Massage in place to make a NetBSD-3.0-shaped dirent
    290   1.1  christos 		 * (otherwise we have to worry about touching user memory
    291   1.1  christos 		 * outside of the copyout() call).
    292   1.1  christos 		 */
    293   1.1  christos 		idb.d_fileno = (u_int32_t)bdp->d_fileno;
    294   1.1  christos 		idb.d_type = bdp->d_type;
    295   1.1  christos 		(void)memcpy(idb.d_name, bdp->d_name, idb.d_namlen);
    296   1.3      yamt 		memset(idb.d_name + idb.d_namlen, 0,
    297   1.3      yamt 		    idb.d_reclen - _DIRENT_NAMEOFF(&idb) - idb.d_namlen);
    298   1.1  christos 		if ((error = copyout(&idb, outp, idb.d_reclen)) != 0)
    299   1.1  christos 			goto out;
    300   1.1  christos 		/* advance past this real entry */
    301   1.1  christos 		inp += reclen;
    302   1.4      yamt 		/* advance output past NetBSD-3.0-shaped entry */
    303   1.1  christos 		outp += idb.d_reclen;
    304   1.1  christos 		resid -= idb.d_reclen;
    305   1.1  christos 	}
    306   1.1  christos 
    307   1.1  christos 	/* if we squished out the whole block, try again */
    308  1.31        he 	if (outp == SCARG(uap, buf)) {
    309  1.31        he 		if (cookiebuf)
    310  1.31        he 			free(cookiebuf, M_TEMP);
    311  1.31        he 		cookiebuf = NULL;
    312   1.1  christos 		goto again;
    313  1.31        he 	}
    314   1.1  christos 	fp->f_offset = off;	/* update the vnode offset */
    315   1.1  christos 
    316   1.1  christos eof:
    317   1.1  christos 	*retval = SCARG(uap, count) - resid;
    318   1.1  christos out:
    319  1.32   hannken 	VOP_UNLOCK(vp);
    320   1.1  christos 	if (cookiebuf)
    321   1.1  christos 		free(cookiebuf, M_TEMP);
    322   1.1  christos 	free(tbuf, M_TEMP);
    323   1.1  christos out1:
    324  1.26        ad 	fd_putfile(SCARG(uap, fd));
    325   1.1  christos 	return error;
    326   1.1  christos }
    327  1.10    martin 
    328  1.10    martin /*
    329  1.10    martin  * Get file handle system call
    330  1.10    martin  */
    331  1.10    martin int
    332  1.25       dsl compat_30_sys_getfh(struct lwp *l, const struct compat_30_sys_getfh_args *uap, register_t *retval)
    333  1.10    martin {
    334  1.25       dsl 	/* {
    335  1.10    martin 		syscallarg(char *) fname;
    336  1.10    martin 		syscallarg(struct compat_30_fhandle *) fhp;
    337  1.25       dsl 	} */
    338  1.10    martin 	struct vnode *vp;
    339  1.11      yamt 	struct compat_30_fhandle fh;
    340  1.10    martin 	int error;
    341  1.33  dholland 	struct pathbuf *pb;
    342  1.10    martin 	struct nameidata nd;
    343  1.10    martin 	size_t sz;
    344  1.10    martin 
    345  1.10    martin 	/*
    346  1.10    martin 	 * Must be super user
    347  1.10    martin 	 */
    348  1.17      elad 	error = kauth_authorize_system(l->l_cred, KAUTH_SYSTEM_FILEHANDLE,
    349  1.17      elad 	    0, NULL, NULL, NULL);
    350  1.10    martin 	if (error)
    351  1.10    martin 		return (error);
    352  1.33  dholland 
    353  1.33  dholland 	error = pathbuf_copyin(SCARG(uap, fname), &pb);
    354  1.33  dholland 	if (error) {
    355  1.33  dholland 		return error;
    356  1.33  dholland 	}
    357  1.33  dholland 	NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | TRYEMULROOT, pb);
    358  1.10    martin 	error = namei(&nd);
    359  1.36  christos 	pathbuf_destroy(pb);
    360  1.36  christos 	if (error)
    361  1.36  christos 		return error;
    362  1.10    martin 	vp = nd.ni_vp;
    363  1.35      maxv 
    364  1.10    martin 	sz = sizeof(struct compat_30_fhandle);
    365  1.11      yamt 	error = vfs_composefh(vp, (void *)&fh, &sz);
    366  1.10    martin 	vput(vp);
    367  1.15      yamt 	if (sz != FHANDLE_SIZE_COMPAT) {
    368  1.15      yamt 		error = EINVAL;
    369  1.15      yamt 	}
    370  1.10    martin 	if (error)
    371  1.10    martin 		return (error);
    372  1.15      yamt 	error = copyout(&fh, SCARG(uap, fhp), sizeof(struct compat_30_fhandle));
    373  1.10    martin 	return (error);
    374  1.10    martin }
    375  1.13    martin 
    376  1.13    martin /*
    377  1.13    martin  * Open a file given a file handle.
    378  1.13    martin  *
    379  1.13    martin  * Check permissions, allocate an open file structure,
    380  1.13    martin  * and call the device open routine if any.
    381  1.13    martin  */
    382  1.13    martin int
    383  1.25       dsl compat_30_sys_fhopen(struct lwp *l, const struct compat_30_sys_fhopen_args *uap, register_t *retval)
    384  1.13    martin {
    385  1.25       dsl 	/* {
    386  1.13    martin 		syscallarg(const fhandle_t *) fhp;
    387  1.13    martin 		syscallarg(int) flags;
    388  1.25       dsl 	} */
    389  1.13    martin 
    390  1.14      yamt 	return dofhopen(l, SCARG(uap, fhp), FHANDLE_SIZE_COMPAT,
    391  1.14      yamt 	    SCARG(uap, flags), retval);
    392  1.13    martin }
    393  1.13    martin 
    394  1.13    martin /* ARGSUSED */
    395  1.13    martin int
    396  1.25       dsl compat_30_sys___fhstat30(struct lwp *l, const struct compat_30_sys___fhstat30_args *uap_30, register_t *retval)
    397  1.13    martin {
    398  1.25       dsl 	/* {
    399  1.13    martin 		syscallarg(const fhandle_t *) fhp;
    400  1.29  christos 		syscallarg(struct stat30 *) sb;
    401  1.25       dsl 	} */
    402  1.29  christos 	struct stat sb;
    403  1.29  christos 	struct stat13 osb;
    404  1.29  christos 	int error;
    405  1.23       dsl 
    406  1.29  christos 	error = do_fhstat(l, SCARG(uap_30, fhp), FHANDLE_SIZE_COMPAT, &sb);
    407  1.29  christos 	if (error)
    408  1.29  christos 		return error;
    409  1.29  christos 	cvtstat(&osb, &sb);
    410  1.29  christos 	error = copyout(&osb, SCARG(uap_30, sb), sizeof (osb));
    411  1.29  christos 	return error;
    412  1.13    martin }
    413  1.13    martin 
    414  1.13    martin /* ARGSUSED */
    415  1.13    martin int
    416  1.25       dsl compat_30_sys_fhstatvfs1(struct lwp *l, const struct compat_30_sys_fhstatvfs1_args *uap_30, register_t *retval)
    417  1.13    martin {
    418  1.25       dsl 	/* {
    419  1.13    martin 		syscallarg(const fhandle_t *) fhp;
    420  1.13    martin 		syscallarg(struct statvfs *) buf;
    421  1.13    martin 		syscallarg(int)	flags;
    422  1.25       dsl 	} */
    423  1.23       dsl 	struct sys___fhstatvfs140_args uap;
    424  1.23       dsl 
    425  1.23       dsl 	SCARG(&uap, fhp) = SCARG(uap_30, fhp);
    426  1.23       dsl 	SCARG(&uap, fh_size) = FHANDLE_SIZE_COMPAT;
    427  1.23       dsl 	SCARG(&uap, buf) = SCARG(uap_30, buf);
    428  1.23       dsl 	SCARG(&uap, flags) = SCARG(uap_30, flags);
    429  1.13    martin 
    430  1.23       dsl 	return sys___fhstatvfs140(l, &uap, retval);
    431  1.13    martin }
    432