title: Linux error from munmap
body: <p>I have a simple question regarding mmap and munmap in Linux : is it possible that <code>mmap</code> succeeds but munmap fails?</p>
  
  <p>Assuming all the parameters are correctly given, for example, see the following code snippet. In what circumstances <code>munmap failed!</code> will be printed??</p>
  
  <pre><code>char *addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
  
  ... exit if mmap was not successful ...
  ... do some stuff using mmaped area ...
  
  if( munmap(addr, 4096) == -1 ){
      printf("munmap failed!\n");
  }
  </code></pre>