[Bug libc/13660] poll wrong revents returned

bugdal at aerifal dot cx sourceware-bugzilla@sourceware.org
Thu Feb 9 00:42:00 GMT 2012


http://sourceware.org/bugzilla/show_bug.cgi?id=13660

--- Comment #4 from Rich Felker <bugdal at aerifal dot cx> 2012-02-09 00:41:38 UTC ---
If you're getting "invalid file descriptor", that is a bug elsewhere in your
code. It indicates not that the peer has closed the socket, but that YOUR
PROGRAM has closed its end of the socket and it calling read on the file
descriptor after closing it. That has nothing to do with poll or glibc.

When the peer has closed the socket and your end is still open, poll should
return POLLIN|POLLHUP for the fd. This is correct because a call to read will
not block; it will return a zero-length read which means EOF.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the Glibc-bugs mailing list