summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/dietlibc/libugly/ftime.c
blob: 3aa2d15c373baa31eaa01365c7d23b5ccf516036 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <sys/time.h>
#include <sys/timeb.h>
#include <unistd.h>

int ftime(struct timeb *tp) {
  struct timeval tv;
  struct timezone tz;
  int ret=gettimeofday(&tv,&tz);
  tp->time	= tv.tv_sec;
  tp->millitm	= tv.tv_usec/1000;
  tp->timezone	= tz.tz_minuteswest;
  tp->dstflag	= tz.tz_dsttime;
  return ret;
}