Commit 60759371f0e08694bef702f4beaf0d35f932de42
1 parent
6556a833
FreeBSD also has clock_gettime
Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5481 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
2 additions
and
2 deletions
vl.c
| @@ -733,7 +733,7 @@ static int use_rt_clock; | @@ -733,7 +733,7 @@ static int use_rt_clock; | ||
| 733 | static void init_get_clock(void) | 733 | static void init_get_clock(void) |
| 734 | { | 734 | { |
| 735 | use_rt_clock = 0; | 735 | use_rt_clock = 0; |
| 736 | -#if defined(__linux__) | 736 | +#if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD_version >= 500000) |
| 737 | { | 737 | { |
| 738 | struct timespec ts; | 738 | struct timespec ts; |
| 739 | if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) { | 739 | if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) { |
| @@ -745,7 +745,7 @@ static void init_get_clock(void) | @@ -745,7 +745,7 @@ static void init_get_clock(void) | ||
| 745 | 745 | ||
| 746 | static int64_t get_clock(void) | 746 | static int64_t get_clock(void) |
| 747 | { | 747 | { |
| 748 | -#if defined(__linux__) | 748 | +#if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD_version >= 500000) |
| 749 | if (use_rt_clock) { | 749 | if (use_rt_clock) { |
| 750 | struct timespec ts; | 750 | struct timespec ts; |
| 751 | clock_gettime(CLOCK_MONOTONIC, &ts); | 751 | clock_gettime(CLOCK_MONOTONIC, &ts); |