Are there standard input / output macros for reading / writing system calls in C?

All my searches returned nothing, and it seemed strange to me that there are no macros to use as file descriptors for system read / write calls for standard input and output instead of 0 (stdout) and 1 (stdin).

Did I miss them, or do they really not exist?

+3
source share
1 answer

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

+11
source

Source: https://habr.com/ru/post/1708990/


All Articles