Subject: Re: mapping shared memory at a fixed address
To: Bill Studenmund <email@example.com>
From: Rahul Kulkarni <firstname.lastname@example.org>
Date: 02/07/2005 11:43:36
I understand you could do relative pointers..
But I think it still might be possible with some VM
changes(hacks) to reserve a "virtual address region"
in all address spaces, so as to prevent something else
to map at that address in the first place, such that
mmap always maps at the same requested address
--- Bill Studenmund <email@example.com> wrote:
> On Fri, Feb 04, 2005 at 04:05:25PM -0800, Rahul
> Kulkarni wrote:
> > Wondering if anyone can give some pointers on how
> > make mmap map a shared memory segment at a
> > address always, in different address spaces.
> > with a specified address works but is not
> > In other words, how can I "reserve" the same
> > address in different address spaces to map to the
> > segment..
> You can't.
> Why do you need to?
> The problem is that if something else already is
> mapped at the address you
> want, the new mmap won't work. The only way you
> could get around that was
> if you mapped the area and then had the process fork
> into a lot of
> children. However the children could not exec..
> If you want to store (or pass) pointers to things in
> the area, just store
> or pass relative pointers. Pass (intptr_t)ThePointer
> (intptr_t)MapAddress. Then in the recipient just add
> the stored or passed
> integer to the local map address.
> Take care,
> ATTACHMENT part 2 application/pgp-signature
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.