... unix1
More specifically, on unix, POSIX, & other unix-like systems, including BSD, AIX, DYNIX, ...& yes, Linux.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... end-of-input.2
I find that the best value to return to indicate end-of-input on a stream is the stream itself. That's a safe value to signify end-of-input because you know a stream can't contain itself. At least it can't most of the time.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.