summaryrefslogtreecommitdiffstats
path: root/base/platform_file_posix.cc
diff options
context:
space:
mode:
Diffstat (limited to 'base/platform_file_posix.cc')
-rw-r--r--base/platform_file_posix.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/base/platform_file_posix.cc b/base/platform_file_posix.cc
index 46039b9..bfd40e9 100644
--- a/base/platform_file_posix.cc
+++ b/base/platform_file_posix.cc
@@ -77,4 +77,12 @@ bool ClosePlatformFile(PlatformFile file) {
return close(file);
}
+bool GetPlatformFileSize(PlatformFile file, uint64* out_size) {
+ struct stat st;
+ if (fstat(file, &st))
+ return false;
+ *out_size = st.st_size;
+ return true;
+}
+
} // namespace base