readdir now returns an eof indication
authorKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Wed, 7 Mar 1990 15:28:13 +0000 (07:28 -0800)
committerKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Wed, 7 Mar 1990 15:28:13 +0000 (07:28 -0800)
SCCS-vsn: sys/ufs/ffs/ffs_vnops.c 7.33
SCCS-vsn: sys/ufs/ffs/ufs_vnops.c 7.33
SCCS-vsn: sys/ufs/lfs/lfs_vnops.c 7.33
SCCS-vsn: sys/ufs/ufs/ufs_vnops.c 7.33

usr/src/sys/ufs/ffs/ffs_vnops.c
usr/src/sys/ufs/ffs/ufs_vnops.c
usr/src/sys/ufs/lfs/lfs_vnops.c
usr/src/sys/ufs/ufs/ufs_vnops.c

index 1e17c73..d5d5bad 100644 (file)
@@ -14,7 +14,7 @@
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- *     @(#)ffs_vnops.c 7.32 (Berkeley) %G%
+ *     @(#)ffs_vnops.c 7.33 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -1245,10 +1245,11 @@ ufs_symlink(ndp, vap, target)
 /*
  * Vnode op for read and write
  */
 /*
  * Vnode op for read and write
  */
-ufs_readdir(vp, uio, cred)
+ufs_readdir(vp, uio, cred, eofflagp)
        struct vnode *vp;
        register struct uio *uio;
        struct ucred *cred;
        struct vnode *vp;
        register struct uio *uio;
        struct ucred *cred;
+       int *eofflagp;
 {
        int count, lost, error;
 
 {
        int count, lost, error;
 
@@ -1261,6 +1262,10 @@ ufs_readdir(vp, uio, cred)
        uio->uio_iov->iov_len = count;
        error = ufs_read(vp, uio, 0, cred);
        uio->uio_resid += lost;
        uio->uio_iov->iov_len = count;
        error = ufs_read(vp, uio, 0, cred);
        uio->uio_resid += lost;
+       if ((VTOI(vp)->i_size - uio->uio_offset) <= 0)
+               *eofflagp = 1;
+       else
+               *eofflagp = 0;
        return (error);
 }
 
        return (error);
 }
 
index 3a72845..3778eb8 100644 (file)
@@ -14,7 +14,7 @@
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- *     @(#)ufs_vnops.c 7.32 (Berkeley) %G%
+ *     @(#)ufs_vnops.c 7.33 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -1245,10 +1245,11 @@ ufs_symlink(ndp, vap, target)
 /*
  * Vnode op for read and write
  */
 /*
  * Vnode op for read and write
  */
-ufs_readdir(vp, uio, cred)
+ufs_readdir(vp, uio, cred, eofflagp)
        struct vnode *vp;
        register struct uio *uio;
        struct ucred *cred;
        struct vnode *vp;
        register struct uio *uio;
        struct ucred *cred;
+       int *eofflagp;
 {
        int count, lost, error;
 
 {
        int count, lost, error;
 
@@ -1261,6 +1262,10 @@ ufs_readdir(vp, uio, cred)
        uio->uio_iov->iov_len = count;
        error = ufs_read(vp, uio, 0, cred);
        uio->uio_resid += lost;
        uio->uio_iov->iov_len = count;
        error = ufs_read(vp, uio, 0, cred);
        uio->uio_resid += lost;
+       if ((VTOI(vp)->i_size - uio->uio_offset) <= 0)
+               *eofflagp = 1;
+       else
+               *eofflagp = 0;
        return (error);
 }
 
        return (error);
 }
 
index d1b7183..f434a61 100644 (file)
@@ -14,7 +14,7 @@
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- *     @(#)lfs_vnops.c 7.32 (Berkeley) %G%
+ *     @(#)lfs_vnops.c 7.33 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -1245,10 +1245,11 @@ ufs_symlink(ndp, vap, target)
 /*
  * Vnode op for read and write
  */
 /*
  * Vnode op for read and write
  */
-ufs_readdir(vp, uio, cred)
+ufs_readdir(vp, uio, cred, eofflagp)
        struct vnode *vp;
        register struct uio *uio;
        struct ucred *cred;
        struct vnode *vp;
        register struct uio *uio;
        struct ucred *cred;
+       int *eofflagp;
 {
        int count, lost, error;
 
 {
        int count, lost, error;
 
@@ -1261,6 +1262,10 @@ ufs_readdir(vp, uio, cred)
        uio->uio_iov->iov_len = count;
        error = ufs_read(vp, uio, 0, cred);
        uio->uio_resid += lost;
        uio->uio_iov->iov_len = count;
        error = ufs_read(vp, uio, 0, cred);
        uio->uio_resid += lost;
+       if ((VTOI(vp)->i_size - uio->uio_offset) <= 0)
+               *eofflagp = 1;
+       else
+               *eofflagp = 0;
        return (error);
 }
 
        return (error);
 }
 
index 3a72845..3778eb8 100644 (file)
@@ -14,7 +14,7 @@
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- *     @(#)ufs_vnops.c 7.32 (Berkeley) %G%
+ *     @(#)ufs_vnops.c 7.33 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -1245,10 +1245,11 @@ ufs_symlink(ndp, vap, target)
 /*
  * Vnode op for read and write
  */
 /*
  * Vnode op for read and write
  */
-ufs_readdir(vp, uio, cred)
+ufs_readdir(vp, uio, cred, eofflagp)
        struct vnode *vp;
        register struct uio *uio;
        struct ucred *cred;
        struct vnode *vp;
        register struct uio *uio;
        struct ucred *cred;
+       int *eofflagp;
 {
        int count, lost, error;
 
 {
        int count, lost, error;
 
@@ -1261,6 +1262,10 @@ ufs_readdir(vp, uio, cred)
        uio->uio_iov->iov_len = count;
        error = ufs_read(vp, uio, 0, cred);
        uio->uio_resid += lost;
        uio->uio_iov->iov_len = count;
        error = ufs_read(vp, uio, 0, cred);
        uio->uio_resid += lost;
+       if ((VTOI(vp)->i_size - uio->uio_offset) <= 0)
+               *eofflagp = 1;
+       else
+               *eofflagp = 0;
        return (error);
 }
 
        return (error);
 }