diff --git a/headers/posix/sys/wait.h b/headers/posix/sys/wait.h index 6b3217309b..8bb44ce36e 100644 --- a/headers/posix/sys/wait.h +++ b/headers/posix/sys/wait.h @@ -6,6 +6,7 @@ #define _SYS_WAIT_H +#include #include #include @@ -25,9 +26,14 @@ #define WTERMSIG(value) (((value) >> 8) & 0xff) #define WIFSTOPPED(value) ((((value) >> 16) & 0xff) != 0) #define WSTOPSIG(value) (((value) >> 16) & 0xff) -#define WIFCORED(value) ((value) & 0x10000) +#define WCOREDUMP(value) ((value) & 0x10000) #define WIFCONTINUED(value) ((value) & 0x20000) +#ifdef _DEFAULT_SOURCE +/* non-standard macro for backwards compatibility */ +#define WIFCORED(value) WCOREDUMP(value) +#endif + /* ID types for waitid() */ typedef enum { P_ALL, /* wait for any children, ignore ID */ diff --git a/src/system/libroot/posix/sys/wait.cpp b/src/system/libroot/posix/sys/wait.cpp index d8dd5b025c..e5f5487b3d 100644 --- a/src/system/libroot/posix/sys/wait.cpp +++ b/src/system/libroot/posix/sys/wait.cpp @@ -54,7 +54,7 @@ _waitpid(pid_t pid, int* _status, int options, team_usage_info *usage_info) case CLD_DUMPED: // fill in signal for WIFSIGNALED() and WTERMSIG() status = (info.si_status << 8) & 0xff00; - // if core dumped, set flag for WIFCORED() + // if core dumped, set flag for WCOREDUMP() if (info.si_code == CLD_DUMPED) status |= 0x10000; break;