summaryrefslogtreecommitdiffstats
path: root/compat/gettod.c
diff options
context:
space:
mode:
authorrjohnson <rjohnson@noemail.net>1998-03-26 14:45:59 (GMT)
committerrjohnson <rjohnson@noemail.net>1998-03-26 14:45:59 (GMT)
commit26a76b6c669bbb7629454ffa56a7f3f501a86dae (patch)
tree6e8c9473978f6dab66c601e911721a7bd9d70b1b /compat/gettod.c
parentf91eedbd6219cd3648cf1085083990df5c0e77dd (diff)
downloadtcl-26a76b6c669bbb7629454ffa56a7f3f501a86dae.zip
tcl-26a76b6c669bbb7629454ffa56a7f3f501a86dae.tar.gz
tcl-26a76b6c669bbb7629454ffa56a7f3f501a86dae.tar.bz2
Initial revision
FossilOrigin-Name: cacdd0f329872d67973970d74c6978730bc24baa
Diffstat (limited to 'compat/gettod.c')
-rw-r--r--compat/gettod.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/compat/gettod.c b/compat/gettod.c
new file mode 100644
index 0000000..4110262
--- /dev/null
+++ b/compat/gettod.c
@@ -0,0 +1,32 @@
+/*
+ * gettod.c --
+ *
+ * This file provides the gettimeofday function on systems
+ * that only have the System V ftime function.
+ *
+ * Copyright (c) 1995 Sun Microsystems, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * SCCS: @(#) gettod.c 1.2 96/02/15 12:08:26
+ */
+
+#include "tcl.h"
+#include "tclPort.h"
+#include <sys/timeb.h>
+
+#undef timezone
+
+int
+gettimeofday(tp, tz)
+struct timeval *tp;
+struct timezone *tz;
+{
+ struct timeb t;
+ ftime(&t);
+ tp->tv_sec = t.time;
+ tp->tv_usec = t. millitm * 1000;
+ return 0;
+}
+