From: Thomas Weißschuh Date: Sat, 25 Mar 2023 15:45:10 +0000 (+0100) Subject: tools/nolibc: add helpers for wait() signal exits X-Git-Tag: v6.4-rc1~201^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8c934d4822c77818d53f5f4c948c3ace6fda1505;p=thirdparty%2Fkernel%2Flinux.git tools/nolibc: add helpers for wait() signal exits These are useful for users and will also be used in an upcoming testcase. Signed-off-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney --- diff --git a/tools/include/nolibc/types.h b/tools/include/nolibc/types.h index 10823e5ac44b7..aedd7d9e3f644 100644 --- a/tools/include/nolibc/types.h +++ b/tools/include/nolibc/types.h @@ -97,6 +97,8 @@ /* Macros used on waitpid()'s return status */ #define WEXITSTATUS(status) (((status) & 0xff00) >> 8) #define WIFEXITED(status) (((status) & 0x7f) == 0) +#define WTERMSIG(status) ((status) & 0x7f) +#define WIFSIGNALED(status) ((status) - 1 < 0xff) /* waitpid() flags */ #define WNOHANG 1