| 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_LINUX) | 6 #if defined(TARGET_OS_LINUX) |
| 7 | 7 |
| 8 #include "vm/os.h" | 8 #include "vm/os.h" |
| 9 | 9 |
| 10 #include <errno.h> // NOLINT | 10 #include <errno.h> // NOLINT |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 #elif defined(HOST_ARCH_ARM) | 406 #elif defined(HOST_ARCH_ARM) |
| 407 asm("svc #0x9f0001"); // __ARM_NR_breakpoint | 407 asm("svc #0x9f0001"); // __ARM_NR_breakpoint |
| 408 #elif defined(HOST_ARCH_MIPS) | 408 #elif defined(HOST_ARCH_MIPS) |
| 409 UNIMPLEMENTED(); | 409 UNIMPLEMENTED(); |
| 410 #else | 410 #else |
| 411 #error Unsupported architecture. | 411 #error Unsupported architecture. |
| 412 #endif | 412 #endif |
| 413 } | 413 } |
| 414 | 414 |
| 415 | 415 |
| 416 char* OS::StrNDup(const char* s, intptr_t n) { |
| 417 return strndup(s, n); |
| 418 } |
| 419 |
| 420 |
| 416 void OS::Print(const char* format, ...) { | 421 void OS::Print(const char* format, ...) { |
| 417 va_list args; | 422 va_list args; |
| 418 va_start(args, format); | 423 va_start(args, format); |
| 419 VFPrint(stdout, format, args); | 424 VFPrint(stdout, format, args); |
| 420 va_end(args); | 425 va_end(args); |
| 421 } | 426 } |
| 422 | 427 |
| 423 | 428 |
| 424 void OS::VFPrint(FILE* stream, const char* format, va_list args) { | 429 void OS::VFPrint(FILE* stream, const char* format, va_list args) { |
| 425 vfprintf(stream, format, args); | 430 vfprintf(stream, format, args); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 } | 515 } |
| 511 | 516 |
| 512 | 517 |
| 513 void OS::Exit(int code) { | 518 void OS::Exit(int code) { |
| 514 exit(code); | 519 exit(code); |
| 515 } | 520 } |
| 516 | 521 |
| 517 } // namespace dart | 522 } // namespace dart |
| 518 | 523 |
| 519 #endif // defined(TARGET_OS_LINUX) | 524 #endif // defined(TARGET_OS_LINUX) |
| OLD | NEW |