home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 110 / EnigmaAmiga110CD.iso / indispensabili / utility / apdf / xpdf-0.80 / goo / vms_unix_times.c < prev    next >
C/C++ Source or Header  |  1998-11-27  |  744b  |  43 lines

  1. /*
  2.  *    UNIX-style Time Functions
  3.  *
  4.  */
  5. #include <stdio.h>
  6. #include <signal.h>
  7. #include <time.h>
  8. #include "vms_unix_time.h"
  9.  
  10. /*
  11.  *    gettimeofday(2) - Returns the current time
  12.  *
  13.  *    NOTE: The timezone portion is useless on VMS.
  14.  *    Even on UNIX, it is only provided for backwards
  15.  *    compatibilty and is not guaranteed to be correct.
  16.  */
  17.  
  18. #if (__VMS_VER < 70000000)
  19. int gettimeofday(tv, tz)
  20. struct timeval  *tv;
  21. struct timezone *tz;
  22. {
  23.     timeb_t tmp_time;
  24.  
  25.     ftime(&tmp_time);
  26.  
  27.     if (tv != NULL)
  28.     {
  29.     tv->tv_sec  = tmp_time.time;
  30.     tv->tv_usec = tmp_time.millitm * 1000;
  31.     }
  32.  
  33.     if (tz != NULL)
  34.     {
  35.     tz->tz_minuteswest = tmp_time.timezone;
  36.     tz->tz_dsttime = tmp_time.dstflag;
  37.     }
  38.  
  39.     return (0);
  40.  
  41. } /*** End gettimeofday() ***/
  42. #endif
  43.