open(), mmap(), sendfile() vs. the file's access time

Mikhail Teterin Mikhail.Teterin at murex.com
Wed Nov 17 11:07:24 PST 2004


Hello!

It appears, only read() modifies a file's atime. Otherwise, a file can be 
open()-ed and subsequently _accessed_ through mmap or sendfile()-ed away 
without atime being changed. Does not seem right...

Should open() update atime? My first reaction would be yes, but  on Linux and 
Solaris the behaviour is the same (try attached program).

Should sendfile()? What about mmap() -- there are some hairy usages?..

All I'm trying to do is track the last time a file was downloaded from the 
web-server. But Apache uses sendfile() (zero copy and what not) and thus no 
luck :-(

Thanks! Yours,

	-mi


More information about the freebsd-current mailing list