From: Khem Raj <raj.khem@gmail.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] Define SYS_futex on 32bit arches using 64-bit time_t
Date: Sun, 15 Nov 2020 16:33:45 -0800 [thread overview]
Message-ID: <20201116003345.3261577-1-raj.khem@gmail.com> (raw)
Newer 32bit arches like RISCV32 and ARC are using 64bit time_t
from get go unlike other 32bit architecture therefore aliasing __NR_futex to
__NR_futex_time64 helps avoid the below errors
tst_checkpoint.c:99:17: error: use of undeclared identifier 'SYS_futex'
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
lib/tst_checkpoint.c | 4 ++++
testcases/kernel/syscalls/clone/clone08.c | 4 ++++
testcases/kernel/syscalls/futex/futextest.h | 4 ++++
3 files changed, 12 insertions(+)
diff --git a/lib/tst_checkpoint.c b/lib/tst_checkpoint.c
index 5e5b11496c..80e82c13f4 100644
--- a/lib/tst_checkpoint.c
+++ b/lib/tst_checkpoint.c
@@ -31,6 +31,10 @@
#include "safe_macros.h"
#include "lapi/futex.h"
+#if !defined(SYS_futex) && defined(SYS_futex_time64)
+#define SYS_futex SYS_futex_time64
+#endif
+
#define DEFAULT_MSEC_TIMEOUT 10000
futex_t *tst_futexes;
diff --git a/testcases/kernel/syscalls/clone/clone08.c b/testcases/kernel/syscalls/clone/clone08.c
index 8e115b0421..aaaff94aa0 100644
--- a/testcases/kernel/syscalls/clone/clone08.c
+++ b/testcases/kernel/syscalls/clone/clone08.c
@@ -17,6 +17,10 @@
#include "clone_platform.h"
#include "lapi/syscalls.h"
+#if !defined(SYS_futex) && defined(SYS_futex_time64)
+#define SYS_futex SYS_futex_time64
+#endif
+
static pid_t ptid, ctid, tgid;
static void *child_stack;
diff --git a/testcases/kernel/syscalls/futex/futextest.h b/testcases/kernel/syscalls/futex/futextest.h
index c50876fa67..06e2275d55 100644
--- a/testcases/kernel/syscalls/futex/futextest.h
+++ b/testcases/kernel/syscalls/futex/futextest.h
@@ -20,6 +20,10 @@
#include "lapi/futex.h"
#include "tst_timer.h"
+#if !defined(SYS_futex) && defined(SYS_futex_time64)
+#define SYS_futex SYS_futex_time64
+#endif
+
#define FUTEX_INITIALIZER 0
#ifndef FUTEX_CMP_REQUEUE
--
2.29.2
next reply other threads:[~2020-11-16 0:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-16 0:33 Khem Raj [this message]
2020-11-16 7:08 ` [LTP] [PATCH] Define SYS_futex on 32bit arches using 64-bit time_t Petr Vorel
2020-11-16 16:07 ` Khem Raj
2020-11-16 17:03 ` Petr Vorel
2020-11-16 18:03 ` Khem Raj
2020-11-16 18:19 ` Petr Vorel
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=20201116003345.3261577-1-raj.khem@gmail.com \
--to=raj.khem@gmail.com \
--cc=ltp@lists.linux.it \
/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