Subject: Re: FIONWRITE proposal
To: None <tech-kern@netbsd.org>
From: Allen Briggs <briggs@wasabisystems.com>
List: tech-kern
Date: 10/14/2004 07:38:34
On Wed, Oct 13, 2004 at 09:13:25PM -0700, cgd@broadcom.com wrote:
> Given that the interface exists and has a particular meaning already,
> I'd follow that.

FWIW, I agree with this, although the manual should be explicit that
it doesn't match what you might expect if you're familiar with the
semantics of FIONREAD.  With no prior art, it would make the most
sense to have:

	FIONREAD int
		Get the number of bytes that are immediately available
		for reading.

	FIONWRITE int
		Get the number of bytes that are immediately available
		for writing.

i.e., for non-blocking applications, I think this is exactly what I'd
want--how many bytes can I write in one shot without getting back either
a short write or EAGAIN.

Given the prior art, however, we should probably match the existing
semantics.  Does anyone other than vxworks define it?

Cheers,
-allen

-- 
 Allen Briggs                     briggs@wasabisystems.com
 Wasabi Systems, Inc.             http://www.wasabisystems.com/