From 32cd3ba42b89141b324a085db70c54d53befb8ef Mon Sep 17 00:00:00 2001 From: Ali Mashtizadeh Date: Mon, 2 Oct 2023 19:53:08 -0400 Subject: [PATCH] Add WIFEXITED --- sys/include/wait.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/include/wait.h b/sys/include/wait.h index 8c1c6bf..e1903bb 100644 --- a/sys/include/wait.h +++ b/sys/include/wait.h @@ -4,8 +4,12 @@ #include -/* Extract the status code from the process */ +/* Extract the status code from the status */ #define WEXITSTATUS(_x) (_x & 0x000000ff) +#define _WSTATUS(_x) ((_x & 0x0000ff00) >> 8) +/* Exited gracefully */ +#define WIFEXITED(_x) (_WSTATUS(_x) == 0) +/* Extract the pid from the status (Castor specific) */ #define WGETPID(_x) ((pid_t)(_x >> 16)) /* Flags to waitpid */