Hello,

Is there a portable way (Linux/Windows, ACE/Boost/APR) that enables a
process the increase the size of a file maped into memory?

We are designing a system that will have many files, possibly tiny and
possibly large. The files contain binary data and the programs are expected
to read/uncompress/add-data/compress/write the files. The programs have to
run on Windows and Linux.

I suggested using ACE or Apache Portable Runtime in order to achieve
portable implementations of mmap() but so far I couldn't find a way to
increase the size of a file once it's mapped into memory, short of using
ftruncate(2), unmapping it and remapping it (or maybe use mremap on
linux-specific code).

Linux's mmap manual page mentions that other systems support MAP_AUTOGROW
flag but not that Linux does.

Googl'ing so far haven't come up with anything except "it's not supported".

Does anyone know anything about this? Portable solutions are more
interesting but Linux-specific ones would also be welcome to hear about.

Thanks,

--Amos

Reply via email to