timeval: Add monotonic time functionality for NetBSD and FreeBSD.
authorRyan Wilson <wryan@nicira.com>
Tue, 3 Jun 2014 05:47:15 +0000 (22:47 -0700)
committerYAMAMOTO Takashi <yamamoto@valinux.co.jp>
Wed, 4 Jun 2014 17:34:56 +0000 (02:34 +0900)
commit50a1a1d2cc2b8fb573076ff6ee0e4f790919118b
tree11c87d16e644fa6f71e88f64a3bde0c39f6000e5
parent348f828214d9660a69ba0730ff1c96b61a3ab7ca
timeval: Add monotonic time functionality for NetBSD and FreeBSD.

This patch also checks the system platform as clock_gettime
could exist on different platforms but with different values of
CLOCK_MONOTONIC and different definitions of 'struct timespec'.
In this case, the system call would be expected to catch the
error, which is dangerous.

This patch ensures Linux, NetBSD and FreeBSD platforms use
clock_gettime with their corresponding correct values and
definitions. All other platforms use time.time().

Signed-off-by: Ryan Wilson <wryan@nicira.com>
Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
python/ovs/timeval.py