home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / EMXLIB8F.ZIP / EMX / LIB / TIME / GETTIMEO.C < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-02  |  563 b   |  26 lines

  1. /* gettimeo.c (emx+gcc) -- Copyright (c) 1993 by Eberhard Mattes */
  2.  
  3. #include <sys/emx.h>
  4. #include <sys/timeb.h>
  5. #include <sys/time.h>
  6. #include <time.h>
  7.  
  8. int gettimeofday (struct timeval *tp, struct timezone *tzp)
  9. {
  10.   struct timeb tb;
  11.  
  12.   if (!_tzset_flag) tzset ();
  13.   __ftime (&tb);
  14.   if (tp != NULL)
  15.     {
  16.       tp->tv_sec = tb.time + timezone;
  17.       tp->tv_usec = tb.millitm * 1000;
  18.     }
  19.   if (tzp != NULL)
  20.     {
  21.       tzp->tz_minuteswest = timezone / 60;
  22.       tzp->tz_dsttime = 0; /* daylight && _dst (&tm); */
  23.     }
  24.   return (0);
  25. }
  26.