Subject: Re: mapping shared memory at a fixed address
To: Rahul Kulkarni <>
From: Bill Studenmund <>
List: netbsd-users
Date: 02/07/2005 13:39:15
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,


Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.2.3 (NetBSD)