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


Ian Lance Taylor <ian@wasabisystems.com> writes:

> 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?

If you can think of a reliable way to do the error handling while
using vfork, go right ahead.  I've been unable to come up with one.

zw


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