summaryrefslogtreecommitdiffstats
path: root/mbbsd/time.c
blob: e692f66824de5f823463c0c6c22978db6ee2ac93 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifdef __dietlibc__
#include <time.h>
#warning    "hardcoded time zone as GMT+8!"
extern void __maplocaltime(void);
extern time_t __tzfile_map(time_t t, int *isdst, int forward);
extern time_t timegm(struct tm *const t);

time_t mktime(register struct tm* const t) {
  time_t x=timegm(t);
  int isdst;
  time_t y;
  x-=8*3600;
  return x;
}

struct tm* localtime_r(const time_t* t, struct tm* r) {
  time_t tmp;
  tmp=*t;
  tmp+=8*3600;
  return gmtime_r(&tmp,r);
}
#endif