Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Oct 2001 16:43:18 -0700
From:      Bill Fenner <fenner@research.att.com>
To:        rwatson@freebsd.org
Cc:        bright@mu.org, arch@freebsd.org
Subject:   Re: Behavior of select() on pipes
Message-ID:  <200110252343.QAA28072@windsor.research.att.com>

next in thread | raw e-mail | index | archive | help

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.

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
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.

  Bill

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200110252343.QAA28072>