summaryrefslogtreecommitdiffstats
path: root/utils/vms-gtod.c
diff options
context:
space:
mode:
authorSimon Rettberg2018-10-16 10:08:48 +0200
committerSimon Rettberg2018-10-16 10:08:48 +0200
commitd3a98cf6cbc3bd0b9efc570f58e8812c03931c18 (patch)
treecbddf8e50f35a9c6e878a5bfe3c6d625d99e12ba /utils/vms-gtod.c
downloadxscreensaver-d3a98cf6cbc3bd0b9efc570f58e8812c03931c18.tar.gz
xscreensaver-d3a98cf6cbc3bd0b9efc570f58e8812c03931c18.tar.xz
xscreensaver-d3a98cf6cbc3bd0b9efc570f58e8812c03931c18.zip
Original 5.40
Diffstat (limited to 'utils/vms-gtod.c')
-rw-r--r--utils/vms-gtod.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/utils/vms-gtod.c b/utils/vms-gtod.c
new file mode 100644
index 0000000..7b1df5a
--- /dev/null
+++ b/utils/vms-gtod.c
@@ -0,0 +1,31 @@
+/*
+ * UNIX-style Time Functions, by pmoreau@cena.dgac.fr <Patrick MOREAU>
+ * (picked up from XVMSUTILS unix emulation routines for VMS by
+ * Trevor Taylor, Patrick Mahans and Martin P.J. Zinser)
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation. No representations are made about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ */
+#include <stdio.h>
+#include <signal.h>
+#include <time.h>
+#include "vms-gtod.h"
+
+/*
+ * gettimeofday(2) - Returns the current time
+ */
+
+int gettimeofday(tv)
+struct timeval *tv;
+{
+ timeb_t tmp_time;
+ ftime(&tmp_time);
+ tv->tv_sec = tmp_time.time;
+ tv->tv_usec = tmp_time.millitm * 1000;
+ return (0);
+}