Re: dlopen from a child process to access parent process functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ravindra Jejurikar wrote:
> Hello,
>     I would like a child process to have access to the parent process's functions using dlopen(). Is this possible?

Certainly, but you can't do it with system().

system() combines two calls, fork(), and execv().  execv() completely
replaces the child's copy of the parent process image, so after
excecv() it's no longer possible to call functions in that image from
the child.

> Reason to have two binaries: Eventually, I want to call some perl
> code from the C code and the perl code should be able to access some
> C functions. So I am trying with two different C binaries to start
> with.

> Is there an easier way to do what I am trying. I cannot have my perl
> code as the master with the C code as a .so (complex legacy C code -
> in short)

That's what you are going to have to do.  Either that or connect the
two processes with pipes.

Andrew.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux