mmap-related questions

Kenny Simpson
2003-03-31T14:29:51Z

Greetings! I hate to ask this type of questions here,
but having searched the list and googling, I have
found no good answers, so here goes..

If I use mmap to give me a sliding window view onto a
file (mmap/munmap/mmap or mremap), how can I sync all
unmapped memory associated with the file?

I read from Stevens that "the call to munmap does not
cause the contents of the mapped region to be written
to the disk file.", but I don't want to pay the
penalty of doing many msync()'s each time I move my
window.
I tested that fsync() does not seem to sync pages that
were mapped with mmap. Is there some way to sync all
data associated with the file? Is there a way which
is also portable to Solaris 2.6?

Thanks,
-Kenny

BTW: I'm using 2.4.7 (RH enterprise)

__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!