diff options
author | dtucker@openbsd.org@openbsd.org <dtucker@openbsd.org@openbsd.org> | 2017-11-25 06:46:22 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2017-11-28 12:01:49 +1100 |
commit | 5db6fbf1438b108e5df3e79a1b4de544373bc2d4 (patch) | |
tree | 95f5df8248cca30df3ab00e70e80d28410be760c /misc.h | |
parent | 2d638e986085bdf1a40310ed6e2307463db96ea0 (diff) |
upstream commit
Add monotime_ts and monotime_tv that return monotonic
timespec and timeval respectively. Replace calls to gettimeofday() in packet
timing with monotime_tv so that the callers will work over a clock step.
Should prevent integer overflow during clock steps reported by wangle6 at
huawei.com. "I like" markus@
OpenBSD-Commit-ID: 74d684264814ff806f197948b87aa732cb1b0b8a
Diffstat (limited to 'misc.h')
-rw-r--r-- | misc.h | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: misc.h,v 1.67 2017/10/25 00:17:08 djm Exp $ */ | 1 | /* $OpenBSD: misc.h,v 1.68 2017/11/25 06:46:22 dtucker Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 4 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
@@ -67,6 +67,8 @@ char *tohex(const void *, size_t); | |||
67 | void sanitise_stdfd(void); | 67 | void sanitise_stdfd(void); |
68 | void ms_subtract_diff(struct timeval *, int *); | 68 | void ms_subtract_diff(struct timeval *, int *); |
69 | void ms_to_timeval(struct timeval *, int); | 69 | void ms_to_timeval(struct timeval *, int); |
70 | void monotime_ts(struct timespec *); | ||
71 | void monotime_tv(struct timeval *); | ||
70 | time_t monotime(void); | 72 | time_t monotime(void); |
71 | double monotime_double(void); | 73 | double monotime_double(void); |
72 | void lowercase(char *s); | 74 | void lowercase(char *s); |