Linux Kernel Selftest development
 help / color / mirror / Atom feed
* [PATCH] selftests: timers: Fix clock_adjtime for newer 32-bit arches
@ 2024-09-18  0:47 Khem Raj
  2024-09-18  8:58 ` John Stultz
  0 siblings, 1 reply; 4+ messages in thread
From: Khem Raj @ 2024-09-18  0:47 UTC (permalink / raw)
  To: linux-kselftest; +Cc: Khem Raj, John Stultz, Shuah Khan

Newer 32-bit architectures e.g. riscv32 are using 64-bit time_t
from get go, they have not wired __NR_clock_adjtime at all
valid-adjtimex testcase fails to compile on such architectures.
if this condition is found then use 64-bit adjtime syscall

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: John Stultz <jstultz@google.com>
Cc: Shuah Khan <shuah@kernel.org>
---
 tools/testing/selftests/timers/valid-adjtimex.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/testing/selftests/timers/valid-adjtimex.c b/tools/testing/selftests/timers/valid-adjtimex.c
index d500884801d8..ff4ff8b1d127 100644
--- a/tools/testing/selftests/timers/valid-adjtimex.c
+++ b/tools/testing/selftests/timers/valid-adjtimex.c
@@ -39,7 +39,11 @@
 #include <sys/syscall.h>
 int clock_adjtime(clockid_t id, struct timex *tx)
 {
+#if !defined(__NR_clock_adjtime) && defined(__NR_clock_adjtime64)
+	return syscall(__NR_clock_adjtime64, id, tx);
+#else
 	return syscall(__NR_clock_adjtime, id, tx);
+#endif
 }
 
 

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-09-19 18:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-18  0:47 [PATCH] selftests: timers: Fix clock_adjtime for newer 32-bit arches Khem Raj
2024-09-18  8:58 ` John Stultz
2024-09-19 17:54   ` Shuah Khan
2024-09-19 18:05     ` Khem Raj

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox