From f946dd89f0e61d61bf8df893cea8711ac81f5519 Mon Sep 17 00:00:00 2001 From: John Kohl Date: Thu, 18 Jan 1990 11:10:49 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@113 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/os/ustime.c | 42 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/lib/krb5/os/ustime.c 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_mstimeofday for BSD 4.3 + */ + +#ifndef lint +static char rcsid_mstime_c[] = +"$Id$"; +#endif lint + +#include + +#include +#include +#include + +#include +#include + +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; +} -- 2.26.2