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

Side by Side Diff: runtime/vm/os_linux.cc

Issue 13994008: - Add OS::StrNDup instead of redefining it when needed. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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/vm/os_android.cc ('k') | runtime/vm/os_macos.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 "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
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
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)
OLDNEW
« no previous file with comments | « runtime/vm/os_android.cc ('k') | runtime/vm/os_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698