| 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_MACOS) | 6 #if defined(TARGET_OS_MACOS) |
| 7 | 7 |
| 8 #include "vm/os.h" | 8 #include "vm/os.h" |
| 9 | 9 |
| 10 #include <errno.h> // NOLINT | 10 #include <errno.h> // NOLINT |
| 11 #include <limits.h> // NOLINT | 11 #include <limits.h> // NOLINT |
| 12 #include <mach/mach.h> // NOLINT | 12 #include <mach/mach.h> // NOLINT |
| 13 #include <mach/clock.h> // NOLINT | 13 #include <mach/clock.h> // NOLINT |
| 14 #include <mach/mach_time.h> // NOLINT | 14 #include <mach/mach_time.h> // NOLINT |
| 15 #include <sys/time.h> // NOLINT | 15 #include <sys/time.h> // NOLINT |
| 16 #include <sys/resource.h> // NOLINT | 16 #include <sys/resource.h> // NOLINT |
| 17 #include <unistd.h> // NOLINT | 17 #include <unistd.h> // NOLINT |
| 18 #if TARGET_OS_IOS | 18 #if TARGET_OS_IOS |
| 19 #include <sys/sysctl.h> // NOLINT | 19 #include <sys/sysctl.h> // NOLINT |
| 20 #include <syslog.h> // NOLINT | 20 #include <syslog.h> // NOLINT |
| 21 #endif | 21 #endif |
| 22 | 22 |
| 23 #include "platform/utils.h" | 23 #include "platform/utils.h" |
| 24 #include "vm/isolate.h" | 24 #include "vm/isolate.h" |
| 25 #include "vm/zone.h" | 25 #include "vm/zone.h" |
| 26 | 26 |
| 27 namespace dart { | 27 namespace dart { |
| 28 | 28 |
| 29 const char* OS::Name() { | 29 const char* OS::Name() { |
| 30 #if TARGET_OS_IOS |
| 31 return "ios"; |
| 32 #else |
| 30 return "macos"; | 33 return "macos"; |
| 34 #endif |
| 31 } | 35 } |
| 32 | 36 |
| 33 | 37 |
| 34 intptr_t OS::ProcessId() { | 38 intptr_t OS::ProcessId() { |
| 35 return static_cast<intptr_t>(getpid()); | 39 return static_cast<intptr_t>(getpid()); |
| 36 } | 40 } |
| 37 | 41 |
| 38 | 42 |
| 39 static bool LocalTime(int64_t seconds_since_epoch, tm* tm_result) { | 43 static bool LocalTime(int64_t seconds_since_epoch, tm* tm_result) { |
| 40 time_t seconds = static_cast<time_t>(seconds_since_epoch); | 44 time_t seconds = static_cast<time_t>(seconds_since_epoch); |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 } | 373 } |
| 370 | 374 |
| 371 | 375 |
| 372 void OS::Exit(int code) { | 376 void OS::Exit(int code) { |
| 373 exit(code); | 377 exit(code); |
| 374 } | 378 } |
| 375 | 379 |
| 376 } // namespace dart | 380 } // namespace dart |
| 377 | 381 |
| 378 #endif // defined(TARGET_OS_MACOS) | 382 #endif // defined(TARGET_OS_MACOS) |
| OLD | NEW |