Shared memory and IPC

Peter Samuelson peter at
Fri Sep 7 03:13:02 GMT 2001

[Wez Furlong]
> So there is no nice-n-easy syscall then?  Even a non-portable call
> would be better than parsing /proc/self/maps.

Don't look at me, I'm no IPC expert!  (So, that out of the way...)

I am not sure what you are wanting beyond mmap(MAP_FIXED).  That is
indeed a nice-n-easy syscall -- it will either succeed or fail.  If it
succeeds in one process but fails in another, just munmap() it again.

The real question is, what *do* you do on failure?  One possible
protocol: the "master" process does mmap() without MAP_FIXED, reports
the address to the others via some sort of existing IPC, the rest try
with MAP_FIXED, report back success or failure.  If anyone fails, they
all unmap *except* the master, which repeats the process with another
mmap() [again without FIXED] ... for a specified number of tries.  Upon
success, or upon giving up, the master munmaps all failed segments, if


More information about the samba-technical mailing list