Creating aliases for memory ranges

Maxim Kuvyrkov maxim@kugelworks.com
Sat Jan 26 02:19:00 GMT 2013


On 23/01/2013, at 11:18 PM, Florian Weimer wrote:

> This is probably more of a Linux question, but given that it's about user space and glibc hopefully has the necessary function declarations, I'm asking here.
> 
> Is there a way to create pages which share the underlying content with other pages in the same process?  In essence, I want to character pointers p, q, such that p != q, and writing to *p changes the value of *q.  And in a next step, I'd like that the aliased page is read-only, while the original is not. 8-)
> 
> I think this is easily to achieve if the original pages are mapped from a file on the file system, so the VM hardware has to support it.

mmap (MAP_ANONYMOUS) ?

--
Maxim Kuvyrkov
KugelWorks






More information about the Libc-help mailing list