On Sun, 22 Dec 2002, Daniel Greenberg wrote:

> The problem can be replicated by using "dir" from the command line, but
> with some sort of filemask. "dir *.*" will do.  On my system "dir *.*"
> starts to return truncated (single entry) directory listings after it
> has been run about 100 times.

this depends on which command.com you use for "dir *.*".
the problem is that, for instance MSDOS 7.10 command.com does
for dir *.*

findfirst(*.*) - creates a hlist
findfirst(*.*) - creates a hlist
findnext()
findnext()
...
last findnext() -> one hlist is popped.
(see mfs.c and +d debug log for what a hlist is -- an internal list of
filenames in the directory essentially). The first findfirst here is
completely useless, but, we cannot trust DOS apps to be logical.

so the net effect is that we have one hlist leaking -- and after 256 times
doing this, the hlist stack is full.

the problem from the DOSEMU side is that a "findfirst" never needs to be
closed (as opposed to closedir(3)).

it's somewhat hard to solve; for this particular case the sequence of two
findfirsts in a row (with the same DTA) could be detected and the first
hlist can then be dropped.

but even then DOS could do a non-exhaustive sequence of findnext()s. Maybe
in the end it would be best to have the hlists maintained as a circular
list rather than a stack, where the oldest one gets recycled.

well, some ideas here, but I'm going away for two weeks, so if this needs
to be fixed very soon it's not going to be me ;)

Bart

-
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to