[PATCH 4/5] selftests: vDSO: vdso_test_correctness: Add tests for auxiliary clocks
From: Thomas Weißschuh
Date: Tue Jul 28 2026 - 04:00:15 EST
Extend the test to also cover auxiliary clocks.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@xxxxxxxxxxxxx>
---
tools/testing/selftests/vDSO/vdso_test_correctness.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/tools/testing/selftests/vDSO/vdso_test_correctness.c b/tools/testing/selftests/vDSO/vdso_test_correctness.c
index ffad3e636e56..a37dc391bccf 100644
--- a/tools/testing/selftests/vDSO/vdso_test_correctness.c
+++ b/tools/testing/selftests/vDSO/vdso_test_correctness.c
@@ -27,6 +27,10 @@
static const char *version;
static const char **name;
+#ifndef CLOCK_AUX
+#define CLOCK_AUX 16
+#endif
+
#ifndef __NR_clock_gettime64
#define __NR_clock_gettime64 403
#endif
@@ -267,6 +271,14 @@ static const struct {
{ CLOCK_BOOTTIME_ALARM, "CLOCK_BOOTTIME_ALARM"},
{ 10, "CLOCK_SGI_CYCLE"},
{ CLOCK_TAI, "CLOCK_TAI"},
+ { CLOCK_AUX + 0, "CLOCK_AUX0"},
+ { CLOCK_AUX + 1, "CLOCK_AUX1"},
+ { CLOCK_AUX + 2, "CLOCK_AUX2"},
+ { CLOCK_AUX + 3, "CLOCK_AUX3"},
+ { CLOCK_AUX + 4, "CLOCK_AUX4"},
+ { CLOCK_AUX + 5, "CLOCK_AUX5"},
+ { CLOCK_AUX + 6, "CLOCK_AUX6"},
+ { CLOCK_AUX + 7, "CLOCK_AUX7"},
};
static void test_one_clock_gettime(int clock, const char *name)
@@ -285,6 +297,8 @@ static void test_one_clock_gettime(int clock, const char *name)
nerrs++;
} else if (errno == EINVAL) {
printf("[OK]\tNo such clock.\n");
+ } else if (errno == ENODEV) {
+ printf("[SKIP]\t clock_gettime(%d) syscall returned ENODEV\n", clock);
} else {
printf("[WARN]\t clock_gettime(%d) syscall returned error %d\n", clock, errno);
}
@@ -347,6 +361,8 @@ static void test_one_clock_gettime64(int clock, const char *name)
nerrs++;
} else if (errno == EINVAL) {
printf("[OK]\tNo such clock.\n");
+ } else if (errno == ENODEV) {
+ printf("[SKIP]\t clock_gettime64(%d) syscall returned ENODEV\n", clock);
} else {
printf("[WARN]\t clock_gettime64(%d) syscall returned error %d\n", clock, errno);
}
--
2.55.0