FreeBSD errors on new dir code

James Peach jpeach at sgi.com
Tue Feb 1 00:52:28 GMT 2005


On Mon, Jan 31, 2005 at 10:57:17AM -0500, Green, Paul wrote:
> Stratus VOS has the same restriction as FreeBSD on the value of seekdir()
> and telldir(). They are valid for the lifetime of the directory stream
> (dirp); once that directory stream is closed, you may (or may not) get a new
> set of values from telldir().  That's all POSIX requires us to do....

IRIX has the same restriction. This will just happen to work if no-one
changes the directory between the closedir and the opendir. But if some
directory entries are removed and you end up trying to seek past the
end of the directory, unusual things will happen ..

    ~/snippets [31] ./a.out testdir
    telldir gave: 0
    seeking to 4096
    readdir failed: Error 0
    telldir gave: 761360498

XFS also has a few different ways of storing directory entries, so
if you racily re-open a changing directory, the order in which entries
are returned could be different.

-- 
James Peach | jpeach at sgi.com | SGI Australian Software Group
I don't speak for SGI.


More information about the samba-technical mailing list