Date: Mon, 25 Apr 2005 17:17:11 GMT From: Bruce Evans <bde@FreeBSD.org> To: bde@FreeBSD.org, freebsd-standards@FreeBSD.org, bde@FreeBSD.org Subject: Re: kern/53447: poll(2) semantics differ from susV3/POSIX Message-ID: <200504251717.j3PHHBxQ011373@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
Synopsis: poll(2) semantics differ from susV3/POSIX Responsible-Changed-From-To: freebsd-standards->bde Responsible-Changed-By: bde Responsible-Changed-When: Mon Apr 25 17:04:09 GMT 2005 Responsible-Changed-Why: FreeBSD has changes that are supposed to fix problems in this area, but the changes seem to just make things worse -- there are now at least 2 more PRs about the new misbehaviour. The correct fix seems to be to simply implement POLLHUP, and not ignore EOF on FIFOs like FreeBSD does now. On EOF, applications polling for POLLIN (including via select() on a read descriptor) should get POLLIN returned (or the read descriptor bit set for select()) like they used to. For poll(), POLLHUP is set too, and applications should check this if they don't want to read EOF. For select(), it is not easy to avoid endlessy reading EOF in some cases, but POSIX is very clear (much clearer than for poll()) that select() on a read descriptor must return immediately on EOF. http://www.freebsd.org/cgi/query-pr.cgi?pr=53447
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200504251717.j3PHHBxQ011373>