title: mmap protection flag effect to sharing between processes
body: <p>Does protection flag affect the sharing between processes? If I have PROT_READ|PROT_WRITE -protected mmapped memory region, is it still fully shared as long as I haven't written into it?</p>
  
  <pre><code>int prot = PROT_READ|PROT_EXEC;
  image = mmap(NULL, filesize, prot, MAP_PRIVATE, fildes, 0);
  </code></pre>
  
  <p>vs:</p>
  
  <pre><code>int prot = PROT_READ|PROT_WRITE|PROT_EXEC;
  image = mmap(...)
  </code></pre>
  
  <p>I'd want to make small modification to small portion of the memory region after I've mapped it, then re-mprotect it all, because it's simpler than mprotecting small portions when I need to do so.</p>
  
  <p>The question is whether it ends up forcing the whole file copied per process or just the portions I modified per process?</p>