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 20:45:40 GMT
> 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);

    No fd wasted.

    - Sascha                                     Experience IRCG
      http://schumann.cx/                http://schumann.cx/ircg

View raw message