6 main (int argc
, char *argv
[])
16 for (dp
= readdir (dirp
); dp
!= NULL
; dp
= readdir (dirp
))
18 /* save position 3 (after fourth entry) */
20 save3
= telldir (dirp
);
22 printf ("%s\n", dp
->d_name
);
24 /* stop at 400 (just to make sure dirp->__offset and dirp->__size are
30 printf ("going back past 4-th entry...\n");
32 /* go back to saved entry */
33 seekdir (dirp
, save3
);
35 /* Check whether telldir equals to save3 now. */
39 printf ("seekdir (d, %ld); telldir (d) == %ld\n", save3
, cur
);
43 /* print remaining files (3-last) */
44 for (dp
= readdir (dirp
); dp
!= NULL
; dp
= readdir (dirp
))
45 printf ("%s\n", dp
->d_name
);