| 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 Solaris 10 goes here. For the POSIX-compatible | 5 // Platform-specific code for Solaris 10 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 #ifdef __sparc | 8 #ifdef __sparc |
| 9 # error "V8 does not support the SPARC CPU architecture." | 9 # error "V8 does not support the SPARC CPU architecture." |
| 10 #endif | 10 #endif |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 #include "src/base/platform/platform.h" | 31 #include "src/base/platform/platform.h" |
| 32 | 32 |
| 33 | 33 |
| 34 namespace v8 { | 34 namespace v8 { |
| 35 namespace base { | 35 namespace base { |
| 36 | 36 |
| 37 | 37 |
| 38 const char* OS::LocalTimezone(double time, TimezoneCache* cache) { | 38 const char* OS::LocalTimezone(double time, TimezoneCache* cache) { |
| 39 if (std::isnan(time)) return ""; | 39 if (std::isnan(time)) return ""; |
| 40 time_t tv = static_cast<time_t>(std::floor(time/msPerSecond)); | 40 time_t tv = static_cast<time_t>(std::floor(time/msPerSecond)); |
| 41 struct tm* t = localtime(&tv); // NOLINT(runtime/threadsafe_fn) | 41 struct tm tm; |
| 42 struct tm* t = localtime_r(&tv, &tm); |
| 42 if (NULL == t) return ""; | 43 if (NULL == t) return ""; |
| 43 return tzname[0]; // The location of the timezone string on Solaris. | 44 return tzname[0]; // The location of the timezone string on Solaris. |
| 44 } | 45 } |
| 45 | 46 |
| 46 | 47 |
| 47 double OS::LocalTimeOffset(TimezoneCache* cache) { | 48 double OS::LocalTimeOffset(TimezoneCache* cache) { |
| 48 tzset(); | 49 tzset(); |
| 49 return -static_cast<double>(timezone * msPerSecond); | 50 return -static_cast<double>(timezone * msPerSecond); |
| 50 } | 51 } |
| 51 | 52 |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 } | 204 } |
| 204 | 205 |
| 205 | 206 |
| 206 bool VirtualMemory::HasLazyCommits() { | 207 bool VirtualMemory::HasLazyCommits() { |
| 207 // TODO(alph): implement for the platform. | 208 // TODO(alph): implement for the platform. |
| 208 return false; | 209 return false; |
| 209 } | 210 } |
| 210 | 211 |
| 211 } // namespace base | 212 } // namespace base |
| 212 } // namespace v8 | 213 } // namespace v8 |
| OLD | NEW |