Skip to content

Commit

Permalink
tools/nolibc: add helpers for wait() signal exits
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Thomas Weißschuh authored and Paul E. McKenney committed Mar 27, 2023
1 parent 00b7262 commit 8c934d4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/include/nolibc/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8c934d4

Please sign in to comment.