Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Khem Raj <raj.khem@gmail.com>
To: linux-kselftest@vger.kernel.org
Cc: Khem Raj <raj.khem@gmail.com>, John Stultz <jstultz@google.com>,
	Shuah Khan <shuah@kernel.org>
Subject: [PATCH] selftests: timers: Fix clock_adjtime for newer 32-bit arches
Date: Tue, 17 Sep 2024 17:47:31 -0700	[thread overview]
Message-ID: <20240918004731.3295870-1-raj.khem@gmail.com> (raw)

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
 }
 
 

             reply	other threads:[~2024-09-18  0:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-18  0:47 Khem Raj [this message]
2024-09-18  8:58 ` [PATCH] selftests: timers: Fix clock_adjtime for newer 32-bit arches John Stultz
2024-09-19 17:54   ` Shuah Khan
2024-09-19 18:05     ` Khem Raj

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240918004731.3295870-1-raj.khem@gmail.com \
    --to=raj.khem@gmail.com \
    --cc=jstultz@google.com \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox