[BACK]Return to fdesc_vnops.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / miscfs / fdesc

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/miscfs/fdesc/fdesc_vnops.c between version 1.25 and 1.26

version 1.25, 1995/10/09 11:19:04 version 1.26, 1995/10/09 14:03:32
Line 536  fdesc_readdir(ap)
Line 536  fdesc_readdir(ap)
         struct uio *uio = ap->a_uio;          struct uio *uio = ap->a_uio;
         struct dirent d;          struct dirent d;
         struct filedesc *fdp;          struct filedesc *fdp;
         off_t off;  
         int i;          int i;
         int error;          int error;
         u_long *cookies = ap->a_cookies;          u_long *cookies = ap->a_cookies;
Line 554  fdesc_readdir(ap)
Line 553  fdesc_readdir(ap)
   
         if (uio->uio_resid < UIO_MX)          if (uio->uio_resid < UIO_MX)
                 return (EINVAL);                  return (EINVAL);
         off = uio->uio_offset;          if (uio->uio_offset < 0)
         if (off & (UIO_MX - 1) || off < 0)  
                 return (EINVAL);                  return (EINVAL);
   
         error = 0;          error = 0;
         i = off / UIO_MX;          i = uio->uio_offset;
         bzero((caddr_t)&d, UIO_MX);          bzero((caddr_t)&d, UIO_MX);
         d.d_reclen = UIO_MX;          d.d_reclen = UIO_MX;
   
Line 592  fdesc_readdir(ap)
Line 590  fdesc_readdir(ap)
                         if (error = uiomove((caddr_t)&d, UIO_MX, uio))                          if (error = uiomove((caddr_t)&d, UIO_MX, uio))
                                 break;                                  break;
                         if (ncookies-- > 0)                          if (ncookies-- > 0)
                                 *cookies++ = (i + 1) * UIO_MX;                                  *cookies++ = i + 1;
                 }                  }
         } else {          } else {
                 for (; i - 2 < fdp->fd_nfiles && uio->uio_resid >= UIO_MX;                  for (; i - 2 < fdp->fd_nfiles && uio->uio_resid >= UIO_MX;
Line 619  fdesc_readdir(ap)
Line 617  fdesc_readdir(ap)
                         if (error = uiomove((caddr_t)&d, UIO_MX, uio))                          if (error = uiomove((caddr_t)&d, UIO_MX, uio))
                                 break;                                  break;
                         if (ncookies-- > 0)                          if (ncookies-- > 0)
                                 *cookies++ = (i + 1) * UIO_MX;                                  *cookies++ = i + 1;
                 }                  }
         }          }
   
         uio->uio_offset = (i + 1) * UIO_MX;          uio->uio_offset = i;
         return (error);          return (error);
 }  }
   

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.26

CVSweb <webmaster@jp.NetBSD.org>