How to share memory created by mmap

27/07/2009 - 00:33 von rbfish | Report spam
Hello there,

How can I share a shared memory, created with mmap(MAP_ANON|
MAP_SHARED), between unrelated processes?

For example, one progress creates a shared memory with mmap(MAP_ANON|
MAP_SHARED). How can I tell the other processes the shared memory? And
then the other processes can access the same shared memory.

Thanks in advance.
 

Lesen sie die antworten

#1 Rainer Weikusat
27/07/2009 - 12:49 | Warnen spam
rbfish writes:
How can I share a shared memory, created with mmap(MAP_ANON|
MAP_SHARED), between unrelated processes?



Not at all. There is (meanwhile) a UNIX(*)-interface for this, namely,
shm_open. Otherwise, the other processes either need to inherit the
mapping via fork(2) or a named file must be used instead (which other
processes can open and also mmap).

Ähnliche fragen