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

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

Issue 584023004: Service isolate rework (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
45 bool Platform::LocalHostname(char *buffer, intptr_t buffer_length) { 50 bool Platform::LocalHostname(char *buffer, intptr_t buffer_length) {
46 return gethostname(buffer, buffer_length) == 0; 51 return gethostname(buffer, buffer_length) == 0;
47 } 52 }
48 53
49 54
50 char** Platform::Environment(intptr_t* count) { 55 char** Platform::Environment(intptr_t* count) {
51 // Using environ directly is only safe as long as we do not 56 // Using environ directly is only safe as long as we do not
52 // provide access to modifying environment variables. 57 // provide access to modifying environment variables.
53 intptr_t i = 0; 58 intptr_t i = 0;
54 char** tmp = environ; 59 char** tmp = environ;
55 while (*(tmp++) != NULL) i++; 60 while (*(tmp++) != NULL) i++;
56 *count = i; 61 *count = i;
57 char** result = new char*[i]; 62 char** result = new char*[i];
58 for (intptr_t current = 0; current < i; current++) { 63 for (intptr_t current = 0; current < i; current++) {
59 result[current] = environ[current]; 64 result[current] = environ[current];
60 } 65 }
61 return result; 66 return result;
62 } 67 }
63 68
64 69
65 void Platform::FreeEnvironment(char** env, intptr_t count) { 70 void Platform::FreeEnvironment(char** env, intptr_t count) {
66 delete[] env; 71 delete[] env;
67 } 72 }
68 73
69 } // namespace bin 74 } // namespace bin
70 } // namespace dart 75 } // namespace dart
71 76
72 #endif // defined(TARGET_OS_LINUX) 77 #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