From 3e7006cec788ffcc8901c432cfff7549f3bee894 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Pe=C3=B1acoba=20Veigas?= Date: Wed, 10 Jan 2024 16:01:22 +0000 Subject: [PATCH] Change usleep() to sleep_us() in RT tests --- test/rt/nanos6/if0.c | 3 ++- test/rt/nanos6/taskfor.c | 3 ++- test/rt/nosv/waitfor.c | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/test/rt/nanos6/if0.c b/test/rt/nanos6/if0.c index 7b35219..7de6999 100644 --- a/test/rt/nanos6/if0.c +++ b/test/rt/nanos6/if0.c @@ -3,13 +3,14 @@ #define _GNU_SOURCE #include +#include "compat.h" int main(void) { #pragma oss task if (0) { - usleep(1000); + sleep_us(1000); } return 0; } diff --git a/test/rt/nanos6/taskfor.c b/test/rt/nanos6/taskfor.c index 1dfd68b..047c734 100644 --- a/test/rt/nanos6/taskfor.c +++ b/test/rt/nanos6/taskfor.c @@ -3,13 +3,14 @@ #define _GNU_SOURCE #include +#include "compat.h" int main(void) { #pragma oss task for for (int i = 0; i < 1024; i++) - usleep(1000); + sleep_us(1000); return 0; } diff --git a/test/rt/nosv/waitfor.c b/test/rt/nosv/waitfor.c index 3758d87..888f791 100644 --- a/test/rt/nosv/waitfor.c +++ b/test/rt/nosv/waitfor.c @@ -9,6 +9,7 @@ #include #include "common.h" +#include "compat.h" #define NTASKS 200 atomic_int ncompleted = 0; @@ -46,7 +47,7 @@ main(void) nosv_submit(tasks[i], 0); while (atomic_load(&ncompleted) != NTASKS) - usleep(1000); + sleep_us(1000); for (int i = 0; i < NTASKS; i++) nosv_destroy(tasks[i], 0);