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


On Wed, Mar 17, 2004 at 09:12:23AM -0500, Ian Lance Taylor wrote:
> Gunther Nikl <gni@gecko.de> writes:
> 
> > > Recall that this code is rarely used at present.  We would get a
> > > bigger benefit by converting pex-unix.c to use vfork, since that is
> > > always used.
> > 
> >   This code used to use vfork but that support was dropped because of
> >   race condtions or something like that. My system (m68k-amigaos) doesn't
> >   support fork but has vfork.
> 
> Does your system have popen?  Perhaps your system should just use
> pexrd-generic, which uses popen instead of fork.

  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.

> Alternatively, would you be willing to write a pexrd-amiga to be used
> on your system?  There is actually no need for the programs to run
> concurrently.  Everything will work fine if the program invoked by
> pex_read() writes stdout to a temporary file, and pex_read() simply
> returns the fopen of that temporary file.  A pipe is used on Unix for
> efficiency, not for correctness.

  My port isn't in the repository. If a special pexrd is needed, it
  can be written. However, it would be preferable to use existing
  pieces if possible.

  Gunther


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