The scenario that I think is still uncovered (edge trigger only):
User					Kernel
--------				----------
					Read data added to socket
					Socket posts read event to epfd
epoll_wait()				Event cleared from epfd, EPOLLIN
					  returned to user
					more read data added to socket
					Socket posts a new read event to epfd
read() until short read with EAGAIN 	all data read from socket
epoll_wait()				returns another EPOLLIN for socket and
					  clears it from epfd
read(), returns 0 right away		socket buffer is empty
This is your 'false positive' case in the epoll(4) man page.
How does the app tell the 0 read here from a read EOF coming from the remote?
If it assumes this is a false positive and there was also an EOF
indication, the EOF will be lost; if it assumes it an EOF the connection
will be prematurely terminated.
-Eric
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/