diff options
author | Thomas Weißschuh <thomas.weissschuh@linutronix.de> | 2025-04-28 15:40:16 +0300 |
---|---|---|
committer | Thomas Weißschuh <linux@weissschuh.net> | 2025-05-21 16:32:16 +0300 |
commit | 59303930326ac00bec5ec61321d662a165350939 (patch) | |
tree | ab9cc49f56b1f37acc8f197211e6de2f36a36c09 /tools/include/nolibc | |
parent | 5e7392dc82ed7bf3e734cbca77a1c6fd044ec871 (diff) | |
download | linux-59303930326ac00bec5ec61321d662a165350939.tar.xz |
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 implement it on all architectures.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://lore.kernel.org/r/20250428-nolibc-misc-v2-15-3c043eeab06c@linutronix.de
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Diffstat (limited to 'tools/include/nolibc')
-rw-r--r-- | tools/include/nolibc/sys/wait.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/include/nolibc/sys/wait.h b/tools/include/nolibc/sys/wait.h index f27be86ad5e4..4d44e3da0ba8 100644 --- a/tools/include/nolibc/sys/wait.h +++ b/tools/include/nolibc/sys/wait.h @@ -32,12 +32,6 @@ pid_t sys_wait4(pid_t pid, int *status, int options, struct rusage *rusage) } 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) { return __sysret(sys_wait4(pid, status, options, 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 */ |