by matheusmoreira · 6y ago · 0 comments
> On program startup, the integer file descriptors associated with the streams stdin, stdout, and stderr are 0, 1, and 2, respectively.
Then, after program startup, if it is closed, then fd 2 could be assigned to something else.
> 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.