I have a set of files whose lengths are all multiples of the page-size of my operating system (FreeBSD 10). I would like to mmap()
these files to consecutive pages of RAM, giving me the ability to treat a collection of files as one large array of data.
Preferably using portable functions, how can I find a sufficiently large region of unmapped address space so I can be sure that a series of mmap()
calls to this region is going to be successful?
mmap()
the first file letting the o/s choose the address for you, and then try to map the other files contiguously with that? I'd expect that to work reasonably well — but I've not tested it on any system, least of all FreeBSD 10. – Danish