From owner-freebsd-arch@FreeBSD.ORG Wed May 28 01:08:32 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 07A6A37B404 for ; Wed, 28 May 2003 01:08:31 -0700 (PDT) Received: from park.rambler.ru (park.rambler.ru [81.19.64.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 295BC43FA3 for ; Wed, 28 May 2003 01:08:30 -0700 (PDT) (envelope-from is@rambler-co.ru) Received: from is.park.rambler.ru (is.park.rambler.ru [81.19.64.102]) by park.rambler.ru (8.12.6/8.12.6) with ESMTP id h4S88SmF037161; Wed, 28 May 2003 12:08:28 +0400 (MSD) Date: Wed, 28 May 2003 12:08:27 +0400 (MSD) From: Igor Sysoev X-Sender: is@is To: Terry Lambert In-Reply-To: <3ED45145.5389980@mindspring.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: arch@freebsd.org Subject: Re: sendfile(2) SF_NOPUSH flag proposal X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2003 08:08:32 -0000 On Tue, 27 May 2003, Terry Lambert wrote: > Igor Sysoev wrote: > > > I don't think overhead is the issue, at this point: say we agree > > > with you on overhead, for your particular application, and we are > > > not against you solving your overhead problem: why exactly does > > > the API have to change to fix the root cause of the problem? > > > > I do not propose the change of the API, I propose the source and binary > > compatible addition. > > The "Subject:" line says you want to add a flag. This is > binary backward compatible, but it is not binary portable, > and it is not source portable to systems that use your flag. > > What happens when you want to recompile or run your code > that uses the new flag on NetBSD, Darwin, MacOS X, etc.? > > I'll tell you what happens: you get a compilation error > with an undefined variable. Really ? I think that on NetBSD, Darwin, and MacOS X I would get: ----- warning: implicit declaration of function `sendfile' ----- and then: ----- /tmp/ccQ50515.o(.text+0x7): undefined reference to `sendfile' ----- On Solaris and Linux I will get: ----- implicit declaration of function `sendfile' ----- if I do not #include (it's not exist on FreeBSD) or ----- too many arguments to function `sendfile' ----- sendfile() is very and very unportable interface. If developer want to use the lowest common things then he should use #defines that emulate Linux's interface - it sends file only. And #define can hide any flags. If developer want to use maximum features that available on the platform then he should use a huge wrapper something like Apache 2.0's one: http://cvs.apache.org/viewcvs.cgi/apr/network_io/unix/sendrecv.c Igor Sysoev http://sysoev.ru/en/