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

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

Issue 889443002: Service isolate rework take 2 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/bin/platform_linux.cc ('k') | runtime/bin/platform_win.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_MACOS) 6 #if defined(TARGET_OS_MACOS)
7 7
8 #include "bin/platform.h" 8 #include "bin/platform.h"
9 9
10 #include <crt_externs.h> // NOLINT 10 #include <crt_externs.h> // NOLINT
(...skipping 25 matching lines...) Expand all
36 int Platform::NumberOfProcessors() { 36 int Platform::NumberOfProcessors() {
37 return sysconf(_SC_NPROCESSORS_ONLN); 37 return sysconf(_SC_NPROCESSORS_ONLN);
38 } 38 }
39 39
40 40
41 const char* Platform::OperatingSystem() { 41 const char* Platform::OperatingSystem() {
42 return "macos"; 42 return "macos";
43 } 43 }
44 44
45 45
46 const char* Platform::LibraryExtension() {
47 return "dylib";
48 }
49
50
46 bool Platform::LocalHostname(char *buffer, intptr_t buffer_length) { 51 bool Platform::LocalHostname(char *buffer, intptr_t buffer_length) {
47 return gethostname(buffer, buffer_length) == 0; 52 return gethostname(buffer, buffer_length) == 0;
48 } 53 }
49 54
50 55
51 char** Platform::Environment(intptr_t* count) { 56 char** Platform::Environment(intptr_t* count) {
52 // Using environ directly is only safe as long as we do not 57 // Using environ directly is only safe as long as we do not
53 // provide access to modifying environment variables. 58 // provide access to modifying environment variables.
54 // On MacOS you have to do a bit of magic to get to the 59 // On MacOS you have to do a bit of magic to get to the
55 // environment strings. 60 // environment strings.
(...skipping 11 matching lines...) Expand all
67 72
68 73
69 void Platform::FreeEnvironment(char** env, intptr_t count) { 74 void Platform::FreeEnvironment(char** env, intptr_t count) {
70 delete[] env; 75 delete[] env;
71 } 76 }
72 77
73 } // namespace bin 78 } // namespace bin
74 } // namespace dart 79 } // namespace dart
75 80
76 #endif // defined(TARGET_OS_MACOS) 81 #endif // defined(TARGET_OS_MACOS)
OLDNEW
« no previous file with comments | « runtime/bin/platform_linux.cc ('k') | runtime/bin/platform_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698