Use O_NOATIME to avoid disturbing st_atime when possible. Closes issue #230

This commit is contained in:
Jean-Francois Dockes
2015-03-25 13:49:33 +01:00
parent e0517a7d13
commit 3cceffdb9c
3 changed files with 16 additions and 0 deletions
+6
View File
@@ -103,6 +103,12 @@ bool file_scan(const string &fn, FileScanDo* doer, off_t startoffs,
noclosing = false;
}
#if defined O_NOATIME && O_NOATIME != 0
if (fcntl(fd, F_SETFL, O_NOATIME) < 0) {
// perror("fcntl");
}
#endif
if (cnttoread != (size_t)-1 && cnttoread) {
doer->init(cnttoread+1, reason);
} else if (st.st_size > 0) {