Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Sep 2004 16:35:06 +0200
From:      des@des.no (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=)
To:        Mike Meyer <mwm@mired.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: execute a user process in the kernel
Message-ID:  <xzpekkqto11.fsf@dwp.des.no>
In-Reply-To: <20040925122149.GD814@empiric.icir.org> (Bruce M. Simpson's message of "Sat, 25 Sep 2004 05:21:49 -0700")
References:  <BAY1-F10eZZfm95LyRk00055aa3@hotmail.com> <16722.59709.451226.932084@guru.mired.org> <xzpekkrwsca.fsf@dwp.des.no> <20040925100740.GA814@empiric.icir.org> <xzpisa2twd0.fsf@dwp.des.no> <20040925122149.GD814@empiric.icir.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Bruce M Simpson <bms@spc.org> 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



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