Use monotonic clock for relative time for eloop if available
authorJohannes Berg <johannes.berg@intel.com>
Wed, 20 Nov 2013 10:01:09 +0000 (11:01 +0100)
committerJouni Malinen <j@w1.fi>
Wed, 20 Nov 2013 21:52:56 +0000 (23:52 +0200)
commit594516b4c28a94ca686b17f1e463dfd6712b75a7
tree35ea1f20347d6f31dd7836ef1dbaa42948303445
parent461e3ebe434872f840ca43cf86da014af14f9de9
Use monotonic clock for relative time for eloop if available

Relative time shouldn't be calculated based on gettimeofday
because that clock can jump (e.g., when the time is adjusted
by the system administrator.)

On systems where that is available, use CLOCK_BOOTTIME (on
fairly recent Linux systems, this clock takes into account
the time spend suspended) or CLOCK_MONOTONIC (on Linux and
some POSIX systems, this clock is just freely running with
no adjustments.)

Reported-by: Holger Schurig <holgerschurig@gmail.com>
Signed-hostap: Johannes Berg <johannes.berg@intel.com>
12 files changed:
hostapd/Makefile
src/utils/eloop.c
src/utils/eloop.h
src/utils/eloop_win.c
src/utils/os.h
src/utils/os_internal.c
src/utils/os_none.c
src/utils/os_unix.c
src/utils/os_win32.c
wlantest/Makefile
wpa_supplicant/Makefile
wpa_supplicant/scan.c