summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/timers/nanosleep.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/testing/selftests/timers/nanosleep.c')
-rw-r--r--tools/testing/selftests/timers/nanosleep.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/tools/testing/selftests/timers/nanosleep.c b/tools/testing/selftests/timers/nanosleep.c
index df1d03516e7b..252c6308c569 100644
--- a/tools/testing/selftests/timers/nanosleep.c
+++ b/tools/testing/selftests/timers/nanosleep.c
@@ -27,23 +27,11 @@
#include <sys/timex.h>
#include <string.h>
#include <signal.h>
+#include <include/vdso/time64.h>
#include "../kselftest.h"
-#define NSEC_PER_SEC 1000000000ULL
-
-#define CLOCK_REALTIME 0
-#define CLOCK_MONOTONIC 1
-#define CLOCK_PROCESS_CPUTIME_ID 2
-#define CLOCK_THREAD_CPUTIME_ID 3
-#define CLOCK_MONOTONIC_RAW 4
-#define CLOCK_REALTIME_COARSE 5
-#define CLOCK_MONOTONIC_COARSE 6
-#define CLOCK_BOOTTIME 7
-#define CLOCK_REALTIME_ALARM 8
-#define CLOCK_BOOTTIME_ALARM 9
+/* CLOCK_HWSPECIFIC == CLOCK_SGI_CYCLE (Deprecated) */
#define CLOCK_HWSPECIFIC 10
-#define CLOCK_TAI 11
-#define NR_CLOCKIDS 12
#define UNSUPPORTED 0xf00f
@@ -132,11 +120,12 @@ int main(int argc, char **argv)
{
long long length;
int clockid, ret;
+ int max_clocks = CLOCK_TAI + 1;
ksft_print_header();
- ksft_set_plan(NR_CLOCKIDS);
+ ksft_set_plan(max_clocks);
- for (clockid = CLOCK_REALTIME; clockid < NR_CLOCKIDS; clockid++) {
+ for (clockid = CLOCK_REALTIME; clockid < max_clocks; clockid++) {
/* Skip cputime clockids since nanosleep won't increment cputime */
if (clockid == CLOCK_PROCESS_CPUTIME_ID ||