Many functions that read from a stream return the EOF value, defined in stdio.h. The EOF value is a nonzero value indicating that the end-of-file has been reached during the last read or write.
Some stdio.h functions also use the errno global variable. Refer to the errno.h header section. The use of errno is described in the relevant function descriptions below.