| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Platform-specific code for Linux goes here. For the POSIX-compatible | 5 // Platform-specific code for Linux goes here. For the POSIX-compatible |
| 6 // parts, the implementation is in platform-posix.cc. | 6 // parts, the implementation is in platform-posix.cc. |
| 7 | 7 |
| 8 #include <pthread.h> | 8 #include <pthread.h> |
| 9 #include <semaphore.h> | 9 #include <semaphore.h> |
| 10 #include <signal.h> | 10 #include <signal.h> |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 102 |
| 103 | 103 |
| 104 const char* OS::LocalTimezone(double time, TimezoneCache* cache) { | 104 const char* OS::LocalTimezone(double time, TimezoneCache* cache) { |
| 105 #if V8_OS_NACL | 105 #if V8_OS_NACL |
| 106 // Missing support for tm_zone field. | 106 // Missing support for tm_zone field. |
| 107 return ""; | 107 return ""; |
| 108 #else | 108 #else |
| 109 if (std::isnan(time)) return ""; | 109 if (std::isnan(time)) return ""; |
| 110 time_t tv = static_cast<time_t>(std::floor(time/msPerSecond)); | 110 time_t tv = static_cast<time_t>(std::floor(time/msPerSecond)); |
| 111 struct tm* t = localtime(&tv); | 111 struct tm* t = localtime(&tv); |
| 112 if (NULL == t) return ""; | 112 if (!t || !t->tm_zone) return ""; |
| 113 return t->tm_zone; | 113 return t->tm_zone; |
| 114 #endif | 114 #endif |
| 115 } | 115 } |
| 116 | 116 |
| 117 | 117 |
| 118 double OS::LocalTimeOffset(TimezoneCache* cache) { | 118 double OS::LocalTimeOffset(TimezoneCache* cache) { |
| 119 #if V8_OS_NACL | 119 #if V8_OS_NACL |
| 120 // Missing support for tm_zone field. | 120 // Missing support for tm_zone field. |
| 121 return 0; | 121 return 0; |
| 122 #else | 122 #else |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 #endif | 437 #endif |
| 438 return munmap(base, size) == 0; | 438 return munmap(base, size) == 0; |
| 439 } | 439 } |
| 440 | 440 |
| 441 | 441 |
| 442 bool VirtualMemory::HasLazyCommits() { | 442 bool VirtualMemory::HasLazyCommits() { |
| 443 return true; | 443 return true; |
| 444 } | 444 } |
| 445 | 445 |
| 446 } } // namespace v8::base | 446 } } // namespace v8::base |
| OLD | NEW |