> 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