delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/02/26/06:53:52

Date: Thu, 26 Feb 1998 13:52:38 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Vik Heyndrickx <Vik DOT Heyndrickx AT rug DOT ac DOT be>
cc: djgpp AT delorie DOT com, robert DOT hoehne AT gmx DOT net
Subject: Re: RHIDE eats file descriptors (among other things)
In-Reply-To: <34F52F97.2151@rug.ac.be>
Message-ID: <Pine.SUN.3.91.980226134601.6246H-100000@is>
MIME-Version: 1.0

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019