Subject: Re: FIONWRITE proposal
To: Bill Studenmund <wrstuden@NetBSD.org>
From: Robert Elz <kre@munnari.OZ.AU>
List: tech-kern
Date: 10/15/2004 21:02:50
    Date:        Wed, 13 Oct 2004 16:11:12 -0700
    From:        Bill Studenmund <wrstuden@NetBSD.org>
    Message-ID:  <20041013231112.GB9982@netbsd.org>

  | The semantic for the value is that it returns the number of bytes written
  | to the file descriptor that have not been "sent".

Great - I have wanted exactly this for ages (for TCP sockets anyway, that
it is useful on other devices is a bonus).

I'd like to see a good definition of "not been sent" though - in particular,
for TCP sockets, what I want to see is how much data is in the socket
queue that has not yet been acknowledged.   I don't care if the data has
been transmitted ("sent") or not, what matters if whether or not it
successfully reached the other end (at least to the TCP stack there).

I believe that's what your proposed implementation provides, as unack'd
data is still sitting there in the queues, and would be reported that
way - but sometime in the future someone might submit a big report
claiming that (some of) that data has actually been sent (in that it
was observed going out the interface using tcpdump, or something) and
that it should not be included as data that "has not been sent".

And for all those others wanting a different operation, I absolutely do
not want to know (nor do I care) how many more bytes I could write before
my write blocks, or anything else related to that.

Nor can I do this as an application level thing, as that would require
protocol changes that aren't (rationally) possible to make.

kre