Mail Archives: djgpp/1998/02/26/06:53:52
On Thu, 26 Feb 1998, Vik Heyndrickx wrote:
> Lately I discovered that RHIDE seems to reduce the amount of available
> DOS files handles to a running program by about 5.
If RHIDE has several files open when it runs child programs, that child
will inherit all the handles RHIDE has open. By default, all handles are
open by the DJGPP's libc with the no-inherit bit cleared. (This matches
POSIX behavior, AFAIK.) This is so for all DJGPP programs, I don't think
RHIDE does anything special here.
> Can this be avoided?
Explicitly close the handles you don't need in the program that is run by
RHIDE. Alternatively, run the child via COMMAND.COM ("command.com /c foo")
because COMMAND.COM closes all handles beyond the first 3 when it starts.
Btw, can you explain why does this present a problem? Since DJGPP
programs can automagically have up to 254 handles (provided you set
FILES= appropriately), is this really something which is worth the
hassle?
- Raw text -