summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-10-12 14:55:55 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-10-12 14:58:55 +0900
commit6333020fc924d3ae63775c032bbe8f57364cd42e (patch)
treec743d41989e5c92d05ac55921d7d39371665a6ce
parent92df7d98b62f48cf21cdec522f2e7b34380fd718 (diff)
atime may not updated unless strictatime is set on macOS Catalina
Cited from mount(8): ``` strictatime Always update the file access time when reading from a file. Without this option the filesystem may default to a less strict update mode, where some access time updates are skipped for performance reasons. This option could be ignored if it is not supported by the filesystem. ```
-rw-r--r--ext/-test-/file/fs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/-test-/file/fs.c b/ext/-test-/file/fs.c
index c9c3473257..63d2356d76 100644
--- a/ext/-test-/file/fs.c
+++ b/ext/-test-/file/fs.c
@@ -89,6 +89,9 @@ get_noatime_p(VALUE self, VALUE str)
rb_sys_fail_str(str);
}
# ifdef HAVE_STRUCT_STATFS_F_FLAGS
+# ifdef MNT_STRICTATIME
+ if (!(st.f_flags & MNT_STRICTATIME)) return Qtrue;
+# endif
# ifdef MNT_NOATIME
return st.f_flags & MNT_NOATIME ? Qtrue : Qfalse;
# elif defined(ST_NOATIME)