Using vfork() in do_system() instead of fork()

Mike Frysinger vapier@gentoo.org
Tue Jun 23 19:35:00 GMT 2009


On Tuesday 23 June 2009 14:44:24 David Wuertele wrote:
> Mike said:
> > since there's pretty much no chance of do_system() changing, why not use
> > your simple wrapper.  the amount of code needed to do vfork+exec on a
> > string is pretty small.
>
> Oh, the work involved is not the issue.  I just wanted to make sure
> that I wasn't
> doing something that the glibc developers had already decided was a bad
> idea.
>
> But why do you say there's no chance of do_system() changing?  If using
> vfork() actually has no problems, it seems like it would be an advantage to
> all users of system().  Is the fact that the parent doesn't get scheduled
> until after the execl()
> a performance issue?

i can almost guarantee you that drepper would tell you to go away, especially 
because your "problem" only manifests when you've turned off over commit.  
vfork() has ugly semantics whose implications are often not terribly clear 
until it's too late whereas fork() is always straightforward.  in this case, 
vfork() will probably work, but it doesnt really matter because fork() 
shouldnt be broken like Carlos pointed out.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://sourceware.org/pipermail/libc-help/attachments/20090623/a7e7da0b/attachment.sig>


More information about the Libc-help mailing list