views:

114

answers:

1

All my searches returned nothing and I find it odd that there aren't any macros to use as file descriptors for read/write system calls for standard input and output instead of a 0 (stdout) and a 1 (stdin).

Am I missing them or they really don't exist?

+11  A: 

They exist in unistd.h on a POSIX machine. STDOUT_FILENO, STDIN_FILENO, and STDERR_FILENO. See: http://www.opengroup.org/onlinepubs/009695399/basedefs/unistd.h.html

Josh K