From owner-freebsd-stable Tue May 21 16:27:25 2002 Delivered-To: freebsd-stable@freebsd.org Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by hub.freebsd.org (Postfix) with ESMTP id EEFFB37B40C; Tue, 21 May 2002 16:27:18 -0700 (PDT) Received: by elvis.mu.org (Postfix, from userid 1192) id C6DBDAE1FE; Tue, 21 May 2002 16:27:18 -0700 (PDT) Date: Tue, 21 May 2002 16:27:18 -0700 From: Alfred Perlstein To: David Greenman-Lawrence Cc: "Marc G. Fournier" , freebsd-stable@freebsd.org, dg@freebsd.org Subject: Re: Apache + threads under FreeBSD ... Message-ID: <20020521232718.GP54960@elvis.mu.org> References: <20020521131417.O12810-100000@mail1.hub.org> <20020521164143.GG54960@elvis.mu.org> <20020521160214.Q13109@nexus.root.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020521160214.Q13109@nexus.root.com> User-Agent: Mutt/1.3.27i Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG * David Greenman-Lawrence [020521 16:06] wrote: > >CC'd to David. > > > >David Greenman was going to backport a fix, but I stalled him because > >of backwards compatbility. Since I haven't had the time to implement > >the "osendfile" compat syscall, I'd like to know if he'll be MFC'ing the > >fix or if I should do it? > > I'm too busy to deal with it right now. Please proceed. Thanks David, sorry for the stall on this. Marc, can you please test and let me know asap about this so that I can ask release engineer for permission to MFC this? Index: lib/libc_r/uthread/uthread_sendfile.c =================================================================== RCS file: /home/ncvs/src/lib/libc_r/uthread/uthread_sendfile.c,v retrieving revision 1.2.2.3 diff -c -r1.2.2.3 uthread_sendfile.c *** lib/libc_r/uthread/uthread_sendfile.c 15 Dec 2001 20:03:52 -0000 1.2.2.3 --- lib/libc_r/uthread/uthread_sendfile.c 21 May 2002 23:25:51 -0000 *************** *** 99,115 **** blocking = ((_thread_fd_table[s]->flags & O_NONBLOCK) == 0); /* - * Emulate sendfile(2) weirdness, sendfile doesn't actually send - * nbytes of the file, it really sends (nbytes - headers_size) of - * the file. If (nbytes - headers_size) == 0 we just send trailers. - */ - if (nbytes != 0) { - nbytes -= nwritten; - if (nbytes <= 0) - goto ERROR_2; - } - - /* * Loop while no error occurs and until the expected number of bytes are * written. */ --- 99,104 ---- Index: sys/kern/uipc_syscalls.c =================================================================== RCS file: /home/ncvs/src/sys/kern/uipc_syscalls.c,v retrieving revision 1.65.2.9 diff -c -r1.65.2.9 uipc_syscalls.c *** sys/kern/uipc_syscalls.c 31 Jul 2001 10:49:39 -0000 1.65.2.9 --- sys/kern/uipc_syscalls.c 21 May 2002 23:23:59 -0000 *************** *** 1532,1538 **** struct vm_page *pg; struct writev_args nuap; struct sf_hdtr hdtr; ! off_t off, xfsize, sbytes = 0; int error = 0, s; vp = NULL; --- 1532,1538 ---- struct vm_page *pg; struct writev_args nuap; struct sf_hdtr hdtr; ! off_t off, xfsize, hdtr_size = 0, sbytes = 0; int error = 0, s; vp = NULL; *************** *** 1591,1597 **** error = writev(p, &nuap); if (error) goto done; ! sbytes += p->p_retval[0]; } } --- 1591,1597 ---- error = writev(p, &nuap); if (error) goto done; ! hdtr_size += p->p_retval[0]; } } *************** *** 1831,1841 **** error = writev(p, &nuap); if (error) goto done; ! sbytes += p->p_retval[0]; } done: if (uap->sbytes != NULL) { copyout(&sbytes, uap->sbytes, sizeof(off_t)); } if (vp) --- 1831,1842 ---- error = writev(p, &nuap); if (error) goto done; ! hdtr_size += p->p_retval[0]; } done: if (uap->sbytes != NULL) { + sbytes += hdtr_size; copyout(&sbytes, uap->sbytes, sizeof(off_t)); } if (vp) -- -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 deductible donations for FreeBSD: http://www.freebsdfoundation.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message