Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/compat/linux/common/linux_file64.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/compat/linux/common/linux_file64.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.30.4.1 retrieving revision 1.31 diff -u -p -r1.30.4.1 -r1.31 --- src/sys/compat/linux/common/linux_file64.c 2006/09/09 02:45:52 1.30.4.1 +++ src/sys/compat/linux/common/linux_file64.c 2006/02/09 19:18:56 1.31 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_file64.c,v 1.30.4.1 2006/09/09 02:45:52 rpaulo Exp $ */ +/* $NetBSD: linux_file64.c,v 1.31 2006/02/09 19:18:56 manu Exp $ */ /*- * Copyright (c) 1995, 1998, 2000 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_file64.c,v 1.30.4.1 2006/09/09 02:45:52 rpaulo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_file64.c,v 1.31 2006/02/09 19:18:56 manu Exp $"); #include #include @@ -408,6 +408,7 @@ linux_sys_getdents64(l, v, retval) syscallarg(struct linux_dirent64 *) dent; syscallarg(unsigned int) count; } */ *uap = v; + struct proc *p = l->l_proc; struct dirent *bdp; struct vnode *vp; caddr_t inp, tbuf; /* BSD-format */ @@ -425,7 +426,7 @@ linux_sys_getdents64(l, v, retval) int ncookies; /* getvnode() will use the descriptor for us */ - if ((error = getvnode(l->l_proc->p_fd, SCARG(uap, fd), &fp)) != 0) + if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0) return (error); if ((fp->f_flag & FREAD) == 0) { @@ -439,7 +440,7 @@ linux_sys_getdents64(l, v, retval) goto out1; } - if ((error = VOP_GETATTR(vp, &va, l->l_cred, l))) + if ((error = VOP_GETATTR(vp, &va, p->p_ucred, l))) goto out1; nbytes = SCARG(uap, count); @@ -456,9 +457,10 @@ again: auio.uio_iov = &aiov; auio.uio_iovcnt = 1; auio.uio_rw = UIO_READ; + auio.uio_segflg = UIO_SYSSPACE; + auio.uio_lwp = NULL; auio.uio_resid = buflen; auio.uio_offset = off; - UIO_SETUP_SYSSPACE(&auio); /* * First we read into the malloc'ed buffer, then * we massage it into user space, one record at a time.