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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 // TODO(5411554): For now just use usleep we may have to revisit this. | 311 // TODO(5411554): For now just use usleep we may have to revisit this. |
312 usleep(millis * 1000); | 312 usleep(millis * 1000); |
313 } | 313 } |
314 | 314 |
315 | 315 |
316 void OS::DebugBreak() { | 316 void OS::DebugBreak() { |
317 UNIMPLEMENTED(); | 317 UNIMPLEMENTED(); |
318 } | 318 } |
319 | 319 |
320 | 320 |
| 321 char* OS::StrNDup(const char* s, intptr_t n) { |
| 322 return strndup(s, n); |
| 323 } |
| 324 |
| 325 |
321 void OS::Print(const char* format, ...) { | 326 void OS::Print(const char* format, ...) { |
322 va_list args; | 327 va_list args; |
323 va_start(args, format); | 328 va_start(args, format); |
324 VFPrint(stdout, format, args); | 329 VFPrint(stdout, format, args); |
325 // Forward to the Android log for remote access. | 330 // Forward to the Android log for remote access. |
326 __android_log_vprint(ANDROID_LOG_INFO, "DartVM", format, args); | 331 __android_log_vprint(ANDROID_LOG_INFO, "DartVM", format, args); |
327 va_end(args); | 332 va_end(args); |
328 } | 333 } |
329 | 334 |
330 | 335 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 } | 421 } |
417 | 422 |
418 | 423 |
419 void OS::Exit(int code) { | 424 void OS::Exit(int code) { |
420 exit(code); | 425 exit(code); |
421 } | 426 } |
422 | 427 |
423 } // namespace dart | 428 } // namespace dart |
424 | 429 |
425 #endif // defined(TARGET_OS_ANDROID) | 430 #endif // defined(TARGET_OS_ANDROID) |
OLD | NEW |