summaryrefslogtreecommitdiffstats
path: root/mbbsd/osdep.c
diff options
context:
space:
mode:
authorvictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-09-12 11:31:16 +0800
committervictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-09-12 11:31:16 +0800
commit535e458a1b28ecdf69dddcace060807e462980fd (patch)
tree6321dcb267e99a267c85cc113695e27b76cb1f70 /mbbsd/osdep.c
parentfa932118b9ab9bffa96c1e73ab4aa982f60292cb (diff)
downloadpttbbs-535e458a1b28ecdf69dddcace060807e462980fd.tar
pttbbs-535e458a1b28ecdf69dddcace060807e462980fd.tar.gz
pttbbs-535e458a1b28ecdf69dddcace060807e462980fd.tar.bz2
pttbbs-535e458a1b28ecdf69dddcace060807e462980fd.tar.lz
pttbbs-535e458a1b28ecdf69dddcace060807e462980fd.tar.xz
pttbbs-535e458a1b28ecdf69dddcace060807e462980fd.tar.zst
pttbbs-535e458a1b28ecdf69dddcace060807e462980fd.zip
Solaris compatible
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2193 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/osdep.c')
-rw-r--r--mbbsd/osdep.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/mbbsd/osdep.c b/mbbsd/osdep.c
index 1bca7208..598cc5fd 100644
--- a/mbbsd/osdep.c
+++ b/mbbsd/osdep.c
@@ -76,6 +76,36 @@ strlcat(dst, src, siz)
#endif
+#ifdef NEED_TIMEGM
+
+#include <time.h>
+#include <stdlib.h>
+
+time_t timegm (struct tm *tm)
+{
+ time_t ret;
+ char *tz;
+
+ tz = getenv("TZ");
+ putenv("TZ=");
+ tzset();
+ ret = mktime(tm);
+
+ if (tz){
+ char *buff = malloc( strlen(tz) + 10);
+ sprintf( buff, "TZ=%s", tz);
+ putenv(buff);
+ free(buff);
+ }
+ else
+ unsetenv("TZ");
+ tzset();
+
+ return ret;
+}
+
+#endif
+
#ifdef NEED_STRLCPY
/* ------------------------------------------------------------------------ */