On Wed, 28 May 2003, John M Collins wrote:Thanks - FYI the file mod time eventually got updated on HP-UX but not on Solaris (2.9) or Linux (2.4.21) - and it doesn't seem to update it even if you don't close the f.d. I think that has to be wrong if the manual page is anything to go by.
If I invoke mmap to map a file to memory, and it succeeds, can I safely close the original file descriptor and rely on the memory still being mapped and the file still updated (possibly with mysnc)?
Yes, that's definitely a part of the specification of mmap,
even if it's not mentioned on the man page.
Note that the file on disk is likely not to be updated until
some time after you unmap it, unless you use msync to force it.