From owner-freebsd-standards@FreeBSD.ORG Mon Apr 25 17:17:11 2005 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 77DA416A4CE; Mon, 25 Apr 2005 17:17:11 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5FD7C43D60; Mon, 25 Apr 2005 17:17:11 +0000 (GMT) (envelope-from bde@FreeBSD.org) Received: from freefall.freebsd.org (bde@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j3PHHBPi011377; Mon, 25 Apr 2005 17:17:11 GMT (envelope-from bde@freefall.freebsd.org) Received: (from bde@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j3PHHBxQ011373; Mon, 25 Apr 2005 17:17:11 GMT (envelope-from bde) Date: Mon, 25 Apr 2005 17:17:11 GMT From: Bruce Evans Message-Id: <200504251717.j3PHHBxQ011373@freefall.freebsd.org> To: bde@FreeBSD.org, freebsd-standards@FreeBSD.org, bde@FreeBSD.org Subject: Re: kern/53447: poll(2) semantics differ from susV3/POSIX X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2005 17:17:11 -0000 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