diff options
Diffstat (limited to 'lib/tsan/tests/unit/tsan_clock_test.cc')
-rw-r--r-- | lib/tsan/tests/unit/tsan_clock_test.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/tsan/tests/unit/tsan_clock_test.cc b/lib/tsan/tests/unit/tsan_clock_test.cc index 92071827d3d8..83e25fb5a933 100644 --- a/lib/tsan/tests/unit/tsan_clock_test.cc +++ b/lib/tsan/tests/unit/tsan_clock_test.cc @@ -13,6 +13,7 @@ #include "tsan_clock.h" #include "tsan_rtl.h" #include "gtest/gtest.h" +#include <sys/time.h> #include <time.h> namespace __tsan { @@ -416,9 +417,9 @@ static bool ClockFuzzer(bool printing) { } TEST(Clock, Fuzzer) { - timespec ts; - clock_gettime(CLOCK_MONOTONIC, &ts); - int seed = ts.tv_sec + ts.tv_nsec; + struct timeval tv; + gettimeofday(&tv, NULL); + int seed = tv.tv_sec + tv.tv_usec; printf("seed=%d\n", seed); srand(seed); if (!ClockFuzzer(false)) { |