From owner-freebsd-hackers@FreeBSD.ORG Sat Sep 25 14:35:19 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2096416A4CE for ; Sat, 25 Sep 2004 14:35:19 +0000 (GMT) Received: from smtp.des.no (flood.des.no [217.116.83.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7816C43D46 for ; Sat, 25 Sep 2004 14:35:18 +0000 (GMT) (envelope-from des@des.no) Received: by smtp.des.no (Pony Express, from userid 666) id 42255535A; Sat, 25 Sep 2004 16:35:17 +0200 (CEST) Received: from dwp.des.no (des.no [80.203.228.37]) by smtp.des.no (Pony Express) with ESMTP id 3EF94533C; Sat, 25 Sep 2004 16:35:07 +0200 (CEST) Received: by dwp.des.no (Postfix, from userid 2602) id D5F21B85E; Sat, 25 Sep 2004 16:35:06 +0200 (CEST) To: Mike Meyer References: <16722.59709.451226.932084@guru.mired.org> <20040925100740.GA814@empiric.icir.org> <20040925122149.GD814@empiric.icir.org> From: des@des.no (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=) Date: Sat, 25 Sep 2004 16:35:06 +0200 In-Reply-To: <20040925122149.GD814@empiric.icir.org> (Bruce M. Simpson's message of "Sat, 25 Sep 2004 05:21:49 -0700") Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on flood.des.no X-Spam-Level: X-Spam-Status: No, hits=0.0 required=5.0 tests=AWL autolearn=no version=2.63 cc: bzeeb-lists@lists.zabbadoz.net cc: Gordon David cc: freebsd-hackers@freebsd.org Subject: Re: execute a user process in the kernel X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2004 14:35:19 -0000 Bruce M Simpson writes: > On Sat, Sep 25, 2004 at 01:35:07PM +0200, Dag-Erling Sm=F8rgrav wrote: > > > If we were to implement POSIX spawn(), we'd need something like this. > > Uh, no. posix_spawn(3) can be implemented entirely in userland and > > does not require any special kernel support. > Discussions with peter@ and others on IRC have been ongoing regarding doi= ng > it in kernel space, so as to avoid unnecessarily expensive VM fork operat= ions > when 'spawning' a process. > > I'd be interested to hear more about your proposal for doing this in user= land. posix_spawn(3) can be implemented in terms of fork(2) / execve(2), and if you're worried about VM overhead you can always use vfork(2) (which has the additional benefit of allowing you to pass an error code back to the parent process, since the child can write to the parent's address space until it calls execve(2)). DES --=20 Dag-Erling Sm=F8rgrav - des@des.no