[LTP] [PATCH 1/1] regen.sh: tst_syscall(): Print again syscall number as string
Petr Vorel
pvorel@suse.cz
Thu Feb 17 19:45:54 CET 2022
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
More information about the ltp
mailing list