Index: src/platform-freebsd.cc |
diff --git a/src/platform-freebsd.cc b/src/platform-freebsd.cc |
index 353d165403a9163bf2b2106a1abdb1c0cb855a63..ea872ad4a19389c4a16f78a6055179096f78ab9e 100644 |
--- a/src/platform-freebsd.cc |
+++ b/src/platform-freebsd.cc |
@@ -95,6 +95,24 @@ int OS::ActivationFrameAlignment() { |
} |
+const char* OS::LocalTimezone(double time) { |
+ if (isnan(time)) return ""; |
+ time_t tv = static_cast<time_t>(floor(time/msPerSecond)); |
+ struct tm* t = localtime(&tv); |
+ if (NULL == t) return ""; |
+ return t->tm_zone; |
+} |
+ |
+ |
+double OS::LocalTimeOffset() { |
+ time_t tv = time(NULL); |
+ struct tm* t = localtime(&tv); |
+ // tm_gmtoff includes any daylight savings offset, so subtract it. |
+ return static_cast<double>(t->tm_gmtoff * msPerSecond - |
+ (t->tm_isdst > 0 ? 3600 * msPerSecond : 0)); |
+} |
+ |
+ |
// We keep the lowest and highest addresses mapped as a quick way of |
// determining that pointers are outside the heap (used mostly in assertions |
// and verification). The estimate is conservative, ie, not all addresses in |