aboutsummaryrefslogtreecommitdiff
path: root/test/tsan/setuid2.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/tsan/setuid2.c')
-rw-r--r--test/tsan/setuid2.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/tsan/setuid2.c b/test/tsan/setuid2.c
index 67a6fd14dbcb..9dbb6577e1c6 100644
--- a/test/tsan/setuid2.c
+++ b/test/tsan/setuid2.c
@@ -1,4 +1,4 @@
-// RUN: %clang_tsan -O1 %s -o %t && TSAN_OPTIONS="flush_memory_ms=1 memory_limit_mb=1" %run %t 2>&1 | FileCheck %s
+// RUN: %clang_tsan -O1 %s -o %t && %env_tsan_opts=flush_memory_ms=1:memory_limit_mb=1 %run %t 2>&1 | FileCheck %s
#include "test.h"
#include <sys/types.h>
#include <unistd.h>
@@ -7,11 +7,11 @@
// Test that setuid call works in presence of stoptheworld.
int main() {
- struct timespec tp0, tp1;
- clock_gettime(CLOCK_MONOTONIC, &tp0);
- clock_gettime(CLOCK_MONOTONIC, &tp1);
- while (tp1.tv_sec - tp0.tv_sec < 3) {
- clock_gettime(CLOCK_MONOTONIC, &tp1);
+ unsigned long long tp0, tp1;
+ tp0 = monotonic_clock_ns();
+ tp1 = monotonic_clock_ns();
+ while (tp1 - tp0 < 3 * 1000000000ull) {
+ tp1 = monotonic_clock_ns();
setuid(0);
}
fprintf(stderr, "DONE\n");