OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 #ifndef VM_OS_H_ | 5 #ifndef VM_OS_H_ |
6 #define VM_OS_H_ | 6 #define VM_OS_H_ |
7 | 7 |
8 #include "vm/globals.h" | 8 #include "vm/globals.h" |
9 | 9 |
10 // Forward declarations. | 10 // Forward declarations. |
11 struct tm; | 11 struct tm; |
12 | 12 |
13 namespace dart { | 13 namespace dart { |
14 | 14 |
15 // Forward declarations. | 15 // Forward declarations. |
16 class Isolate; | 16 class Isolate; |
17 class Zone; | 17 class Zone; |
18 | 18 |
19 // Interface to the underlying OS platform. | 19 // Interface to the underlying OS platform. |
20 class OS { | 20 class OS { |
21 public: | 21 public: |
22 // Returns the name of the given OS. For example "linux". | 22 // Returns the name of the given OS. For example "linux". |
23 static const char* Name(); | 23 static const char* Name(); |
24 | 24 |
25 // Returns the current process id. | 25 // Returns the current process id. |
26 static intptr_t ProcessId(); | 26 static intptr_t ProcessId(); |
27 | 27 |
28 // Returns the abbreviated time-zone name for the given instant. | 28 // Returns a time-zone name for the given instant. |
29 // For example "CET" or "CEST". | 29 // The name is provided by the underlying platform. |
| 30 // The returned string may be Zone allocated. |
30 static const char* GetTimeZoneName(int64_t seconds_since_epoch); | 31 static const char* GetTimeZoneName(int64_t seconds_since_epoch); |
31 | 32 |
32 // Returns the difference in seconds between local time and UTC for the given | 33 // Returns the difference in seconds between local time and UTC for the given |
33 // instant. | 34 // instant. |
34 // For example 3600 for CET, and 7200 for CEST. | 35 // For example 3600 for CET, and 7200 for CEST. |
35 static int GetTimeZoneOffsetInSeconds(int64_t seconds_since_epoch); | 36 static int GetTimeZoneOffsetInSeconds(int64_t seconds_since_epoch); |
36 | 37 |
37 // Returns the difference in seconds between local time and UTC when no | 38 // Returns the difference in seconds between local time and UTC when no |
38 // daylight saving is active. | 39 // daylight saving is active. |
39 // For example 3600 in CET and CEST. | 40 // For example 3600 in CET and CEST. |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 static void Shutdown(); | 164 static void Shutdown(); |
164 | 165 |
165 static void Abort(); | 166 static void Abort(); |
166 | 167 |
167 static void Exit(int code); | 168 static void Exit(int code); |
168 }; | 169 }; |
169 | 170 |
170 } // namespace dart | 171 } // namespace dart |
171 | 172 |
172 #endif // VM_OS_H_ | 173 #endif // VM_OS_H_ |
OLD | NEW |