Index: base/platform_file_win.cc |
diff --git a/base/platform_file_win.cc b/base/platform_file_win.cc |
index b88fe9c0cdf1f4fec4ee45df3b06f1076fa215a6..8c98183b568948b6b24f1bf2afa67f4b6dfd8ef1 100644 |
--- a/base/platform_file_win.cc |
+++ b/base/platform_file_win.cc |
@@ -4,6 +4,8 @@ |
#include "base/platform_file.h" |
+#include <io.h> |
+ |
#include "base/files/file_path.h" |
#include "base/logging.h" |
#include "base/threading/thread_restrictions.h" |
@@ -109,6 +111,15 @@ PlatformFile CreatePlatformFileUnsafe(const FilePath& name, |
return file; |
} |
+FILE* FdopenPlatformFile(PlatformFile file, const char* mode) { |
+ if (file == kInvalidPlatformFileValue) |
+ return NULL; |
+ int fd = _open_osfhandle(reinterpret_cast<intptr_t>(file), 0); |
+ if (fd < 0) |
+ return NULL; |
+ return _fdopen(fd, mode); |
+} |
+ |
bool ClosePlatformFile(PlatformFile file) { |
base::ThreadRestrictions::AssertIOAllowed(); |
return (CloseHandle(file) != 0); |