summaryrefslogtreecommitdiff
path: root/Build/source/libs/xpdf/xpdf-3.02/goo/vms_unix_times.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/xpdf/xpdf-3.02/goo/vms_unix_times.c')
-rw-r--r--Build/source/libs/xpdf/xpdf-3.02/goo/vms_unix_times.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/Build/source/libs/xpdf/xpdf-3.02/goo/vms_unix_times.c b/Build/source/libs/xpdf/xpdf-3.02/goo/vms_unix_times.c
new file mode 100644
index 00000000000..004c0d04b29
--- /dev/null
+++ b/Build/source/libs/xpdf/xpdf-3.02/goo/vms_unix_times.c
@@ -0,0 +1,42 @@
+/*
+ * UNIX-style Time Functions
+ *
+ */
+#include <stdio.h>
+#include <signal.h>
+#include <time.h>
+#include "vms_unix_time.h"
+
+/*
+ * gettimeofday(2) - Returns the current time
+ *
+ * NOTE: The timezone portion is useless on VMS.
+ * Even on UNIX, it is only provided for backwards
+ * compatibilty and is not guaranteed to be correct.
+ */
+
+#if (__VMS_VER < 70000000)
+int gettimeofday(tv, tz)
+struct timeval *tv;
+struct timezone *tz;
+{
+ timeb_t tmp_time;
+
+ ftime(&tmp_time);
+
+ if (tv != NULL)
+ {
+ tv->tv_sec = tmp_time.time;
+ tv->tv_usec = tmp_time.millitm * 1000;
+ }
+
+ if (tz != NULL)
+ {
+ tz->tz_minuteswest = tmp_time.timezone;
+ tz->tz_dsttime = tmp_time.dstflag;
+ }
+
+ return (0);
+
+} /*** End gettimeofday() ***/
+#endif