summaryrefslogtreecommitdiffstats
path: root/src/platform-openbsd.cc
diff options
context:
space:
mode:
authorLeon Clarke <leonclarke@google.com>2010-01-27 15:57:47 +0000
committerLeon Clarke <leonclarke@google.com>2010-01-27 15:57:47 +0000
commit888f6729be6a6f6fbe246cb5a9f122e2dbe455b7 (patch)
tree16f9ce250ef5d36e49a0fb0018e979002ed5b4fb /src/platform-openbsd.cc
parent1471e9f5b6f291eea8447f441527cd2a85074a33 (diff)
downloadandroid_external_v8-888f6729be6a6f6fbe246cb5a9f122e2dbe455b7.tar.gz
android_external_v8-888f6729be6a6f6fbe246cb5a9f122e2dbe455b7.tar.bz2
android_external_v8-888f6729be6a6f6fbe246cb5a9f122e2dbe455b7.zip
Pull from svn bleeding_edge@3716
Diffstat (limited to 'src/platform-openbsd.cc')
-rw-r--r--src/platform-openbsd.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/platform-openbsd.cc b/src/platform-openbsd.cc
index 6d273047..62e60044 100644
--- a/src/platform-openbsd.cc
+++ b/src/platform-openbsd.cc
@@ -94,6 +94,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