]>
diplodocus.org Git - nmh/blob - docs/historical/mh-6.8.5/miscellany/libndir/seekdir.c
1 static char sccsid
[] = "@(#)seekdir.c 4.9 3/25/83";
7 * seek to an entry in a directory.
8 * Only values returned by "telldir" should be passed to seekdir.
15 long curloc
, base
, offset
;
19 curloc
= telldir(dirp
);
22 base
= loc
& ~(DIRBLKSIZ
- 1);
23 offset
= loc
& (DIRBLKSIZ
- 1);
24 (void) lseek(dirp
->dd_fd
, base
, 0);
26 while (dirp
->dd_loc
< offset
) {