Re: Why don't shared anonymous mappings work?

Stephen C. Tweedie
1999-01-19T14:32:54Z

Hi,

On Wed, 13 Jan 1999 14:31:41 -0700 (MST), Colin Plumb <colin@nyx.net>
said:

> Um, I just thought of another problem with shared anonymous pages.
> It's similar to the zero-page issue you raised, but it's no longer
> a single special case.

> Copy-on-write and shared mappings. Let's say that process 1 has a COW
> copy of page X. Then the page is shared (via mmap /proc/1/mem or some
> such) with process 2. Now process A writes to the page.

Invalid argument. This is *precisely* why mmap of /proc/X/mem is
broken. We don't need to implement reasonable semantics for that case,
because there _are_ no reasonable semantics for a page which can be both
MAP_PRIVATE and MAP_SHARED in the same process.

--Stephen