sendfile(2) SF_NOPUSH flag proposal
Matthew Dillon
dillon at apollo.backplane.com
Wed May 28 13:02:35 PDT 2003
:
:Why not set PRUS_MORETOCOME on all but the final pru_send() call?
:
: Bill
An excellent idea, Bill, it would work. Some additional modifications
would have to be done to the fo_write() and writev() interfaces but it
looks quite reasonable (and non-hackish) to me.
A new FOF_ flag would have to be added to allow the caller of fo_write()
to specify that there is more data to come, e.g. FOF_MORETOCOME, which
would be translated to PRUS_MORETOCOME in sosend().
writev() would have to be split into a writev() syscall and a do_writev()
implementation instead of the two being combined like they are now.
Then do_sendfile() could call the do_writev() implementation in order
to pass additional flags (aka FOF_MORETOCOME) to it, rather then call
the writev() sys call.
Additionally, the writev() implementation could set FOF_MORETOCOME for
all but the last iovec under normal conditions (and use the passed flag
for the last iovec). This would actually improve any C code that uses
writev() on sockets regardless of whether sendfile() is fixed or not.
I'm afraid I do not have time to actually implement this right now, but
I think it's simple enough that virtually any kernel programmer could
do it in a day or less. I think these changes would be an excellent and
non-hackish addition to FreeBSD.
-Matt
Matthew Dillon
<dillon at backplane.com>
More information about the freebsd-arch
mailing list