[PATCH] selftests: timers: Fix clock_adjtime for newer 32-bit arches

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
Cc: John Stultz <jstultz@xxxxxxxxxx>
Cc: Shuah Khan <shuah@xxxxxxxxxx>
---
 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
 }
 
 




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux