Advice wanted on Shared Memory

MPACE at ESOC.BITNET MPACE at ESOC.BITNET
Fri Jan 18 10:05:50 AEST 1991


I am trying to implement shared memory on a Sun 3 workstation, using the
shmget() and shmat() system calls to get a shared memory segment and
attach a process' address space to it.

The shmat() system calls, according to the manual, allows a process to map
the shared memory segment to its virtual address space

1) either at an address selected by the system
2) or at an address selected by the process itself.

What I need is to map to an address I select (item 2) which is, in fact,
the address of a static program variable or of a private memory segment
dynamically allocated with malloc().

THIS DOES NOT WORK !! I always get an EINVAL error (illegal address).

Does anyone know if it is possible to map a shared segment to a process'
address space already allocated for a static variable or dynamically
allocated ???  I am almost getting crazy about it !!!!

Marco Pace
MPACE at ESOC.BITNET



More information about the Comp.sys.sun mailing list