increasing time, bumping the microsecond time if necessary. This
is needed on OS's like ultrix which only have a 10 us granularity
in their clock, and don't guarantee in the kernel that two calls to
gettimeofday will return different values. This guarantees it in user
space, which isn't quite good enough (two different processes communicating
over the loopback interface could get confused), but it's better than
nothing.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1811
dc483132-0cff-0310-8789-
dd5450dbe970
extern int errno;
+static struct timeval last_tv = {0, 0};
+
krb5_error_code
krb5_us_timeofday(seconds, microseconds)
register krb5_int32 *seconds, *microseconds;
/* failed, return errno */
return (krb5_error_code) errno;
}
+ if ((tv.tv_sec == last_tv.tv_sec) && (tv.tv_usec == last_tv.tv_usec))
+ tv.tv_usec = ++last_tv.tv_usec;
+ else
+ last_tv = tv;
+
*seconds = tv.tv_sec;
*microseconds = tv.tv_usec;
return 0;