apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sascha Schumann <sas...@schumann.cx>
Subject Re: Unix missing fd 0..2, Win32 service missing stdin/out/err handles
Date Sun, 14 Apr 2002 08:18:57 GMT
> 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

View raw message