I implemented this. You shared mmap() a specific range on a FD, and then
pass the FD together with a token describing the range over a unix socket.
The receiver then mmap()s the range too. Once the fd is passed you can
mmap() further regions too - just send a small unix message describing the
range, but don't pass a new fd.
Unfortunately it only works with named files, not with anonymous swap
space (just opening /dev/zero does not work, you need a specific
file). Using the new SCM_CREDENTIALS auxilliary message in 2.1 it is
even possible to do (uid, gid) authentification.
I wrote a small library to encapsulate this scheme nicely. It uses
a simply buddy allocator to manage the 'virtual space' in a file. To make
sure that the file is deleted when the process gets killed it is simply
deleted immediately after creation.
It would be nice if it was possible to do the same with anonymous memory,
unfortunately shared anonymous mapping didn't make it into 2.1 - with them
it would be easily possible to create a special device similar to /dev/zero
that supports shared mappings per fd.
-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html