Questions about readdir/seekdir compliance - os2_delete.c

John E. Malmberg wb8tyw at
Wed Oct 5 20:27:34 GMT 2005

Hello all,

I am finding that OpenVMS is not able to pass the broken_readdir test 

The first issue is that the test is expecting that the first call to 
readdir() will return "." and the second call will return "..".

The "The Open Group Base Specifications Issue 6", for readdir() 
specifically states that the returning of those two files is not 
required, and that if they are returned, they do not have to be the 
first two files.

And these files currently are not created by default in OpenVMS 
directories or simulated by readdir() calls.

So the first question is, how dependent is SAMBA on this behavior?

The next issue is that after an unlink(), on OpenVMS, the seekdir() does 
not return to the point expected by the test.

According the same specification as above for seekdir, in the 
informative section:

"The definition of seekdir() and telldir() does not specify whether, 
when using these interfaces, a given directory entry will be seen at 
all, or more than once."

So this behavior is allowed by the official UNIX standard.

Apparently there is a dependency on SAMBA for this behavior, even though 
it is not mandated for UNIX systems, so I am curious how many UNIX 
systems pass this readdir test.

So far the comments indicate that OS2, and several BSD variants fail 
this test.

And since the desired behavior is not required by the UNIX standard, it 
could be a case that passing this test is proof that the 
readdir()/telldir() will perform the same way on all directories or on 
all file systems, or continue to operate that way after a version upgrade.

The getdents() routine is also not available on OpenVMS at the present 
time, so I am looking for guidance on how to proceed.  getdents() does 
not appear to be described in The Open Group Base Specifications.

It would seem to me a good idea to not to have code depend on a behavior 
that the UNIX standard says is not required.

wb8tyw at
Personal Opinion Only

More information about the samba-technical mailing list