From owner-cvs-all@FreeBSD.ORG Tue Jun 17 17:07:27 2008 Return-Path: Delivered-To: cvs-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1FE31065670; Tue, 17 Jun 2008 17:07:27 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 732938FC22; Tue, 17 Jun 2008 17:07:27 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.2/8.14.2) with ESMTP id m5HH7tRD031012; Tue, 17 Jun 2008 13:07:55 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.2/8.14.2/Submit) id m5HH7tC3031011; Tue, 17 Jun 2008 13:07:55 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Date: Tue, 17 Jun 2008 13:07:55 -0400 From: David Schultz To: Maxim Sobolev Message-ID: <20080617170755.GA30958@zim.MIT.EDU> Mail-Followup-To: Maxim Sobolev , Ed Schouten , David Xu , src-committers@FreeBSD.ORG, cvs-src@FreeBSD.ORG, cvs-all@FreeBSD.ORG References: <200806170633.m5H6XMJH084600@repoman.freebsd.org> <20080617134828.GA30076@zim.MIT.EDU> <20080617140600.GE1176@hoeg.nl> <4857D508.8070907@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4857D508.8070907@FreeBSD.org> Cc: Ed Schouten , src-committers@FreeBSD.ORG, David Xu , cvs-all@FreeBSD.ORG, cvs-src@FreeBSD.ORG Subject: Re: cvs commit: src/include Makefile spawn.h unistd.h src/lib/libc/gen Makefile.inc Symbol.map exec.3 exec.c posix_spawn.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jun 2008 17:07:27 -0000 On Tue, Jun 17, 2008, Maxim Sobolev wrote: > Ed Schouten wrote: > >* David Schultz wrote: > >>I have no objections to this, but doesn't it defeat the whole > >>purpose to implement posix_spawn() as a library function that just > >>calls fork/exec? > > > >When (if?) applications start to use posix_spawn() we may decide to move > >it into the kernel at any time. It should be okay for now. > > Are there any benefits of doing it in the kernel vs. doing it via fork+exec? The only reason spawn exists is to better support platforms where fork is slow, so implementing it in terms of fork/exec defeats the purpose and potentially tricks configure scripts into making incorrect assumptions about performance tradeoffs. However, maybe spawn would still be useful if misguided application writers used it for other reasons (e.g., to make it easier to port Win32 apps), and I'm guessing that's why it was added. Implementing it in the kernel has disadvantages, too; in particular, it would add a lot of complexity for gains that are likely to be minimal in FreeBSD.