diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2024-01-10 20:35:49 +0000 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2024-01-16 14:07:06 +0000 |
commit | a83b93e662b0e65fd181ed50de7e960b311f4a94 (patch) | |
tree | 0740251e35d370dbd98e1cb80bb86f651d68b71a /winsup | |
parent | b7868e74103541f3271a170fe3bc2b19a00cc8cf (diff) | |
download | newlib-a83b93e662b0e65fd181ed50de7e960b311f4a94.zip newlib-a83b93e662b0e65fd181ed50de7e960b311f4a94.tar.gz newlib-a83b93e662b0e65fd181ed50de7e960b311f4a94.tar.bz2 |
Cygwin: Define and use __WCOREFLAG
Also fix a typo in description of exit status
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/exceptions.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/include/cygwin/wait.h | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index 36f6a47..362ad69 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -1334,7 +1334,7 @@ signal_exit (int sig, siginfo_t *si, void *) if (cygheap->rlim_core == 0Ul) break; - sig |= 0x80; /* Set flag in exit status to show that we've "dumped core" */ + sig |= __WCOREFLAG; /* Set flag in exit status to show that we've "dumped core" */ /* If core dump size is >1MB, try to invoke dumper to write a .core file */ diff --git a/winsup/cygwin/include/cygwin/wait.h b/winsup/cygwin/include/cygwin/wait.h index 7e40c8d..0d42e89 100644 --- a/winsup/cygwin/include/cygwin/wait.h +++ b/winsup/cygwin/include/cygwin/wait.h @@ -16,12 +16,13 @@ details. */ #define WUNTRACED 2 #define WCONTINUED 8 #define __W_CONTINUED 0xffff +#define __WCOREFLAG 0x80 /* A status is 16 bits, and looks like: <1 byte info> <1 byte code> <code> == 0, child has exited, info is the exit value - <code> == 1..7e, child has exited, info is the signal number. + <code> == 1..7e, child has exited, code is the signal number. <code> == 7f, child has stopped, info was the signal number. <code> == 80, there was a core dump. */ @@ -34,6 +35,6 @@ details. */ #define WEXITSTATUS(_w) (((_w) >> 8) & 0xff) #define WTERMSIG(_w) ((_w) & 0x7f) #define WSTOPSIG WEXITSTATUS -#define WCOREDUMP(_w) (WIFSIGNALED(_w) && ((_w) & 0x80)) +#define WCOREDUMP(_w) (WIFSIGNALED(_w) && ((_w) & __WCOREFLAG)) #endif /* _CYGWIN_WAIT_H */ |