X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-workers-bounces using -f From: "Tim Van Holder" To: , Subject: Re: frlist.c proposed patch Date: Fri, 11 Jan 2002 20:45:30 +0100 Message-ID: <000001c19ad8$877eeba0$915f77d5@zastaixp> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.3416 Importance: Normal In-Reply-To: <10201111815.AA23649@clio.rice.edu> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > > You mean that ANSI/Posix might require that stdin/stdout/stderr be > > always valid and ready to use? I don't have the ANSI C standard. ANSI C++ merely mentions them as part of cstdio (either as variable or macro). POSIX draft 6 lists them as parts of stdio.h; they're described as objects associated with standard in/output. Since the parent closed those, I would suggest it's perfectly valid to have them be "unwritable"; they're associated with a closed file, so errors are acceptable. A bigger problem is that several Unix-born programs assume handles 0, 1, 2 to be the standard streams (in the best case, they use STDOUT_FILENO or similar macros, but it biols down to the same assumption). To cater for that, we could just ensure fd's 0-4 are always opened (so user-space fd's would be 5 and up), e.g. by opening NUL when one of them is closed at startup. Do we control the FD, or do we just have to make do with what DOS gives us?