По крайней мере базовая операционная система поддерживает желаемое поведение:
MAP_PRIVATE
Create a private copy-on-write mapping. Updates
to the mapping are not visible to other processes
mapping the same file, and are not carried through
to the underlying file. It is unspecified whether
changes made to the file after the mmap() call are
visible in the mapped region.
Появляется флаг priv
, переводящий в MAP_PRIVATE
:
void* data =
::BOOST_IOSTREAMS_FD_MMAP(
const_cast<char*>(p.hint),
size_,
readonly ? PROT_READ : (PROT_READ | PROT_WRITE),
priv ? MAP_PRIVATE : MAP_SHARED,
handle_,
p.offset );
if (data == MAP_FAILED)
cleanup_and_throw("failed mapping file");