From owner-cvs-all@FreeBSD.ORG Tue Sep 13 05:18:16 2005 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A684116A420; Tue, 13 Sep 2005 05:18:16 +0000 (GMT) (envelope-from bde@zeta.org.au) Received: from mailout1.pacific.net.au (mailout1.pacific.net.au [61.8.0.84]) by mx1.FreeBSD.org (Postfix) with ESMTP id 09CF343D6D; Tue, 13 Sep 2005 05:18:10 +0000 (GMT) (envelope-from bde@zeta.org.au) Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.0.86]) by mailout1.pacific.net.au (8.13.4/8.13.4/Debian-3) with ESMTP id j8D5I9jU004892; Tue, 13 Sep 2005 15:18:09 +1000 Received: from epsplex.bde.org (katana.zip.com.au [61.8.7.246]) by mailproxy1.pacific.net.au (8.13.4/8.13.4/Debian-3) with ESMTP id j8D5I72e018203; Tue, 13 Sep 2005 15:18:07 +1000 Date: Tue, 13 Sep 2005 15:18:06 +1000 (EST) From: Bruce Evans X-X-Sender: bde@epsplex.bde.org To: John-Mark Gurney In-Reply-To: <20050912201136.GK793@funkthat.com> Message-ID: <20050913143348.P1831@epsplex.bde.org> References: <200509111303.j8BD3bTK042313@repoman.freebsd.org> <20050912201136.GK793@funkthat.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, Robert Watson , cvs-all@FreeBSD.org Subject: Re: cvs commit: src/tools/regression/fifo/fifo_open Makefile fifo_open.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Sep 2005 05:18:17 -0000 On Mon, 12 Sep 2005, John-Mark Gurney wrote: > Robert Watson wrote this message on Sun, Sep 11, 2005 at 13:03 +0000: >> rwatson 2005-09-11 13:03:36 UTC >> >> FreeBSD src repository >> >> Added files: >> tools/regression/fifo/fifo_open Makefile fifo_open.c >> Log: >> Add fifo_open, a basic regression test for opening fifos, which tests >> the blocking and non-blocking forms of open based on the POSIX spec for >> now O_NONBLOCK should be handled. > > I assume we aren't going to follow the useless POSIX spec for handling > O_NONBLOCK'ing reads wrt select and friends? If you're interested in a > basic test case, I can send you one... > > (That selecting on a fifo for read that doesn't have a writer will > return true, due to the fact that EOF is available for reading on a > O_NONBLOCK fifo.) PRs 76144 and 76525 give test cases for how not following the useful POSIX spec (for this and more directly by not even considering setting POLLHUP for poll()) breaks things. Perhaps the correct behaviour is for select() and poll() to return on EOF iff the EOF has occurred while there are any readers or any data. EOF should be sticky but not persist forever. It must be fairly sticky so that readers don't have races seeing it, and it must not persist forever so that POLLHUP works right for more than 1 "connection" to the fifo. I think a "connection" to a fifo should persist until not only all readers and writers have gone away, but until all data has been read and maybe for a few msec longer of inactivity to give straggling readers a chance to see the "hangup". Bruce