title: Why file starting offset in mmap() must be multiple of the page size
body: <p>In mmap() manpage:</p>
  
  <p>Its prototype is:</p>
  
  <pre><code>void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset);
  </code></pre>
  
  <p>and description:</p>
  
  <pre><code>The mmap() function asks to map 'length' bytes starting at offset 'offset' 
  from the file (or other object) specified by the file descriptor fd into 
  memory, preferably at address 'start'.
  </code></pre>
  
  <p>Sepcifically, for the last argument:</p>
  
  <pre><code>'offset' should be a multiple of the page size as returned by getpagesize(2).
  </code></pre>
  
  <p>From what I practised, <code>offset</code> MUST be a multiple of the page size, for example, 4096 on my Linux, otherwise, mmap() would return <code>Invalid argument</code>, <code>offset</code> is for file offset, why it must be multiple of virtual memory system's page size?</p>
  
  <p>Thanks,</p>