Re: Fork, exec, and child inheritance oh my
Re: Fork, exec, and child inheritance oh my
- Subject: Re: Fork, exec, and child inheritance oh my
- From: Brian Mastenbrook <email@hidden>
- Date: Sun, 01 Jul 2007 18:19:52 -0500
Dave Keck wrote:
Hello,
I'm attempting to create a program in which a child process will load
certain components into the parent's address space, so that the parent
is able to access the symbols that the child loaded. Like a
plugin-loader, but with one caveat: due to the architecture of our
program, the child must be a separate process.
Right now I've been walking the dark alleys of fork(), execv(), and
mmap(), but I'm not seeing much light. It seems what we need is a
version of execv() that wouldn't completely overwrite the parent
process, so that the parent and child would share the same address
space and both able to access the symbols loaded by the child process.
Is this possible?
I'm not sure I understand how it's possible to have a requirement for a
separate process and yet also have a requirement to share the virtual
memory map of the process like threads do. What is the reason for using
separate processes as opposed to threads?
You can share specific segments of memory using System V shared memory.
See the man page for shmget(2).
--
Brian Mastenbrook
email@hidden
http://brian.mastenbrook.net/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden