| 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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 } else { | 261 } else { |
| 262 DebugInfo::RegisterSection(name, base, size); | 262 DebugInfo::RegisterSection(name, base, size); |
| 263 } | 263 } |
| 264 } | 264 } |
| 265 | 265 |
| 266 private: | 266 private: |
| 267 DISALLOW_COPY_AND_ASSIGN(GdbCodeObserver); | 267 DISALLOW_COPY_AND_ASSIGN(GdbCodeObserver); |
| 268 }; | 268 }; |
| 269 | 269 |
| 270 | 270 |
| 271 const char* OS::Name() { |
| 272 return "linux"; |
| 273 } |
| 274 |
| 275 |
| 271 static bool LocalTime(int64_t seconds_since_epoch, tm* tm_result) { | 276 static bool LocalTime(int64_t seconds_since_epoch, tm* tm_result) { |
| 272 time_t seconds = static_cast<time_t>(seconds_since_epoch); | 277 time_t seconds = static_cast<time_t>(seconds_since_epoch); |
| 273 if (seconds != seconds_since_epoch) return false; | 278 if (seconds != seconds_since_epoch) return false; |
| 274 struct tm* error_code = localtime_r(&seconds, tm_result); | 279 struct tm* error_code = localtime_r(&seconds, tm_result); |
| 275 return error_code != NULL; | 280 return error_code != NULL; |
| 276 } | 281 } |
| 277 | 282 |
| 278 | 283 |
| 279 const char* OS::GetTimeZoneName(int64_t seconds_since_epoch) { | 284 const char* OS::GetTimeZoneName(int64_t seconds_since_epoch) { |
| 280 tm decomposed; | 285 tm decomposed; |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 } | 520 } |
| 516 | 521 |
| 517 | 522 |
| 518 void OS::Exit(int code) { | 523 void OS::Exit(int code) { |
| 519 exit(code); | 524 exit(code); |
| 520 } | 525 } |
| 521 | 526 |
| 522 } // namespace dart | 527 } // namespace dart |
| 523 | 528 |
| 524 #endif // defined(TARGET_OS_LINUX) | 529 #endif // defined(TARGET_OS_LINUX) |
| OLD | NEW |