Subject: SYSVSHM attachment addresses
To: None <current-users@NetBSD.ORG>
From: John Birrell <email@example.com>
Date: 05/13/1995 09:28:56
I'm porting some software to NetBSD-current/i386 that has a number of
processes accessing System V shared memory. The software currently works on
OSF/1, HP-UX, SCO and LynxOS. It relies on one process being able to write a
pointer into shared memory that can be read and interpreted by another
process. On each of these operating systems, the shmat() call, when passed a
base address of zero, attaches the shared memory segment at the same virtual
address for each process attaching to shared memory. This doesn't seem to
happen under NetBSD.
If I start a process which creates shared memory and then start the same
program as a second process which attaches to the shared memory created by
the first, the addresses that they attach at differ. 8-(.
Instead of specifying a base address of zero (so that the kernel decides the
address), I've tried specifying a base address, but this seems to be ignored.
The address returned by shmat() is the same as the one returned if I specify a
base address of zero, but then when I write to the memory I get a core dump.
Can anyone suggest how I should go about choosing a common base address that