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> | 19 #include <sys/sysctl.h> |
20 #endif | 20 #endif |
21 | 21 |
22 #include "platform/utils.h" | 22 #include "platform/utils.h" |
23 #include "vm/isolate.h" | 23 #include "vm/isolate.h" |
24 #include "vm/zone.h" | 24 #include "vm/zone.h" |
25 | 25 |
26 namespace dart { | 26 namespace dart { |
27 | 27 |
28 const char* OS::Name() { | 28 const char* OS::Name() { |
| 29 #if TARGET_OS_IOS |
| 30 return "ios"; |
| 31 #else |
29 return "macos"; | 32 return "macos"; |
| 33 #endif |
30 } | 34 } |
31 | 35 |
32 | 36 |
33 intptr_t OS::ProcessId() { | 37 intptr_t OS::ProcessId() { |
34 return static_cast<intptr_t>(getpid()); | 38 return static_cast<intptr_t>(getpid()); |
35 } | 39 } |
36 | 40 |
37 | 41 |
38 static bool LocalTime(int64_t seconds_since_epoch, tm* tm_result) { | 42 static bool LocalTime(int64_t seconds_since_epoch, tm* tm_result) { |
39 time_t seconds = static_cast<time_t>(seconds_since_epoch); | 43 time_t seconds = static_cast<time_t>(seconds_since_epoch); |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 } | 352 } |
349 | 353 |
350 | 354 |
351 void OS::Exit(int code) { | 355 void OS::Exit(int code) { |
352 exit(code); | 356 exit(code); |
353 } | 357 } |
354 | 358 |
355 } // namespace dart | 359 } // namespace dart |
356 | 360 |
357 #endif // defined(TARGET_OS_MACOS) | 361 #endif // defined(TARGET_OS_MACOS) |
OLD | NEW |