forked from Bananymous/banan-os
LibC: sys/wait.h now has proper exit status macros
We use the same format as basically every implementation
This commit is contained in:
parent
679d47131d
commit
13852e865c
|
@ -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
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue