fhstat needs to be versioned too (for ino_t). Pointed out by Izumi Tsutsui

This commit is contained in:
christos 2006-05-04 17:48:56 +00:00
parent cffd112ba3
commit 9ec9aed92e
5 changed files with 69 additions and 21 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: vfs_syscalls_30.c,v 1.7 2006/03/01 12:38:12 yamt Exp $ */
/* $NetBSD: vfs_syscalls_30.c,v 1.8 2006/05/04 17:48:57 christos Exp $ */
/*-
* Copyright (c) 2005 The NetBSD Foundation, Inc.
@ -36,7 +36,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_30.c,v 1.7 2006/03/01 12:38:12 yamt Exp $");
__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_30.c,v 1.8 2006/05/04 17:48:57 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -146,6 +146,46 @@ compat_30_sys___lstat13(struct lwp *l, void *v, register_t *retval)
return error;
}
/* ARGSUSED */
int
compat_30_sys_fhstat(struct lwp *l, void *v, register_t *retval)
{
struct compat_30_sys_fhstat_args /* {
syscallarg(const fhandle_t *) fhp;
syscallarg(struct stat13 *) sb;
} */ *uap = v;
struct proc *p = l->l_proc;
struct stat sb;
struct stat13 osb;
int error;
fhandle_t fh;
struct mount *mp;
struct vnode *vp;
/*
* Must be super user
*/
if ((error = suser(p->p_ucred, &p->p_acflag)))
return (error);
if ((error = copyin(SCARG(uap, fhp), &fh, sizeof(fhandle_t))) != 0)
return (error);
if ((mp = vfs_getvfs(&fh.fh_fsid)) == NULL)
return (ESTALE);
if (mp->mnt_op->vfs_fhtovp == NULL)
return EOPNOTSUPP;
if ((error = VFS_FHTOVP(mp, &fh.fh_fid, &vp)))
return (error);
error = vn_stat(vp, &sb, l);
vput(vp);
if (error)
return (error);
cvtstat(&osb, &sb);
error = copyout(&osb, SCARG(uap, sb), sizeof(sb));
return (error);
}
/*
* Return status information about a file descriptor.
*/

View File

