Update V8 to version 4.7.21.
[chromium-blink-merge.git] / base / os_compat_nacl.cc
blob58fe93e0cb15de5216516ada3e7e0fbf0fa84e06
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "base/os_compat_nacl.h"
7 #include <stdlib.h>
8 #include <time.h>
10 #if !defined (__GLIBC__)
12 extern "C" {
13 // Native Client has no timegm().
14 time_t timegm(struct tm* tm) {
15 time_t ret;
16 char* tz;
17 tz = getenv("TZ");
18 setenv("TZ", "", 1);
19 tzset();
20 ret = mktime(tm);
21 if (tz)
22 setenv("TZ", tz, 1);
23 else
24 unsetenv("TZ");
25 tzset();
26 return ret;
28 } // extern "C"
30 #endif // !defined (__GLIBC__)