Yes, and you could even be tired to death if you went on,
since there is no such function.
EOF is not a state, it's a condition that is encoutered when
you _try_ to read past the 'end of the file'.
Just a nit, but EOF is a macro, defined to expand to an integral
constant expression of type int and a negative value. Anytime
you see a function which reads (narrow) characters, but returns
an int, you can pretty much assume that it returns a value in
the range 0...UCHAR_MAX (with the character), or EOF. (Note
that this means that the results of assigning it to a char, even
after testing for EOF, is implementation defined---and may raise
an implementation defined signal! In practice, any
implementation which didn't support this would break so much
code it wouldn't be used.)
If you want to be "in", in C++, you'll write
"std::char_traits< char >::eof()" in its place. (I'm an old
fogey, who's not in, so I still write EOF. Except in a
template.)
EOF is when read(2) returns 0.
Some filebuf implementations will also return EOF when read
returns -1
. (This was, of course, about all they could do in
the classical iostream, before exceptions.)
The Unix file system, as such, doesn't recognize end of file as
a particular condition. A function like read will read as many
bytes as are available, up to a maximum that you specify, from
the current position in the file. The exact conditions
defining when it might return with less bytes than requested
depend on the file type, and in the case of "streams", how the
stream has been configured. For regular files, returning with
less than you requested means that you have reached the current
end of the file. The current end; if someone appends data to
the file, a later read will return it.