summaryrefslogtreecommitdiffstats
path: root/tools/include
diff options
context:
space:
mode:
authorThomas Weißschuh <linux@weissschuh.net>2023-03-25 16:45:10 +0100
committerPaul E. McKenney <paulmck@kernel.org>2023-03-28 01:26:10 +0200
commit8c934d4822c77818d53f5f4c948c3ace6fda1505 (patch)
treef8b62ed83af6e47baa4d84ba9ab4fd8eb7d22846 /tools/include
parenttools/nolibc: add definitions for standard fds (diff)
downloadlinux-8c934d4822c77818d53f5f4c948c3ace6fda1505.tar.xz
linux-8c934d4822c77818d53f5f4c948c3ace6fda1505.zip
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 <linux@weissschuh.net> Signed-off-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'tools/include')
-rw-r--r--tools/include/nolibc/types.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/include/nolibc/types.h b/tools/include/nolibc/types.h
index 10823e5ac44b..aedd7d9e3f64 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