This is the mail archive of the gcc@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: Is there any reason to use vfork() ?



> On May 13, 2014, at 3:12 AM, niXman <i.nixman@autistici.org> wrote:
> 
> 
> Hi,
> 
> I use GCC to some restricted environment.

Can you share more information about this env. It might be a bug not in gcc. 

> When I run gcc, it freezes up on this line[1]. When I replace the 'vfork()' on the 'fork()' the compilation succeeds. I haven't found any other adverse events.
> 
> I'm curious whether there is reason to use 'vfork()' rather than 'fork()'?

The difference is that right after vfork, the only thing valid to do is exec. Vfork in some (not most any more) Unix has less overhead than fork has. 

Thanks,
Andrew

> 
> Thanks.
> 
> 
> [1] https://gcc.gnu.org/viewcvs/gcc/trunk/libiberty/pex-unix.c?view=markup#l613
> 
> 
> manpages:
> http://linux.die.net/man/2/fork
> http://linux.die.net/man/3/vfork
> 
> -- 
> Regards, niXman
> ___________________________________________________
> Dual-target(32 & 64-bit) MinGW-W64 compilers for 32 and 64-bit Windows:
> http://sourceforge.net/projects/mingw-w64/
> ___________________________________________________
> Another online IDE: http://liveworkspace.org/


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