Skip to content

Commit 1e67e4b

Browse files
authored
[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.
1 parent 59693ea commit 1e67e4b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

llvm/unittests/Support/TimerTest.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,13 @@ void SleepMS() {
2727
struct timespec Interval;
2828
Interval.tv_sec = 0;
2929
Interval.tv_nsec = 1000000;
30+
#if defined(__MVS__)
31+
long Microseconds = (Interval.tv_nsec + 999) / 1000;
32+
usleep(Microseconds);
33+
#else
3034
nanosleep(&Interval, nullptr);
3135
#endif
36+
#endif
3237
}
3338

3439
TEST(Timer, Additivity) {

0 commit comments

Comments
 (0)