Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Jan 2002 10:44:31 -0800
From:      Alfred Perlstein <bright@mu.org>
To:        David Greenman <dg@FreeBSD.org>
Cc:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/kern uipc_syscalls.c
Message-ID:  <20020122104431.X13686@elvis.mu.org>
In-Reply-To: <200201221732.g0MHWAR50160@freefall.freebsd.org>; from dg@FreeBSD.org on Tue, Jan 22, 2002 at 09:32:10AM -0800
References:  <200201221732.g0MHWAR50160@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
* David Greenman <dg@FreeBSD.org> [020122 09:32] wrote:
> dg          2002/01/22 09:32:10 PST
> 
>   Modified files:
>     sys/kern             uipc_syscalls.c 
>   Log:
>   Fixed bug in calculation of amount of file to send when nbytes !=0 and
>   headers or trailers are supplied. Reported by Vladislav Shabanov
>   <vs@rambler-co.ru>.

There's a problem here where people actually figured out this buggy
behaviour and worked around it, however now you've broken their
workarounds.  This is why in a previous email (private I think) I
suggested you use the flags argument or make a new syscall to
implement the proper behaviour.

see revision 1.6 of src/lib/libc_r/uthread/uthread_sendfile.c.
-or-
http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc_r/uthread/uthread_sendfile.c?rev=1.6&content-type=text/x-cvsweb-markup

Apache 2.x depends on the old behaviour as well.

While you're here, you realize that sendfile's sideways return is
pretty confusing, specifically the case where non-blocking IO is
being done you can get back EAGAIN along with sbytes != 0.  Most
other syscalls, (write(2), read(2)) will return a short count and
no error if they would block.

I don't strongly object to MFC'ing this fix, but I think at least:
1) FreeBSD version needs to be bumped in both 5.x and 4.x.
2) If MFC'd please provide a osendfile function to not break applications.
3) consider fixing the sideways return as well to just return a partial
   count in sbytes and not an error?
     (ret == -1 && errno == EAGAIN && sbytes != 0)

thanks,
-- 
-Alfred Perlstein [alfred@freebsd.org]
'Instead of asking why a piece of software is using "1970s technology,"
 start asking why software is ignoring 30 years of accumulated wisdom.'
Tax deductable donations for FreeBSD: http://www.freebsdfoundation.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




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