Re: read() and EOF
- From: Rainer Weikusat <rweikusat@xxxxxxxxxxx>
- Date: Thu, 13 Dec 2007 18:11:47 +0100
David Mathog <mathog@xxxxxxxxxxx> writes:
The linux man pages say that read() returns a 0 at end of file. Is
there a guarantee that it will continue to do that on subsequent
read() from the same fd, or is it conformant to return a 0 once, and
then an error after that? (I vaguely recall seeing that there are
situations where EOF is only returned once, but I could be mistaken.)
One such situation would IIRC be a TCP socket which has been closed by
remote. The read will return an EOF indicator once and an error if
another read is attempted after this.
.
- Follow-Ups:
- Re: read() and EOF
- From: Kenny McCormack
- Re: read() and EOF
- References:
- read() and EOF
- From: David Mathog
- read() and EOF
- Prev by Date: read() and EOF
- Next by Date: Re: read() and EOF
- Previous by thread: read() and EOF
- Next by thread: Re: read() and EOF
- Index(es):