changeset 38078:504a47bbbe5d

8154996: [aix] Implement compare_file_modified_times for "8146879: Add option ..." Reviewed-by: simonis
author goetz
date Mon, 25 Apr 2016 12:42:29 +0200
parents fbcc41d68cda
children fd24ad51113a
files hotspot/src/os/aix/vm/os_aix.cpp
diffstat 1 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hotspot/src/os/aix/vm/os_aix.cpp	Mon Apr 25 17:24:33 2016 +0200
+++ b/hotspot/src/os/aix/vm/os_aix.cpp	Mon Apr 25 12:42:29 2016 +0200
@@ -4875,3 +4875,16 @@
   }
   return yes;
 }
+
+static inline time_t get_mtime(const char* filename) {
+  struct stat st;
+  int ret = os::stat(filename, &st);
+  assert(ret == 0, "failed to stat() file '%s': %s", filename, strerror(errno));
+  return st.st_mtime;
+}
+
+int os::compare_file_modified_times(const char* file1, const char* file2) {
+  time_t t1 = get_mtime(file1);
+  time_t t2 = get_mtime(file2);
+  return t1 - t2;
+}