* [LTP] [PATCH 1/1] regen.sh: tst_syscall(): Print again syscall number as string
@ 2022-02-17 18:45 Petr Vorel
2022-02-18 2:03 ` xuyang2018.jy
0 siblings, 1 reply; 2+ messages in thread
From: Petr Vorel @ 2022-02-17 18:45 UTC (permalink / raw)
To: ltp
Before 4913b0b298 tst_syscall() printed:
TCONF: syscall(434) __NR_pidfd_open not supported
After 4913b0b298 tst_syscall() printed only numbers:
TCONF: syscall(434) 434 not supported on your arch
Constant was passed to TST_SYSCALL_BRK__() as a number thus
stringification didn't work as expected.
Fixes: 4913b0b298 ("lapi,kernel: Replace ltp_syscall with tst_syscall")
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
include/lapi/syscalls/regen.sh | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/include/lapi/syscalls/regen.sh b/include/lapi/syscalls/regen.sh
index 0b412ef6d9..3bf38fd034 100755
--- a/include/lapi/syscalls/regen.sh
+++ b/include/lapi/syscalls/regen.sh
@@ -36,14 +36,14 @@ cat << EOF > "${output_pid}"
#include "cleanup.c"
#ifdef TST_TEST_H__
-#define TST_SYSCALL_BRK__(NR) ({ \\
+#define TST_SYSCALL_BRK__(NR, SNR) ({ \\
tst_brk(TCONF, \\
- "syscall(%d) " #NR " not supported on your arch", NR); \\
+ "syscall(%d) " SNR " not supported on your arch", NR); \\
})
#else
-#define TST_SYSCALL_BRK__(NR) ({ \\
+#define TST_SYSCALL_BRK__(NR, SNR) ({ \\
tst_brkm(TCONF, CLEANUP, \\
- "syscall(%d) " #NR " not supported on your arch", NR); \\
+ "syscall(%d) " SNR " not supported on your arch", NR); \\
})
#endif
@@ -56,7 +56,7 @@ cat << EOF > "${output_pid}"
tst_ret = syscall(NR, ##__VA_ARGS__); \\
} \\
if (tst_ret == -1 && errno == ENOSYS) { \\
- TST_SYSCALL_BRK__(NR); \\
+ TST_SYSCALL_BRK__(NR, #NR); \\
} \\
tst_ret; \\
})
--
2.35.1
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [LTP] [PATCH 1/1] regen.sh: tst_syscall(): Print again syscall number as string
2022-02-17 18:45 [LTP] [PATCH 1/1] regen.sh: tst_syscall(): Print again syscall number as string Petr Vorel
@ 2022-02-18 2:03 ` xuyang2018.jy
0 siblings, 0 replies; 2+ messages in thread
From: xuyang2018.jy @ 2022-02-18 2:03 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp@lists.linux.it
Hi Petr
Obviously correct, pushed.
Best Regards
Yang Xu
> Before 4913b0b298 tst_syscall() printed:
> TCONF: syscall(434) __NR_pidfd_open not supported
>
> After 4913b0b298 tst_syscall() printed only numbers:
> TCONF: syscall(434) 434 not supported on your arch
>
> Constant was passed to TST_SYSCALL_BRK__() as a number thus
> stringification didn't work as expected.
>
> Fixes: 4913b0b298 ("lapi,kernel: Replace ltp_syscall with tst_syscall")
>
> Signed-off-by: Petr Vorel<pvorel@suse.cz>
> ---
> include/lapi/syscalls/regen.sh | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/include/lapi/syscalls/regen.sh b/include/lapi/syscalls/regen.sh
> index 0b412ef6d9..3bf38fd034 100755
> --- a/include/lapi/syscalls/regen.sh
> +++ b/include/lapi/syscalls/regen.sh
> @@ -36,14 +36,14 @@ cat<< EOF> "${output_pid}"
> #include "cleanup.c"
>
> #ifdef TST_TEST_H__
> -#define TST_SYSCALL_BRK__(NR) ({ \\
> +#define TST_SYSCALL_BRK__(NR, SNR) ({ \\
> tst_brk(TCONF, \\
> - "syscall(%d) " #NR " not supported on your arch", NR); \\
> + "syscall(%d) " SNR " not supported on your arch", NR); \\
> })
> #else
> -#define TST_SYSCALL_BRK__(NR) ({ \\
> +#define TST_SYSCALL_BRK__(NR, SNR) ({ \\
> tst_brkm(TCONF, CLEANUP, \\
> - "syscall(%d) " #NR " not supported on your arch", NR); \\
> + "syscall(%d) " SNR " not supported on your arch", NR); \\
> })
> #endif
>
> @@ -56,7 +56,7 @@ cat<< EOF> "${output_pid}"
> tst_ret = syscall(NR, ##__VA_ARGS__); \\
> } \\
> if (tst_ret == -1&& errno == ENOSYS) { \\
> - TST_SYSCALL_BRK__(NR); \\
> + TST_SYSCALL_BRK__(NR, #NR); \\
> } \\
> tst_ret; \\
> })
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-02-18 2:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-17 18:45 [LTP] [PATCH 1/1] regen.sh: tst_syscall(): Print again syscall number as string Petr Vorel
2022-02-18 2:03 ` xuyang2018.jy
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.