libiberty/pex-unix vfork abuse?
J.C. Pizarro
jcpiza@gmail.com
Fri Dec 7 17:24:00 GMT 2007
On 2007/12/07, "Dave Korn" <dave.korn@artimi.com> wrote:
> > On the other hand, the setting of environ is very dubious and is
> > likely to break on real systems. The code should be changed to call
> > execve instead. Unfortunately there is no standard execvpe function.
> > Fortunately gcc never uses the variant which sets environ. Offhand
> > I'm not sure what does.
>
> Perhaps we could work around this case by setting environ in the parent
> before the vfork call and restoring it afterward, but we'd need kind of
> serialisation there, and I don't know how to do a critical section using
> pthreads/posix.
You can do a critical section mainly between processes using system calls of
IPC synchronization like filelocks, RPCs, shared memory with mmap and
mutexes/semaphores, messages passing through pipes as tunnels, MPI, etc.
Now well, a critical section between multithreaded processes are complicated.
J.C.Pizarro
More information about the Gcc
mailing list