Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  2. #include <libc/stubs.h>
  3. #include <time.h>
  4. #include <sys/timeb.h>
  5.  
  6. int
  7. ftime(struct timeb *tp)
  8. {
  9.   struct timeval tv;
  10.   struct timezone tz;
  11.  
  12.   if (gettimeofday(&tv, &tz) < 0)
  13.     return -1;
  14.  
  15.   tp->time = tv.tv_sec;
  16.   tp->millitm = tv.tv_usec / 1000;
  17.   tp->timezone = tz.tz_minuteswest;
  18.   tp->dstflag = tz.tz_dsttime;
  19.  
  20.   return 0;
  21. }
  22.