LibC: sys/wait.h now has proper exit status macros

We use the same format as basically every implementation
This commit is contained in:
Bananymous 2023-08-01 10:32:04 +03:00
parent 679d47131d
commit 13852e865c
1 changed files with 7 additions and 10 deletions

View File

@ -20,17 +20,14 @@ __BEGIN_DECLS
#define WNOWAIT 0x10 #define WNOWAIT 0x10
#define WSTOPPED 0x20 #define WSTOPPED 0x20
#define WEXITSTATUS(status) (status & 0xFF) #define WEXITSTATUS(status) (((status) >> 8) & 0xFF)
#define WIFEXITED(status) (WEXITSTATUS(status) != 0) #define WSTOPSIG(status) WEXITSTATUS(status)
#define WTERMSIG(status) ((status) & 0x7F)
#define WIFEXITED(status) (WTERMSIG(status) == 0)
#define WIFSIGNALED(status) (((status) & 0x7F) > 0 && ((status) & 0x7F) < 0x7F)
#define WIFSTOPPED(status) (((status) & 0xFF) == 0x7F)
// FIXME #define __WGENEXITCODE(ret, sig) (((ret) << 8) | (sig))
#if 0
#define WIFCONTINUED
#define WIFSIGNALED
#define WIFSTOPPED
#define WSTOPSIG
#define WTERMSIG
#endif
typedef enum typedef enum
{ {