Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: third_party/crashpad/crashpad/util/file/file_writer.cc

Issue 2478633002: Update Crashpad to b47bf6c250c6b825dee1c5fbad9152c2c962e828 (Closed)
Patch Set: mac comment 2 Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/crashpad/crashpad/util/file/file_writer.cc
diff --git a/third_party/crashpad/crashpad/util/file/file_writer.cc b/third_party/crashpad/crashpad/util/file/file_writer.cc
index edbdb8d5bd51683ace124556471ff92583c40eeb..94f41f143c0f646945f3a9f8358bc2c510489218 100644
--- a/third_party/crashpad/crashpad/util/file/file_writer.cc
+++ b/third_party/crashpad/crashpad/util/file/file_writer.cc
@@ -73,9 +73,19 @@ bool WeakFileHandleFileWriter::WriteIoVec(std::vector<WritableIoVec>* iovecs) {
iovec* iov = reinterpret_cast<iovec*>(&(*iovecs)[0]);
size_t remaining_iovecs = iovecs->size();
+#if defined(OS_ANDROID)
+ // Android does not expose the IOV_MAX macro, but makes its value available
+ // via sysconf(). See Android 7.0.0 bionic/libc/bionic/sysconf.cpp sysconf().
+ // Bionic defines IOV_MAX at bionic/libc/include/limits.h, but does not ship
+ // this file to the NDK as <limits.h>, substituting
+ // bionic/libc/include/bits/posix_limits.h.
+ const size_t kIovMax = sysconf(_SC_IOV_MAX);
+#else
+ const size_t kIovMax = IOV_MAX;
+#endif
+
while (size > 0) {
- size_t writev_iovec_count =
- std::min(remaining_iovecs, implicit_cast<size_t>(IOV_MAX));
+ size_t writev_iovec_count = std::min(remaining_iovecs, kIovMax);
ssize_t written =
HANDLE_EINTR(writev(file_handle_, iov, writev_iovec_count));
if (written < 0) {
« no previous file with comments | « third_party/crashpad/crashpad/tools/mac/run_with_crashpad.cc ('k') | third_party/crashpad/crashpad/util/misc/clock_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698