@ -1,4 +1,4 @@
$NetBSD: syscalls.master,v 1.50 2005/12/11 12:20:02 christos Exp $
$NetBSD: syscalls.master,v 1.51 2006/05/04 17:48:56 christos Exp $
; from: @(#)syscalls.master 8.2 (Berkeley) 1/13/94
@ -538,9 +538,9 @@
276 NOARGS { int sys_lutimes(const char *path, \
const struct timeval *tptr); }
277 NOARGS { int sys___msync13(void *addr, size_t len, int flags); }
278 NOARGS { int compat_30_sys___stat13(const char *path, struct stat30 *ub); }
279 NOARGS { int compat_30_sys___fstat13(int fd, struct stat30 *sb); }
280 NOARGS { int compat_30_sys___lstat13(const char *path, struct stat30 *ub);}
278 NOARGS { int compat_30_sys___stat13(const char *path, struct stat13 *ub); }
279 NOARGS { int compat_30_sys___fstat13(int fd, struct stat13 *sb); }
280 NOARGS { int compat_30_sys___lstat13(const char *path, struct stat13 *ub);}
281 UNIMPL
282 UNIMPL
283 UNIMPL
@ -560,8 +560,8 @@
297 NOARGS { int compat_20_sys_fhstatfs(const fhandle_t *fhp, \
struct statfs12 *buf); }
298 NOARGS { int sys_fhopen(const fhandle_t *fhp, int flags); }
299 NOARGS { int sys_fhstat(const fhandle_t *fhp, \
struct stat *sb); }
299 NOARGS { int compat_30_sys_fhstat(const fhandle_t *fhp, \
struct stat13 *sb); }
; syscall numbers for FreeBSD
300 UNIMPL modnext
301 UNIMPL modstat

View File

@ -1,4 +1,4 @@
$NetBSD: syscalls.master,v 1.16 2006/02/26 17:12:44 kent Exp $
$NetBSD: syscalls.master,v 1.17 2006/05/04 17:48:56 christos Exp $
; based on NetBSD: syscalls.master,v 1.150 2005/11/29 22:52:02 yamt Exp
; @(#)syscalls.master 8.2 (Berkeley) 1/13/94
@ -643,8 +643,12 @@
296 NOARGS { int sys___getcwd(char *bufp, size_t length); }
297 NOARGS { int sys_fchroot(int fd); }
298 NOARGS { int sys_fhopen(const fhandle_t *fhp, int flags); }
299 NOARGS { int sys_fhstat(const fhandle_t *fhp, \
struct stat *sb); }
#ifdef COMPAT_30
299 NOARGS { int compat_30_sys_fhstat(const fhandle_t *fhp, \
struct stat13 *sb); }
#else
299 EXCL compat_30_sys_fhstat
#endif
#ifdef COMPAT_20
300 NOARGS { int compat_20_sys_fhstatfs(const fhandle_t *fhp, \
struct statfs12 *buf); }
@ -821,3 +825,5 @@
390 NOARGS { int sys___getdents30(int fd, char *buf, size_t count); }
391 NOARGS { int sys_posix_fadvise(int fd, off_t offset, \
off_t len, int advice); }
392 NOARGS { int sys___fhstat30(const fhandle_t *fhp, \
struct stat *sb); }

View File

@ -1,4 +1,4 @@
$NetBSD: syscalls.master,v 1.151 2006/02/24 19:20:20 drochner Exp $
$NetBSD: syscalls.master,v 1.152 2006/05/04 17:48:56 christos Exp $
; @(#)syscalls.master 8.2 (Berkeley) 1/13/94
@ -571,9 +571,9 @@
276 STD { int sys_lutimes(const char *path, \
const struct timeval *tptr); }
277 STD { int sys___msync13(void *addr, size_t len, int flags); }
278 COMPAT_30 { int sys___stat13(const char *path, struct stat30 *ub); }
279 COMPAT_30 { int sys___fstat13(int fd, struct stat30 *sb); }
280 COMPAT_30 { int sys___lstat13(const char *path, struct stat30 *ub); }
278 COMPAT_30 { int sys___stat13(const char *path, struct stat13 *ub); }
279 COMPAT_30 { int sys___fstat13(int fd, struct stat13 *sb); }
280 COMPAT_30 { int sys___lstat13(const char *path, struct stat13 *ub); }
281 STD { int sys___sigaltstack14( \
const struct sigaltstack *nss, \
struct sigaltstack *oss); }
@ -610,8 +610,8 @@
296 STD { int sys___getcwd(char *bufp, size_t length); }
297 STD { int sys_fchroot(int fd); }
298 STD { int sys_fhopen(const fhandle_t *fhp, int flags); }
299 STD { int sys_fhstat(const fhandle_t *fhp, \
struct stat *sb); }
299 COMPAT_30 { int sys_fhstat(const fhandle_t *fhp, \
struct stat13 *sb); }
300 COMPAT_20 { int sys_fhstatfs(const fhandle_t *fhp, \
struct statfs12 *buf); }
#if defined(SYSVSEM) || !defined(_KERNEL)
@ -784,3 +784,5 @@
390 STD { int sys___getdents30(int fd, char *buf, size_t count); }
391 STD { int sys_posix_fadvise(int fd, off_t offset, \
off_t len, int advice); }
392 STD { int sys___fhstat30(const fhandle_t *fhp, \
struct stat *sb); }

View File

@ -1,4 +1,4 @@
/* $NetBSD: vfs_syscalls.c,v 1.239 2006/03/27 20:20:45 martin Exp $ */
/* $NetBSD: vfs_syscalls.c,v 1.240 2006/05/04 17:48:56 christos Exp $ */
/*
* Copyright (c) 1989, 1993
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.239 2006/03/27 20:20:45 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.240 2006/05/04 17:48:56 christos Exp $");
#include "opt_compat_netbsd.h"
#include "opt_compat_43.h"
@ -1372,9 +1372,9 @@ bad:
/* ARGSUSED */
int
sys_fhstat(struct lwp *l, void *v, register_t *retval)
sys___fhstat30(struct lwp *l, void *v, register_t *retval)
{
struct sys_fhstat_args /* {
struct sys___fhstat30_args /* {
syscallarg(const fhandle_t *) fhp;
syscallarg(struct stat *) sb;
} */ *uap = v;