aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhina Sree <Abhina.Sreeskantharajan@ibm.com>2024-09-25 08:21:29 -0400
committerGitHub <noreply@github.com>2024-09-25 08:21:29 -0400
commit1e67e4bbba2a90ecaf5340acef110972413e3e5b (patch)
tree33d2624d57586fba8c6d4347ae60957862f2f3fb
parent59693ea6d1822d8cf43db8090ddb4c8d7a78f471 (diff)
downloadllvm-1e67e4bbba2a90ecaf5340acef110972413e3e5b.zip
llvm-1e67e4bbba2a90ecaf5340acef110972413e3e5b.tar.gz
llvm-1e67e4bbba2a90ecaf5340acef110972413e3e5b.tar.bz2
[SystemZ][z/OS] z/OS does not support nanosleep, use usleep instead (#109823)
Use usleep instead of nanosleep to resolve a build error on z/OS because there is no support for nanosleep.
-rw-r--r--llvm/unittests/Support/TimerTest.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/unittests/Support/TimerTest.cpp b/llvm/unittests/Support/TimerTest.cpp
index 09545eb..5686b39 100644
--- a/llvm/unittests/Support/TimerTest.cpp
+++ b/llvm/unittests/Support/TimerTest.cpp
@@ -27,8 +27,13 @@ void SleepMS() {
struct timespec Interval;
Interval.tv_sec = 0;
Interval.tv_nsec = 1000000;
+#if defined(__MVS__)
+ long Microseconds = (Interval.tv_nsec + 999) / 1000;
+ usleep(Microseconds);
+#else
nanosleep(&Interval, nullptr);
#endif
+#endif
}
TEST(Timer, Additivity) {