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: libiberty/pex-unix vfork abuse?


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


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