I have several files that I want to map into a virtual address space consecutively with mmap(). Each file length is a multiple of the page size.

For the first file, I call mmap() with the addr parameter set to nullptr. On the next call, I set the addr parameter to the address after the end of the region that the first file was mapped to.

In some cases, I am unable to map all files because mmap() ignores the addr hint. Is there a way I can pre-allocate the entire region up front and then map the files into the region one at a time?