8154996: [aix] Implement compare_file_modified_times for "8146879: Add option ..."
Reviewed-by: simonis
--- 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;
+}