Subject: Re: FIONWRITE proposal
To: None <tech-kern@netbsd.org>
From: Christos Zoulas <christos@zoulas.com>
List: tech-kern
Date: 10/14/2004 01:24:15
In article <yov5oej69kye.fsf@ldt-sj3-010.sj.broadcom.com>,
 <cgd@broadcom.com> wrote:
>At Wed, 13 Oct 2004 23:12:58 +0000 (UTC), "Bill Studenmund" wrote:
>> This ioctl is like FIONREAD, except instead of looking at the read queue, 
>> it looks at how many bytes are in the write queue.
>> 
>> The semantic for the value is that it returns the number of bytes written 
>> to the file descriptor that have not been "sent". If someone can come up 
>> with a better description, I'm all ears. :-)
>>
>> I want this call because I have an application which needs to do
>> scheduling flow control in userland. I can't just depend on a non-blocking
>> socket as the protocol I'm using deals with requests (protocol blocks or
>> PDUs, etc.). So once you start sending a request, you have to finish it.
>
>Why is "number of bytes which have not yet been 'sent'" the right
>semantics, as opposed to, say, "number of bytes that you can
>immediately write"?
>
>The latter would definitely more akin to the write side of FIONREAD,
>as far as I know...
>
>(I'm thinking that the notion of "have not been 'sent'" is very, very
>nebulous, and, at least from your description isn't the information
>that you actually want, anyway!)

Yes, you are right; but then it should be called something else because
there is already prior art for FIONWRITE with the semantics proposed.

christos