stream is referred to as ``standard output''; and the error stream is referred to as ``standard error''. These terms are abbreviated to form the symbols used to refer to these files, namely and Each of these symbols is a macro of type pointer to FILE, and can be used with functions like or Since FILEs are a buffering wrapper around Unix file descriptors, the same underly- ing files may also be accessed using the raw Unix file interface, that is, the functions like and The integer file descriptors associated with the streams and are 0, 1, and 2, respectively. The preprocessor symbols STDIN_FILENO, STDOUT_FILENO, and STDERR_FILENO are defined with these values in <unistd.h>. Note that mixing use of FILEs and raw file descriptors can produce unexpected results and should generally be avoided. (For the masochistic among you: POSIX.1, section 8.2.3, describes in detail how this interaction is supposed to work.) A general rule is that file descriptors are handled in the kernel, while stdio is just a library. This means for example, that after an exec, the child inherits all open file descriptors, but all old streams have become inaccessible. Since the symbols and are specified to be macros, assigning to them is non-portable. The standard streams can be made to refer to different files with help of the library function specially introduced to make it possible to reassign and The standard streams are closed by a call to and by normal program termination. The stream is unbuffered. The stream is line-buffered when it points to a terminal. Partial lines will not appear until or is called, or a newline is printed. This can produce unexpected results, especially with debugging output. The buffering mode of the standard streams (or any other stream) can be changed using the or call. Note that in case is associ- ated with a terminal, there may also be input buffering in the terminal driver, entirely unrelated to stdio buffering. (Indeed, normally terminal input is line buffered in the kernel.) This kernel input handling can be modified using calls like see also and The and macros conform to and this standard also stipulates that these three streams shall be open at program startup.