diff options
author | phk <phk@FreeBSD.org> | 1998-04-04 13:26:20 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1998-04-04 13:26:20 +0000 |
commit | 5e9a131f20894d1df9e8c1768be6eb1cc29a3cf4 (patch) | |
tree | 76909c92c472744745de10e5dacc307ea5f7af45 /sys/kern/uipc_socket2.c | |
parent | ddcbf85eb29fd2d50ce1afa0243be370d4893370 (diff) | |
download | FreeBSD-src-5e9a131f20894d1df9e8c1768be6eb1cc29a3cf4.zip FreeBSD-src-5e9a131f20894d1df9e8c1768be6eb1cc29a3cf4.tar.gz |
Time changes mark 2:
* Figure out UTC relative to boottime. Four new functions provide
time relative to boottime.
* move "runtime" into struct proc. This helps fix the calcru()
problem in SMP.
* kill mono_time.
* add timespec{add|sub|cmp} macros to time.h. (XXX: These may change!)
* nanosleep, select & poll takes long sleeps one day at a time
Reviewed by: bde
Tested by: ache and others
Diffstat (limited to 'sys/kern/uipc_socket2.c')
-rw-r--r-- | sys/kern/uipc_socket2.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c index 997442d..47df800 100644 --- a/sys/kern/uipc_socket2.c +++ b/sys/kern/uipc_socket2.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)uipc_socket2.c 8.1 (Berkeley) 6/10/93 - * $Id: uipc_socket2.c,v 1.30 1997/09/07 16:53:48 bde Exp $ + * $Id: uipc_socket2.c,v 1.31 1998/03/01 19:39:19 guido Exp $ */ #include <sys/param.h> @@ -157,13 +157,14 @@ sodropablereq(head) { register struct socket *so; unsigned int i, j, qlen; - static int rnd; - static long old_mono_secs; + static struct timeval old_runtime; static unsigned int cur_cnt, old_cnt; + struct timeval tv; - if ((i = (mono_time.tv_sec - old_mono_secs)) != 0) { - old_mono_secs = mono_time.tv_sec; + getmicroruntime(&tv); + if ((i = (tv.tv_sec - old_runtime.tv_sec)) != 0) { + old_runtime = tv; old_cnt = cur_cnt / i; cur_cnt = 0; } |