> From: Sascha Schumann [mailto:[EMAIL PROTECTED]
> Sent: 14 April 2002 22:46
> > If a user knows that a third-party library (Oracle, whatever) can
> > provide messages to stderr, and they knowingly close that file
> > descriptor without dup()ing it elsewhere, then that is a bug in
> > their software.
>
> Note that the author of the non-apr application does not
> necessarily must submit to that wisdom. While you are
> theoritecally correct, it matters little practically.
>
> > Having APR open a bunch of file-descriptors so
> > that this fixes a potential problem (IMO bug in their software)
> > is just wasting file descriptors.
>
> Not really. (error handling excluded)
>
> do {
> fd = open("/dev/null", O_RDWR);
> } while (fd < 3);
> close(fd);
And this is what most daemons (mostly) do. We could create a
convenience function for this. I don't think it should be default
apr behaviour though. APR is a library. Libraries shouldn't
take options away from users.
Sander