cvs commit: src/include dirent.h src/lib/libc/gen readdir.c telldir.c

Matthew Dillon dillon at apollo.backplane.com
Sat May 3 16:42:37 PDT 2008


:I don't think this is a problem.  Quoting from SUSv3:
:
:If a file is removed from or added to the directory after the most recent=
:=20
:call to opendir() or rewinddir(), whether a subsequent call to readdir() =
:
:returns an entry for that file is unspecified.
:
:and
:
:One of the perceived problems of implementation is that returning to a=20
:given point in a directory is quite difficult to describe formally, in=20
:spite of its intuitive appeal, when systems that use B-trees, hashing=20
:functions, or other similar mechanisms to order their directories are=20
:considered. The definition of seekdir() and telldir() does not specify=20
:whether, when using these interfaces, a given directory entry will be see=
:n=20
:at all, or more than once.
:
:cheers
:   simon

    Yah, I still hate that it doesn't work properly, though.  telldir()
    and seekdir() should probably just be removed from the standard
    entirely.

    I have figured out a way to make it work, but it requires creating
    a new system call capable of returning an array of directory cookies
    in addition to loading the buffer.  I'm not going to spend time on
    it now, but it's there if anyone wants a side project.

					-Matt
					Matthew Dillon 
					<dillon at backplane.com>





More information about the Commits mailing list