mmap(), MAP_SHARED, MAP_ANONYMOUS and sharing memory
- From: Bahadir <Bilgehan.Balban@xxxxxxxxx>
- Date: Sun, 23 Dec 2007 17:43:14 -0800 (PST)
Hi,
I have checked various unix specs and I am puzzled about how to share
memory between two processes using mmap().
AFAIK MAP_ANONYMOUS + MAP_PRIVATE would map /dev/zero (in linux man
pages don't mention /dev/zero) so the process can get some private
zero-initialised free memory, correct?
Then what would MAP_ANONYMOUS + MAP_SHARED do? If Linux specifies no
particular file for MAP_ANONYMOUS where would the shared mapping be
found by another process? Perhaps these two flags don't get used
together?
Thanks,
Bahadir
.
- Follow-Ups:
- Re: mmap(), MAP_SHARED, MAP_ANONYMOUS and sharing memory
- From: Rainer Weikusat
- Re: mmap(), MAP_SHARED, MAP_ANONYMOUS and sharing memory
- Prev by Date: [Commercial] Linux System and Device Driver Programming from Professionals
- Next by Date: Re: check if memory is accessible
- Previous by thread: A practical use for MAP_FIXED
- Next by thread: Re: mmap(), MAP_SHARED, MAP_ANONYMOUS and sharing memory
- Index(es):
Relevant Pages
|