Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 26808 invoked by uid 500); 14 Apr 2002 08:18:04 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 26797 invoked from network); 14 Apr 2002 08:18:03 -0000 Date: Sun, 14 Apr 2002 10:18:57 +0200 (CEST) From: Sascha Schumann X-X-Sender: sas@eco.foo To: Jon Travis Cc: "William A. Rowe, Jr." , "dev@apr.apache.org" Subject: Re: Unix missing fd 0..2, Win32 service missing stdin/out/err handles In-Reply-To: <20020413181816.A4947@covalent.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N > The operating system pre-allocates those fd's (0..2 for Unix) -- why would > opening an SDBM ever return any of those file descriptors? The only way > would be if the consumer closed those handles beforehand. If the user > does something like that, their program is broken -- we shouldn't try > to work around that. There are various daemons which close all fds after forking and detaching from the tty, because they have no need to keep those fds open. open(), socket() or accept() can then return an fd in the range 0..2. If APR would be used in such a context, the scenario Bill laid out would be quite possible. - Sascha Experience IRCG http://schumann.cx/ http://schumann.cx/ircg