Subject: Re: mapping shared memory at a fixed address
To: Rahul Kulkarni <crypto_rahul@yahoo.com>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 02/07/2005 13:39:15
--VkqCAaSJIySsbD6j
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Mon, Feb 07, 2005 at 11:43:36AM -0800, Rahul Kulkarni wrote:
> 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
> successfully? =20
You can't make things so you can be certain it won't happen. You can=20
however take steps to make failure vanishingly unlikely.
The easiest thing to try is to pick an address, like around 2 GB, that=20
won't be used in either process. Or maybe 1.5 GB. Then map there. Also,=20
map early in the process's life and chances are things will work.
Take care,
Bill
--VkqCAaSJIySsbD6j
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)
iD8DBQFCB+ADWz+3JHUci9cRApUYAKCNV6RDj5sE5mc2Jv1YE9DMlKH2ogCdGDgZ
FdV4hd3E6nKr5Cd6fmAI4EI=
=kl3B
-----END PGP SIGNATURE-----
--VkqCAaSJIySsbD6j--