summaryrefslogtreecommitdiffstats
path: root/src/lib/krb5/os/timeofday.c
diff options
context:
space:
mode:
authorJohn Kohl <jtkohl@mit.edu>1990-01-18 11:19:42 +0000
committerJohn Kohl <jtkohl@mit.edu>1990-01-18 11:19:42 +0000
commit6d958ff2f027263d96daf99f3d3efbd24ebe8d00 (patch)
tree240457105bc2071adc833b6abef006f3c5fca244 /src/lib/krb5/os/timeofday.c
parentf946dd89f0e61d61bf8df893cea8711ac81f5519 (diff)
downloadkrb5-6d958ff2f027263d96daf99f3d3efbd24ebe8d00.tar.gz
krb5-6d958ff2f027263d96daf99f3d3efbd24ebe8d00.tar.xz
krb5-6d958ff2f027263d96daf99f3d3efbd24ebe8d00.zip
*** empty log message ***
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@114 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/krb5/os/timeofday.c')
-rw-r--r--src/lib/krb5/os/timeofday.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/lib/krb5/os/timeofday.c b/src/lib/krb5/os/timeofday.c
new file mode 100644
index 0000000000..ab47b40e1f
--- /dev/null
+++ b/src/lib/krb5/os/timeofday.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>.
+ *
+ * libos: krb5_timeofday function for BSD 4.3
+ */
+
+#ifndef lint
+static char rcsid_timeofday_c[] =
+"$Id$";
+#endif lint
+
+#include <krb5/copyright.h>
+
+#include <sys/time.h> /* for timeval */
+#include <stdio.h> /* needed for libos-proto.h */
+
+#include <krb5/config.h>
+#include <krb5/base-defs.h>
+#include <krb5/libos-proto.h>
+
+extern int errno;
+
+krb5_error_code
+krb5_timeofday(timeret)
+register krb5_int32 *timeret;
+{
+ struct timeval tv;
+
+ if (gettimeofday(&tv, (struct timezone *)0) == -1) {
+ /* failed, return errno */
+ return (krb5_error_code) errno;
+ }
+ *timeret = tv.tv_sec;
+ return 0;
+
+}