Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 May 2003 13:02:32 -0700 (PDT)
From:      Matthew Dillon <dillon@apollo.backplane.com>
To:        Bill Fenner <fenner@research.att.com>
Cc:        arch@freebsd.org
Subject:   Re: sendfile(2) SF_NOPUSH flag proposal
Message-ID:  <200305282002.h4SK2WUr073964@apollo.backplane.com>
References:  <200305281755.h4SHtbu05504@windsor.research.att.com>

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

:
: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@backplane.com>



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