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

Unified Diff: runtime/bin/platform_linux.cc

Issue 10050011: Add member localHostname() to the Dart IO Platform class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Using static bool to control initialization. Created 8 years, 8 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/platform_impl.dart ('k') | runtime/bin/platform_macos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/platform_linux.cc
diff --git a/runtime/bin/platform_linux.cc b/runtime/bin/platform_linux.cc
index 1351c286699e2c4f1e4c7e5276d182bc46ac1e7a..8b114c62cca47ada1769594e92d18803af1b3827 100644
--- a/runtime/bin/platform_linux.cc
+++ b/runtime/bin/platform_linux.cc
@@ -34,6 +34,11 @@ const char* Platform::OperatingSystem() {
}
+bool Platform::LocalHostname(char *buffer, intptr_t buffer_length) {
+ return gethostname(buffer, buffer_length) == 0;
+}
+
+
char* Platform::StrError(int error_code) {
static const int kBufferSize = 1024;
char* error = static_cast<char*>(malloc(kBufferSize));
« no previous file with comments | « runtime/bin/platform_impl.dart ('k') | runtime/bin/platform_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698