From owner-freebsd-net Thu Feb 1 11:22: 3 2001 Delivered-To: freebsd-net@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id DB70E37B4EC for ; Thu, 1 Feb 2001 11:21:43 -0800 (PST) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id f11JL2323862; Thu, 1 Feb 2001 11:21:02 -0800 (PST) Date: Thu, 1 Feb 2001 11:21:02 -0800 From: Alfred Perlstein To: David Greenman Cc: bsddiy , freebsd-net@FreeBSD.ORG Subject: Re: sendfile() Message-ID: <20010201112102.O26076@fw.wintelcom.net> References: <1217774688.20010201133139@163.net> <200102011819.KAA23975@implode.root.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200102011819.KAA23975@implode.root.com>; from dg@root.com on Thu, Feb 01, 2001 at 10:19:28AM -0800 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org * David Greenman [010201 11:07] wrote: > >I don't want to bring flame war, but the following Linus' words may be > >right: Really David (Xu), what part do you believe to be correct? > The FreeBSD API is the way it is after a collaboration with the Apache > folks. The sendfile() implementation in FreeBSD works just fine and I think > it has one of the most complete API's of any of them out there. Sounds like > typical Linus misinformation. > If you have a point to make, then make it. I would be happy to consider > any real shortcomings in sendfile(), but right now I don't know about any. David Greenman is right, I don't see how using the TCP_CORK option (more on that later) which basically turns the one-syscall sendfile method into a mess of: setsocktopt/ioctl +TCP_CORK writev (most likely required) linux-sendfile writev (possibly optional) setsocktopt/ioctl -TCP_CORK (or possibly close) Now to give Linux the benifit of the doubt (because everyone has to i guess), if TCP_CORK is inherited from the accept() socket, then you loose one syscall. If TCP_CORK is cleared and socket flushed in a timely manner at close() you ditch another syscall, but it's still at least one additional syscall and pretty obtuse API. Oh, and about TCP_CORK, it's a kewl name, and I commend the Linux camp on thier kewl named additions to the system, but to be honest they aren't really as brilliant (or goodlooking) as they think. TCP_CORK should have been made into a socket level option, not a protocol level option. For some reason I'm shocked Linus would have ranted like this on a public list, my guess is that this is a pretty old message dug up from the archives to stir a bit of flamage on the lists. When I first read it I was wondering what David Xu's point was, and I'm still wondering. > >----- > >The fact I dislike about the HP-UX implementation is that it is so obviously stupid. > > > >And I have to say that I absolutely despise the BSD people. They did sendfile() > >after both Linux and HP-UX had done it, and they must have known about both > >implementations. And they chose the HP-UX braindamage, and even brag about > > the fact that they were stupid and didn't understand TCP_CORK (they don't > > say so in those exact words, of course - they just show that they were stupid > > and clueless by the things they brag about). > > > >Oh, well. Not everybody can be as goodlooking as me. It's a curse. > > > >----- > > > >Also note how I said that it is the BSD people I despise. Not the HP-UX implementation. > >The HP-UX one is not pretty, but it works. But I hold open source people to higher standards. > >They are supposed to be the people who do programming because it's an art-form, not because > >it's their job. > > > > > >David Xu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message