summaryrefslogtreecommitdiffstats
path: root/base/file_util.h
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-23 12:38:08 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-23 12:38:08 +0000
commit4530149ff00f8970e3b06f6580c109ee74753694 (patch)
tree7541528bc1add772963ad8b889f9dd7dd6eb2b71 /base/file_util.h
parentb2edf0a95849836ab55c65a3fe0ed89a0e4616ea (diff)
downloadchromium_src-4530149ff00f8970e3b06f6580c109ee74753694.zip
chromium_src-4530149ff00f8970e3b06f6580c109ee74753694.tar.gz
chromium_src-4530149ff00f8970e3b06f6580c109ee74753694.tar.bz2
Protect RandUint64 against EINTR.
Review URL: http://codereview.chromium.org/77022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14297 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util.h')
-rw-r--r--base/file_util.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/base/file_util.h b/base/file_util.h
index 6728a0d..102dd4b 100644
--- a/base/file_util.h
+++ b/base/file_util.h
@@ -222,6 +222,13 @@ bool ReadFileToString(const FilePath& path, std::string* contents);
// Deprecated version.
bool ReadFileToString(const std::wstring& path, std::string* contents);
+#if defined(OS_POSIX)
+// Read exactly |bytes| bytes from file descriptor |fd|, storing the result
+// in |buffer|. This function is protected against EINTR and partial reads.
+// Returns true iff |bytes| bytes have been successfuly read from |fd|.
+bool ReadFromFD(int fd, char* buffer, size_t bytes);
+#endif // defined(OS_POSIX)
+
#if defined(OS_WIN)
// Resolve Windows shortcut (.LNK file)
// Argument path specifies a valid LNK file. On success, return true and put