Index: runtime/bin/file_macos.cc |
diff --git a/runtime/bin/file_macos.cc b/runtime/bin/file_macos.cc |
index b5a1dd009d628dfc9e4c853c3f886661b9153037..9b0b2ada0db3f5ddd445f0d380fc6acd4951ff96 100644 |
--- a/runtime/bin/file_macos.cc |
+++ b/runtime/bin/file_macos.cc |
@@ -250,6 +250,12 @@ int64_t File::LengthFromPath(const char* name) { |
} |
+static int64_t TimespecToMilliseconds(const struct timespec& t) { |
+ return static_cast<int64_t>(t.tv_sec) * 1000L + |
+ static_cast<int64_t>(t.tv_nsec) / 1000000L; |
+} |
+ |
+ |
void File::Stat(const char* name, int64_t* data) { |
struct stat st; |
if (NO_RETRY_EXPECTED(stat(name, &st)) == 0) { |
@@ -265,6 +271,9 @@ void File::Stat(const char* name, int64_t* data) { |
data[kCreatedTime] = st.st_ctime; |
data[kModifiedTime] = st.st_mtime; |
data[kAccessedTime] = st.st_atime; |
+ data[kCreatedTime] = TimespecToMilliseconds(st.st_ctimespec); |
+ data[kModifiedTime] = TimespecToMilliseconds(st.st_mtimespec); |
+ data[kAccessedTime] = TimespecToMilliseconds(st.st_atimespec); |
data[kMode] = st.st_mode; |
data[kSize] = st.st_size; |
} else { |