title: Get the copy-on-write behaviour of fork()ing, without fork()
body: <p>I have a large buffer:</p>
  
  <pre><code>char *buf = malloc(1000000000); // 1GB
  </code></pre>
  
  <p>If I forked a new process, it would have a buf which shared memory with the parent's buf until one or the other wrote to it.  Even then, only one new 4KiB block would need to be allocated by the kernel, the rest would continue to be shared.</p>
  
  <p>I'd like to make a copy of buf, but I'm only going to change a little of the copy.  I'd like copy-on-write behaviour without forking.  (Like you get for free when forking.)</p>
  
  <p>Is this possible?</p>