summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Kohl <jtkohl@mit.edu>1990-01-18 11:10:49 +0000
committerJohn Kohl <jtkohl@mit.edu>1990-01-18 11:10:49 +0000
commitf946dd89f0e61d61bf8df893cea8711ac81f5519 (patch)
tree987f0a67e1f2e32cee6bea3cfe4bf8086ef5e418 /src
parent02b30e15d9910ccdc187891de38c4433cee2ad7c (diff)
*** empty log message ***
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@113 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r--src/lib/krb5/os/ustime.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/lib/krb5/os/ustime.c b/src/lib/krb5/os/ustime.c
new file mode 100644
index 000000000..e9b802d4c
--- /dev/null
+++ b/src/lib/krb5/os/ustime.c
@@ -0,0 +1,42 @@
+/*
+ * $Source$
+ * $Author$
+ *
+ * Copyright 1990 by the Massachusetts Institute of Technology.
+ *
+ * For copying and distribution information, please see the file
+ * <krb5/mit-copyright.h>.
+ *
+ * krb5_mstimeofday for BSD 4.3
+ */
+
+#ifndef lint
+static char rcsid_mstime_c[] =
+"$Id$";
+#endif lint
+
+#include <krb5/copyright.h>
+
+#include <sys/time.h>
+#include <errno.h>
+#include <stdio.h>
+
+#include <krb5/krb5.h>
+#include <krb5/libos-proto.h>
+
+extern int errno;
+
+krb5_error_code
+krb5_ms_timeofday(seconds, milliseconds)
+register krb5_int32 *seconds, *milliseconds;
+{
+ struct timeval tv;
+
+ if (gettimeofday(&tv, (struct timezone *)0) == -1) {
+ /* failed, return errno */
+ return (krb5_error_code) errno;
+ }
+ *seconds = tv.tv_sec;
+ *milliseconds = tv.tv_usec / 1000;
+ return 0;
+}