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 "vm/globals.h" | 5 #include "vm/globals.h" |
6 #if defined(TARGET_OS_ANDROID) | 6 #if defined(TARGET_OS_ANDROID) |
7 | 7 |
8 #include "vm/os.h" | 8 #include "vm/os.h" |
9 | 9 |
10 #include <android/log.h> // NOLINT | 10 #include <android/log.h> // NOLINT |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 private: | 182 private: |
183 DISALLOW_COPY_AND_ASSIGN(GdbCodeObserver); | 183 DISALLOW_COPY_AND_ASSIGN(GdbCodeObserver); |
184 }; | 184 }; |
185 | 185 |
186 | 186 |
187 const char* OS::Name() { | 187 const char* OS::Name() { |
188 return "android"; | 188 return "android"; |
189 } | 189 } |
190 | 190 |
191 | 191 |
| 192 intptr_t OS::ProcessId() { |
| 193 return static_cast<intptr_t>(getpid()); |
| 194 } |
| 195 |
| 196 |
192 static bool LocalTime(int64_t seconds_since_epoch, tm* tm_result) { | 197 static bool LocalTime(int64_t seconds_since_epoch, tm* tm_result) { |
193 time_t seconds = static_cast<time_t>(seconds_since_epoch); | 198 time_t seconds = static_cast<time_t>(seconds_since_epoch); |
194 if (seconds != seconds_since_epoch) return false; | 199 if (seconds != seconds_since_epoch) return false; |
195 struct tm* error_code = localtime_r(&seconds, tm_result); | 200 struct tm* error_code = localtime_r(&seconds, tm_result); |
196 return error_code != NULL; | 201 return error_code != NULL; |
197 } | 202 } |
198 | 203 |
199 | 204 |
200 const char* OS::GetTimeZoneName(int64_t seconds_since_epoch) { | 205 const char* OS::GetTimeZoneName(int64_t seconds_since_epoch) { |
201 tm decomposed; | 206 tm decomposed; |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 } | 462 } |
458 | 463 |
459 | 464 |
460 void OS::Exit(int code) { | 465 void OS::Exit(int code) { |
461 exit(code); | 466 exit(code); |
462 } | 467 } |
463 | 468 |
464 } // namespace dart | 469 } // namespace dart |
465 | 470 |
466 #endif // defined(TARGET_OS_ANDROID) | 471 #endif // defined(TARGET_OS_ANDROID) |
OLD | NEW |