aboutsummaryrefslogtreecommitdiffstats
path: root/extension/time.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2013-12-30 21:52:45 +0200
committerArnold D. Robbins <arnold@skeeve.com>2013-12-30 21:52:45 +0200
commitdad5f25058c4ecf69ebe4543a13281d3f28c69bc (patch)
tree8febb68d715ea8a08ed0da2955b5b780d6613500 /extension/time.c
parentcbd2cf7f926f960fab1b5004e42c35515c1c8d9f (diff)
downloadegawk-dad5f25058c4ecf69ebe4543a13281d3f28c69bc.tar.gz
egawk-dad5f25058c4ecf69ebe4543a13281d3f28c69bc.tar.bz2
egawk-dad5f25058c4ecf69ebe4543a13281d3f28c69bc.zip
Build and test dynamic extensions on VMS. Documented too.
Diffstat (limited to 'extension/time.c')
-rw-r--r--extension/time.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/extension/time.c b/extension/time.c
index 9fadfe54..b1e9a40a 100644
--- a/extension/time.c
+++ b/extension/time.c
@@ -39,6 +39,30 @@
#include <sys/types.h>
#include <sys/stat.h>
+#ifdef __VMS
+#define HAVE_NANOSLEEP
+#define HAVE_GETTIMEOFDAY
+#ifdef gettimeofday
+#undef gettimeofday
+#endif
+#ifdef __ia64__
+/* nanosleep not working on IA64 */
+static int
+vms_fake_nanosleep(const struct timespec *rqdly, struct timespec *rmdly)
+{
+ int result;
+
+ result = sleep(rqdly->tv_sec);
+ if (result == 0) {
+ return 0;
+ } else {
+ return -1;
+ }
+}
+#define nanosleep(x,y) vms_fake_nanosleep(x, y)
+#endif
+#endif
+
#include "gawkapi.h"
#include "gettext.h"