diff options
| -rw-r--r-- | man3/stdin.3 | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/man3/stdin.3 b/man3/stdin.3 index 42d027175b..ef72cfdd05 100644 --- a/man3/stdin.3 +++ b/man3/stdin.3 @@ -2,6 +2,7 @@ .\" .\" This man page was written in 1998 by David A. Holland .\" and placed in the Public Domain. Polished a bit by aeb. +.\" 2005-06-16 mtk, mentioned freopen() .\" .Dd March 24, 1998 .Dt STDIN 3 @@ -48,14 +49,21 @@ interface, that is, the functions like .Xr read 2 and .Xr lseek 2 . -The integer file descriptors associated with the streams +.Pp +On program startup, the integer file descriptors +associated with the streams .Nm stdin , .Nm stdout , and .Nm stderr -are 0, 1, and 2, respectively. The preprocessor symbols STDIN_FILENO, +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 +.Xr freopen 3 +to one of these streams can change the file descriptor number +associated with the stream.) .Pp Note that mixing use of FILEs and raw file descriptors can produce unexpected results and should generally be avoided. |
