From 6d958ff2f027263d96daf99f3d3efbd24ebe8d00 Mon Sep 17 00:00:00 2001 From: John Kohl Date: Thu, 18 Jan 1990 11:19:42 +0000 Subject: *** empty log message *** git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@114 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/os/timeofday.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/lib/krb5/os/timeofday.c (limited to 'src') 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 + * . + * + * libos: krb5_timeofday function for BSD 4.3 + */ + +#ifndef lint +static char rcsid_timeofday_c[] = +"$Id$"; +#endif lint + +#include + +#include /* for timeval */ +#include /* needed for libos-proto.h */ + +#include +#include +#include + +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; + +} -- cgit