This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH RFC: Remove fork from collect2


Zack Weinberg <zack@codesourcery.com> writes:

> Gunther Nikl <gni@gecko.de> writes:
> 
> >   Yes, popen() is supported. It uses vfork+execl itself.
> >   I just noticed that FreeBSDs popen() does uses vfork(). Thus it seems
> >   possible to use it. I don't remember why vfork was dropped in pexecute
> >   by Zack Weinberg.
> 
> It's not safe.  The pexecute child code does stuff you can't do after
> vfork.

Only in the error case, though, in which execv fails.  That case more
or less never happens.

How would you feel if we switched back to vfork, and changed the error
handling?

I ask because the timings I've seen floating around indicate that
vfork is still faster than fork, despite all the fork tuning that has
been done the years.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]