Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Setting mtime doesn't work after copying a file with mmap



Hello,

when I copy a file with mmap:

- open both files
- mmap both files
- copy with memcpy
- setting mtime with futimes
- close both files

the time is set correctly and stays correctly for several seconds. But when I do a sync(1) the time is updated to the current time! Also when I first close the files and then use utimensat or utime the time is set correctly but changes again after a sync(1). If I don't use sync(1) the time is updated automatically within a minute.

When I copy the files with read(2)/write(2) instead of mmap this bug does *not* occur. Also when I mount the NetBSD file system to Linux via fuse/sshfs and then use mmap on Linux it works correctly.

I think the a mmap-mapping is written back with some delay and this delayed write back updates mtime.

Carsten


Home | Main Index | Thread Index | Old Index