aboutsummaryrefslogtreecommitdiff
path: root/test/tsan/setuid2.c
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-12-30 11:52:19 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-12-30 11:52:19 +0000
commit5c909fa013fc285f010a95e8d387e0ef3412da9c (patch)
tree1059d068ad281f4776ff44cd414574f99a460023 /test/tsan/setuid2.c
parentf31bcc68c72371a2bf63aead9f3373a1ff2053b6 (diff)
downloadsrc-5c909fa013fc285f010a95e8d387e0ef3412da9c.tar.gz
src-5c909fa013fc285f010a95e8d387e0ef3412da9c.zip
Vendor import of compiler-rt trunk r256633:vendor/compiler-rt/compiler-rt-trunk-r256633
Notes
Notes: svn path=/vendor/compiler-rt/dist/; revision=292925 svn path=/vendor/compiler-rt/compiler-rt-trunk-r256633/; revision=292926; tag=vendor/compiler-rt/compiler-rt-trunk-r256633
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");