| OLD | NEW |
| 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(HOST_OS_LINUX) | 6 #if defined(HOST_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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 *count = i; | 107 *count = i; |
| 108 char** result; | 108 char** result; |
| 109 result = reinterpret_cast<char**>(Dart_ScopeAllocate(i * sizeof(*result))); | 109 result = reinterpret_cast<char**>(Dart_ScopeAllocate(i * sizeof(*result))); |
| 110 for (intptr_t current = 0; current < i; current++) { | 110 for (intptr_t current = 0; current < i; current++) { |
| 111 result[current] = environ[current]; | 111 result[current] = environ[current]; |
| 112 } | 112 } |
| 113 return result; | 113 return result; |
| 114 } | 114 } |
| 115 | 115 |
| 116 | 116 |
| 117 const char* Platform::GetExecutableName() { |
| 118 return executable_name_; |
| 119 } |
| 120 |
| 121 |
| 117 const char* Platform::ResolveExecutablePath() { | 122 const char* Platform::ResolveExecutablePath() { |
| 118 return File::LinkTarget("/proc/self/exe"); | 123 return File::LinkTarget("/proc/self/exe"); |
| 119 } | 124 } |
| 120 | 125 |
| 121 | 126 |
| 122 void Platform::Exit(int exit_code) { | 127 void Platform::Exit(int exit_code) { |
| 123 exit(exit_code); | 128 exit(exit_code); |
| 124 } | 129 } |
| 125 | 130 |
| 126 } // namespace bin | 131 } // namespace bin |
| 127 } // namespace dart | 132 } // namespace dart |
| 128 | 133 |
| 129 #endif // defined(HOST_OS_LINUX) | 134 #endif // defined(HOST_OS_LINUX) |
| OLD | NEW |