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

Unified Diff: runtime/bin/file_fuchsia.cc

Issue 2715463003: Add option to gen_snapshot for creating a Makefile describing a snapshot's dependencies. (Closed)
Patch Set: . Created 3 years, 10 months 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
« no previous file with comments | « runtime/bin/file_android.cc ('k') | runtime/bin/file_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/file_fuchsia.cc
diff --git a/runtime/bin/file_fuchsia.cc b/runtime/bin/file_fuchsia.cc
index 7310f43b199856125ea966e623815cef4d074e0b..5ed46d503361fc1b5ace624c8aacea1122f052dc 100644
--- a/runtime/bin/file_fuchsia.cc
+++ b/runtime/bin/file_fuchsia.cc
@@ -100,6 +100,27 @@ int64_t File::Write(const void* buffer, int64_t num_bytes) {
}
+bool File::VPrint(const char* format, va_list args) {
+ // Measure.
+ va_list measure_args;
+ va_copy(measure_args, args);
+ intptr_t len = vsnprintf(NULL, 0, format, measure_args);
+ va_end(measure_args);
+
+ char* buffer = reinterpret_cast<char*>(malloc(len + 1));
+
+ // Print.
+ va_list print_args;
+ va_copy(print_args, args);
+ vsnprintf(buffer, len + 1, format, print_args);
+ va_end(print_args);
+
+ bool result = WriteFully(buffer, len);
+ free(buffer);
+ return result;
+}
+
+
int64_t File::Position() {
ASSERT(handle_->fd() >= 0);
return NO_RETRY_EXPECTED(lseek(handle_->fd(), 0, SEEK_CUR));
« no previous file with comments | « runtime/bin/file_android.cc ('k') | runtime/bin/file_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698