diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-05-09 18:51:11 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-05-09 18:51:11 -0700 |
commit | ac8967f99c74b6725e5e39a9010d8a3b0ee8d1cb (patch) | |
tree | fe4f5c2b461a4a893af206230dcbacbd4143ddc7 | |
parent | d94c0c75ee37919300dfd5d56335aca55c4b14a6 (diff) | |
download | pcu-ac8967f99c74b6725e5e39a9010d8a3b0ee8d1cb.tar.gz |
Always open files with O_NOATIME
Avoid generating unnecessary disk activity.
-rw-r--r-- | fadvise.c | 2 | ||||
-rw-r--r-- | mincore.c | 2 |
2 files changed, 2 insertions, 2 deletions
@@ -16,7 +16,7 @@ static void apply_fadvise(const char *path, off_t offset, off_t len, int advice) { int fd; - if ((fd = open(path, O_RDONLY)) < 0) { + if ((fd = open(path, O_RDONLY|O_NOATIME)) < 0) { fprintf(stderr, "%s: open(): %s\n", path, strerror(errno)); return; } @@ -10,7 +10,7 @@ static void mincore_stats(const char *path) int fd; size_t i; - if ((fd = open(path, O_RDONLY)) < 0) { + if ((fd = open(path, O_RDONLY|O_NOATIME)) < 0) { fprintf(stderr, "%s: open(): %s\n", path, strerror(errno)); return; } |