From owner-freebsd-arch Fri Oct 26 13:40:26 2001 Delivered-To: freebsd-arch@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 294FD37B408; Fri, 26 Oct 2001 13:40:18 -0700 (PDT) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id GAA10715; Sat, 27 Oct 2001 06:40:12 +1000 Date: Sat, 27 Oct 2001 06:39:05 +1000 (EST) From: Bruce Evans X-X-Sender: To: Bill Fenner Cc: , , Subject: Re: Behavior of select() on pipes In-Reply-To: <200110252343.QAA28072@windsor.research.att.com> Message-ID: <20011027061249.K89650-100000@delplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, 25 Oct 2001, Bill Fenner wrote: > IEEE Std 1003.1-200x says, about select: > > A descriptor shall be considered ready for reading when a call > to an input function with O_NONBLOCK clear would not block, > whether or not the function would transfer data successfully. Good. I couldn't find this section when I checked this recently after further followup to the PR. I still can't find a section that gives as much detail for poll(). A poll on POLLIN succeeds when "Data other than high priority data can be read without blocking". > and about read: > > When attempting to read from an empty pipe or FIFO: > > * If no process has the pipe open for writing, read( ) > shall return 0 to indicate end-of-file. > > This combination says to me that select() should consider a FIFO with shall :-) > no writers to be readable. This makes sense when it's been open and > the writer closes it, as you need to read the EOF, but doesn't make > as much sense when it hasn't been opened for write yet. > > Perhaps we can carefully interpret "an empty .. FIFO" to exclude the > time before the first writer opens it. Maybe during that time it's not > empty, it's untenanted. Ugh. It makes sense for the state not to depend on previous activity. It reduces the effect of races. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message