Fix the conformance of poll(2) for sockets after r195423 by returning POLLHUP instead of POLLIN for several cases. Now, the tools/regression/poll results for FreeBSD are closer to that of the Solaris and Linux. Also, improve the POSIX conformance by explicitely clearing POLLOUT when POLLHUP is reported in pollscan(), making the fix global. Submitted by: bde Reviewed by: rwatson MFC r196556 Fix poll() on half-closed sockets, while retaining POLLHUP for fifos. This reverts part of r196460, so that sockets only return POLLHUP if both directions are closed/error. Fifos get POLLHUP by closing the unused direction immediately after creating the sockets. The tools/regression/poll/*poll.c tests now pass except for two other things: - if POLLHUP is returned, POLLIN is always returned as well instead of only when there is data left in the buffer to be read - fifo old/new reader distinction does not work the way POSIX specs it Reviewed by: kib, bde MFC r196554 Add some tests for poll(2)/shutdown(2) interaction. Approved by: re (kensmith)
$FreeBSD$ The directory contains poll(2) and select(2) compliance (and more) tests from Bruce Evans, together with canned test results from several systems for reference. Citing Bruce Evans: The subdirectories contain results of old runs: {4,7}: FreeBSD-{4,7} with old tests (only state 0 and 6b have different expectations; state 0 fails in FreeBSD-4 so the above is wrong about at least when it was broken. I thought that I fixed it completely for select() in FreeBSD-1. One or both of these states were very broken in Net/2 and maybe in 4.4BSD-Lite*). l: Linux-2.6.10 with old tests (only state 0 has different expectations) m: my current version of FreeBSD with old tests (0 and 6b) n: my previous version of FreeBSD with old tests (0 and 6b)