Joey,

I agree with Vincente that this should be mentioned, though
I disagree that this is a bug.  I understand this effect of
freopen() to be pretty much standard Unix.  Note that 
SUSv3:stderr says:

    The following symbolic values in <unistd.h> define the 
    file descriptors that shall be associated with the 
    C-language stdin, stdout, and stderr when the application 
    is started:

    STDIN_FILENO
        Standard input value, stdin. Its value is 0.
    STDOUT_FILENO
       Standard output value, stdout. Its value is 1.
    STDERR_FILENO
        Standard error value, stderr. Its value is 2.

Note the words "when the application is started".  I have 
changed this manual page text to read:

     On program startup, the integer file descriptors asso&#8208;
     ciated with the streams stdin, stdout, and stderr are
     0, 1, and 2, respectively.  The preprocessor symbols
     STDIN_FILENO, STDOUT_FILENO, and STDERR_FILENO are
     defined with these values in <unistd.h>.  (Applying
     freopen(3) to one of these streams can change the file
     descriptor number associated with the stream.)

The change will appear in man-pages-2.04.
Please close this report.

Cheers,

Michael

-- 
Michael Kerrisk
maintainer of Linux man pages Sections 2, 3, 4, 5, and 7 

Want to help with man page maintenance?  Grab the latest
tarball at ftp://ftp.win.tue.nl/pub/linux-local/manpages/
and grep the source files for 'FIXME'.

Please submit non-trivial man page suggestions as 
"diff -u" patches.

Weitersagen: GMX DSL-Flatrates mit Tempo-Garantie!
Ab 4,99 Euro/Monat: http://www.gmx.net/de/go/dsl


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to