[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250304-nolibc-kselftest-harness-v1-22-adca7cd231e2@linutronix.de>
Date: Tue, 04 Mar 2025 08:10:52 +0100
From: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
To: Shuah Khan <shuah@...nel.org>, Shuah Khan <skhan@...uxfoundation.org>,
Willy Tarreau <w@....eu>,
Thomas Weißschuh <linux@...ssschuh.net>
Cc: linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org,
Thomas Weißschuh <thomas.weissschuh@...utronix.de>
Subject: [PATCH 22/32] Revert "selftests/nolibc: use waitid() over
waitpid()"
nolibc's waitpid() now uses the waitid() syscall internally.
This removes the original reasoning for the reverted commit as
waitpid() is now available on all platforms and has an easier interface.
Switch back to waitpid().
This reverts commit a0bc8947ac731ff95a56e0c1737e69e8c56d5b78.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
---
tools/testing/selftests/nolibc/nolibc-test.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c
index 7eb7f3fb067553cccefefdaa2ccfc81af281336b..6fa659429cfc38c9d42f36f80ab6c529890d9ad7 100644
--- a/tools/testing/selftests/nolibc/nolibc-test.c
+++ b/tools/testing/selftests/nolibc/nolibc-test.c
@@ -1445,8 +1445,7 @@ static int run_protection(int min __attribute__((unused)),
int max __attribute__((unused)))
{
pid_t pid;
- int llen = 0, ret;
- siginfo_t siginfo = {};
+ int llen = 0, status;
struct rlimit rlimit = { 0, 0 };
llen += printf("0 -fstackprotector ");
@@ -1484,11 +1483,10 @@ static int run_protection(int min __attribute__((unused)),
return 1;
default:
- ret = waitid(P_PID, pid, &siginfo, WEXITED);
+ pid = waitpid(pid, &status, 0);
- if (ret != 0 || siginfo.si_signo != SIGCHLD ||
- siginfo.si_code != CLD_KILLED || siginfo.si_status != SIGABRT) {
- llen += printf("waitid()");
+ if (pid == -1 || !WIFSIGNALED(status) || WTERMSIG(status) != SIGABRT) {
+ llen += printf("waitpid()");
result(llen, FAIL);
return 1;
}
--
2.48.1
Powered by blists - more mailing lists