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

Side by Side Diff: runtime/bin/platform_linux.cc

Issue 867113003: Revert r43217, r43215, r43208, r43207, and r43202. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/bin/platform_android.cc ('k') | runtime/bin/platform_macos.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "platform/globals.h" 5 #include "platform/globals.h"
6 #if defined(TARGET_OS_LINUX) 6 #if defined(TARGET_OS_LINUX)
7 7
8 #include "bin/platform.h" 8 #include "bin/platform.h"
9 9
10 #include <signal.h> // NOLINT 10 #include <signal.h> // NOLINT
(...skipping 24 matching lines...) Expand all
35 int Platform::NumberOfProcessors() { 35 int Platform::NumberOfProcessors() {
36 return sysconf(_SC_NPROCESSORS_ONLN); 36 return sysconf(_SC_NPROCESSORS_ONLN);
37 } 37 }
38 38
39 39
40 const char* Platform::OperatingSystem() { 40 const char* Platform::OperatingSystem() {
41 return "linux"; 41 return "linux";
42 } 42 }
43 43
44 44
45 const char* Platform::LibraryExtension() {
46 return "so";
47 }
48
49
50 bool Platform::LocalHostname(char *buffer, intptr_t buffer_length) { 45 bool Platform::LocalHostname(char *buffer, intptr_t buffer_length) {
51 return gethostname(buffer, buffer_length) == 0; 46 return gethostname(buffer, buffer_length) == 0;
52 } 47 }
53 48
54 49
55 char** Platform::Environment(intptr_t* count) { 50 char** Platform::Environment(intptr_t* count) {
56 // Using environ directly is only safe as long as we do not 51 // Using environ directly is only safe as long as we do not
57 // provide access to modifying environment variables. 52 // provide access to modifying environment variables.
58 intptr_t i = 0; 53 intptr_t i = 0;
59 char** tmp = environ; 54 char** tmp = environ;
60 while (*(tmp++) != NULL) i++; 55 while (*(tmp++) != NULL) i++;
61 *count = i; 56 *count = i;
62 char** result = new char*[i]; 57 char** result = new char*[i];
63 for (intptr_t current = 0; current < i; current++) { 58 for (intptr_t current = 0; current < i; current++) {
64 result[current] = environ[current]; 59 result[current] = environ[current];
65 } 60 }
66 return result; 61 return result;
67 } 62 }
68 63
69 64
70 void Platform::FreeEnvironment(char** env, intptr_t count) { 65 void Platform::FreeEnvironment(char** env, intptr_t count) {
71 delete[] env; 66 delete[] env;
72 } 67 }
73 68
74 } // namespace bin 69 } // namespace bin
75 } // namespace dart 70 } // namespace dart
76 71
77 #endif // defined(TARGET_OS_LINUX) 72 #endif // defined(TARGET_OS_LINUX)
OLDNEW
« no previous file with comments | « runtime/bin/platform_android.cc ('k') | runtime/bin/platform_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698