[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20250428-nolibc-misc-v2-15-3c043eeab06c@linutronix.de>
Date: Mon, 28 Apr 2025 14:40:16 +0200
From: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
To: Willy Tarreau <w@....eu>,
Thomas Weißschuh <linux@...ssschuh.net>,
Shuah Khan <shuah@...nel.org>
Cc: linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org,
Thomas Weißschuh <thomas.weissschuh@...utronix.de>
Subject: [PATCH v2 15/15] tools/nolibc: implement wait() in terms of
waitpid()
Newer architectures like riscv 32-bit are missing sys_wait4().
Make use of the fact that wait(&status) is defined to be equivalent to
waitpid(-1, status, 0) to implment it on all architectures.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
Acked-by: Willy Tarreau <w@....eu>
---
tools/include/nolibc/sys/wait.h | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/tools/include/nolibc/sys/wait.h b/tools/include/nolibc/sys/wait.h
index f27be86ad5e480f3817b4500ac42fae445cdfc27..4d44e3da0ba814d00368027d893e2eb1155b86f3 100644
--- a/tools/include/nolibc/sys/wait.h
+++ b/tools/include/nolibc/sys/wait.h
@@ -31,12 +31,6 @@ pid_t sys_wait4(pid_t pid, int *status, int options, struct rusage *rusage)
#endif
}
-static __attribute__((unused))
-pid_t wait(int *status)
-{
- return __sysret(sys_wait4(-1, status, 0, NULL));
-}
-
static __attribute__((unused))
pid_t wait4(pid_t pid, int *status, int options, struct rusage *rusage)
{
@@ -113,4 +107,10 @@ pid_t waitpid(pid_t pid, int *status, int options)
return info.si_pid;
}
+static __attribute__((unused))
+pid_t wait(int *status)
+{
+ return waitpid(-1, status, 0);
+}
+
#endif /* _NOLIBC_SYS_WAIT_H */
--
2.49.0
Powered by blists - more mailing lists