Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 May 2002 16:27:18 -0700
From:      Alfred Perlstein <bright@mu.org>
To:        David Greenman-Lawrence <dg@root.com>
Cc:        "Marc G. Fournier" <scrappy@hub.org>, freebsd-stable@freebsd.org, dg@freebsd.org
Subject:   Re: Apache + threads under FreeBSD ...
Message-ID:  <20020521232718.GP54960@elvis.mu.org>
In-Reply-To: <20020521160214.Q13109@nexus.root.com>
References:  <20020521131417.O12810-100000@mail1.hub.org> <20020521164143.GG54960@elvis.mu.org> <20020521160214.Q13109@nexus.root.com>

next in thread | previous in thread | raw e-mail | index | archive | help
* David Greenman-Lawrence <dg@root.com> [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




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