1 static char sccsid[] = "@(#)readdir.c 4.1 (Berkeley) 83/03/21";
7 * read an old stlye directory entry and present it as a new one
13 char od_name[ODIRSIZ];
17 * get next entry in a directory.
23 register struct olddirect *dp;
24 static struct direct dir;
27 if (dirp->dd_loc == 0) {
28 dirp->dd_size = read(dirp->dd_fd, dirp->dd_buf,
30 if (dirp->dd_size <= 0)
33 if (dirp->dd_loc >= dirp->dd_size) {
37 dp = (struct olddirect *)(dirp->dd_buf + dirp->dd_loc);
38 dirp->dd_loc += sizeof(struct olddirect);
41 dir.d_ino = dp->od_ino;
42 strncpy(dir.d_name, dp->od_name, ODIRSIZ);
43 dir.d_name[ODIRSIZ] = '\0'; /* insure null termination */
44 dir.d_namlen = strlen(dir.d_name);
45 dir.d_reclen = DIRBLKSIZ;