Define SYS_futex on 32bit arches using 64-bit time_t
PATCH 1/1 Define SYS_futex on 32bit arches using 64-bit time_t
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'
--- lib/tst_checkpoint.c | 4 ++++ testcases/kernel/syscalls/clone/clone08.c | 4 ++++ testcases/kernel/syscalls/futex/futextest.h | 4 ++++ 3 files changed, 12 insertions(+)
lib/tst_checkpoint.c +4 -0
@@ -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 10000futex_t *tst_futexes;
testcases/kernel/syscalls/clone/clone08.c +4 -0
@@ -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;
testcases/kernel/syscalls/futex/futextest.h +4 -0
@@ -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
Signature · 1 line
2.29.2
PATCH 1/1 Define SYS_futex on 32bit arches using 64-bit time_t
Hi Khem,
Quoted 5 lines
Newer 32bit arches like RISCV32 and ARC are using 64bit
time_tfrom get go unlike other 32bit architecture therefore aliasing__NR_futexto__NR_futex_time64helps avoid the below errorstst_checkpoint.c:99:17: error: use of undeclared identifier '
SYS_futex'
Thanks for your fix.
I wonder if this could be defined just in include/lapi/futex.h and this:
https://github.com/pevik/ltp/commit/a20107ab47554798e0de0347dd4d7259f01675af
Kind regards,
Petr
PATCH 1/1 Define SYS_futex on 32bit arches using 64-bit time_t
Quoted 7 lines · Petr Vorel
Hi Khem,
Quoted 2 lines
Newer 32bit arches like RISCV32 and ARC are using 64bit
time_tfrom get go unlike other 32bit architecture therefore aliasing
__NR_futextoQuoted 1 line
__NR_futex_time64helps avoid the below errors
Quoted 9 lines
Quoted 1 line
tst_checkpoint.c:99:17: error: use of undeclared identifier '
SYS_futex'Thanks for your fix.
I wonder if this could be defined just in
include/lapi/futex.hand this:https://github.com/pevik/ltp/commit/a20107ab47554798e0de0347dd4d7259f01675af
It could be but it did not work everywhere when I tried it I guess this header has to be included in all needed placed
Quoted 4 lines
Kind regards,
Petr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20201116/f1bcac3f/attachment.htm>
PATCH 1/1 Define SYS_futex on 32bit arches using 64-bit time_t
Hi Khem,
Quoted 13 lines · Petr Vorel
Quoted 11 lines
Hi Khem,
Quoted 2 lines
Newer 32bit arches like RISCV32 and ARC are using 64bit
time_tfrom get go unlike other 32bit architecture therefore aliasing
__NR_futextoQuoted 3 lines
__NR_futex_time64helps avoid the below errorstst_checkpoint.c:99:17: error: use of undeclared identifier '
SYS_futex'Thanks for your fix.
Quoted 8 lines
Quoted 4 lines
I wonder if this could be defined just in
include/lapi/futex.hand this:https://github.com/pevik/ltp/commit/a20107ab47554798e0de0347dd4d7259f01675af
It could be but it did not work everywhere when I tried it I guess this header has to be included in all needed placed
Sure, but that's done :)
You put the changes into 3 files:lib/tst_checkpoint.ctestcases/kernel/syscalls/clone/clone08.ctestcases/kernel/syscalls/futex/futextest.h
Check the affected files:
I put changes into include/lapi/futex.h
and load it intestcases/kernel/syscalls/clone/clone08.c
The other two (testcases/kernel/syscalls/clone/clone08.c testcases/kernel/syscalls/futex/futextest.h) already include lapi/futex.h.
Are you sure it's failing when you try my patchset?
Kind regards,
Petr
PATCH 1/1 Define SYS_futex on 32bit arches using 64-bit time_t
Quoted 34 lines · Petr Vorel
Hi Khem,
Quoted 13 lines · Petr Vorel
Quoted 11 lines
Hi Khem,
Quoted 2 lines
Newer 32bit arches like RISCV32 and ARC are using 64bit
time_tfrom get go unlike other 32bit architecture therefore aliasing
__NR_futextoQuoted 3 lines
__NR_futex_time64helps avoid the below errorstst_checkpoint.c:99:17: error: use of undeclared identifier '
SYS_futex'Thanks for your fix.
Quoted 8 lines
Quoted 4 lines
I wonder if this could be defined just in
include/lapi/futex.hand this:https://github.com/pevik/ltp/commit/a20107ab47554798e0de0347dd4d7259f01675af
It could be but it did not work everywhere when I tried it I guess this header has to be included in all needed placed
Sure, but that's done :)
You put the changes into 3 files:
lib/tst_checkpoint.ctestcases/kernel/syscalls/clone/clone08.ctestcases/kernel/syscalls/futex/futextest.hCheck the affected files:
Quoted 9 lines
I put changes into
include/lapi/futex.h
and load it intestcases/kernel/syscalls/clone/clone08.cThe other two (
testcases/kernel/syscalls/clone/clone08.ctestcases/kernel/syscalls/futex/futextest.h) already includelapi/futex.h.Are you sure it's failing when you try my patchset?
I tested https://github.com/pevik/ltp/commit/a20107ab47554798e0de0347dd4d7259f01675af
and it works fine. So please use this one.
Quoted 2 lines
Kind regards,
Petr
PATCH 1/1 Define SYS_futex on 32bit arches using 64-bit time_t
Hi Khem,
...
Quoted 2 lines
I tested https://github.com/pevik/ltp/commit/a20107ab47554798e0de0347dd4d7259f01675af
and it works fine. So please use this one.
Thanks for a confirmation, merged.
Kind regards,
Petr