ref: 63759d2efb4be65b28d76db0d05b132c505886aa
parent: 333812ca3807f17b0e389531003fa727dfff44d4
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Mon Aug 3 22:01:41 EDT 2015
ape: implement altzone for tzset()
--- a/sys/include/ape/time.h
+++ b/sys/include/ape/time.h
@@ -67,6 +67,7 @@
#ifdef _POSIX_SOURCE
extern char *tzname[2];
extern long timezone;
+extern long altzone;
extern int daylight;
#endif
--- a/sys/src/ape/lib/ap/posix/tzset.c
+++ b/sys/src/ape/lib/ap/posix/tzset.c
@@ -12,6 +12,7 @@
std, dst
};
long timezone;
+long altzone;
int daylight;
void
@@ -38,6 +39,7 @@
*p = 0;
strncpy(dst, q, sizeof dst);
q = p + 1;
+ altzone = - atoi(q);
daylight = 1;
free(env);
return;
@@ -46,6 +48,7 @@
strcpy(std, "GMT0");
dst[0] = '\0';
timezone = 0;
+ altzone = 0;
daylight = 0;
if(env != 0)
free(env);
@@ -54,6 +57,7 @@
nodst:
dst[0] = '\0';
daylight = 0;
+ altzone = timezone;
free(env);
return;
}