[LTP] [PATCH v2] openposix: update invalid clock id to accomodate new auxiliary clock ids

Avinesh Kumar akumar@suse.de
Tue Oct 7 16:32:06 CEST 2025


Starting kernel v6.17, there are 8 more auxiliary clock ids reserved on
systems with CONFIG_POSIX_AUX_CLOCK=y [1] and moreover posix systems can
define and support any number of clocks beyond the mandatory ones.

[1] https://lore.kernel.org/lkml/20250519083025.905800695@linutronix.de/

Signed-off-by: Avinesh Kumar <akumar@suse.de>
---
 .../conformance/interfaces/clock_getres/6-2.c                | 5 ++---
 .../conformance/interfaces/clock_gettime/8-2.c               | 4 ++--
 .../conformance/interfaces/clock_settime/17-2.c              | 4 ++--
 3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/6-2.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/6-2.c
index c44809012..af45e27c9 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/6-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/6-2.c
@@ -17,8 +17,7 @@
  *   unassigned value = -1073743192 (ex. of what gcc will set to)
  *   unassigned value = 1073743192 (ex. of what gcc will set to)
  *   -1
- *   17 (currently not = to any clock)
- *
+ *   50 (hopefully big enough value not to be a valid clock id)
  */
 #include <stdio.h>
 #include <time.h>
@@ -33,7 +32,7 @@ int main(void)
 	struct timespec res;
 	int invalid_tests[NUMINVALIDTESTS] = {
 		INT32_MIN, INT32_MAX, 2147483647, -2147483647, -1073743192,
-		1073743192, -1, 17
+		1073743192, -1, 50
 	};
 	int i;
 	int failure = 0;
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/8-2.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/8-2.c
index ed4cd4078..92263ce87 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/8-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/8-2.c
@@ -15,7 +15,7 @@
  *   unassigned value = -1073743192 (ex. of what gcc will set to)
  *   unassigned value = 1073743192 (ex. of what gcc will set to)
  *   -1
- *   17 (currently not = to any clock)
+  *   50 (hopefully big enough value not to be a valid clock id)
  */
 #include <stdio.h>
 #include <time.h>
@@ -27,7 +27,7 @@
 
 static int invalid_tests[NUMINVALIDTESTS] = {
 	INT32_MIN, INT32_MAX, 2147483647, -2147483647, -1073743192,
-	1073743192, -1, 17
+	1073743192, -1, 50
 };
 
 int main(void)
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/17-2.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/17-2.c
index 990e41470..7504b7692 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/17-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/17-2.c
@@ -16,7 +16,7 @@
  *   unassigned value = -1073743192 (ex. of what gcc will set to)
  *   unassigned value = 1073743192 (ex. of what gcc will set to)
  *   -1
- *   17 (currently not = to any clock)
+ *   50 (hopefully big enough value not to be a valid clock id)
  *
  * The date chosen is Nov 12, 2002 ~11:13am (date when test was first
  * written).
@@ -34,7 +34,7 @@
 
 static int invalid_tests[NUMINVALIDTESTS] = {
 	INT32_MIN, INT32_MAX, 2147483647, -2147483647, -1073743192,
-	1073743192, -1, 17
+	1073743192, -1, 50
 };
 
 int main(void)
-- 
2.51.0



More information about the ltp mailing list