LibC: Add WSTOPSIG macro

This macro can be used on the "status" output from sys$waitpid() to
find out which signal caused the waitee process to stop.

Fixes #794.
This commit is contained in:
Andreas Kling 2020-01-27 20:47:56 +01:00
parent 5163c5cc63
commit 65961d3ffc
Notes: sideshowbarker 2024-07-19 09:46:31 +09:00

View file

@ -32,6 +32,7 @@
__BEGIN_DECLS
#define WEXITSTATUS(status) (((status)&0xff00) >> 8)
#define WSTOPSIG(status) WEXITSTATUS(status)
#define WTERMSIG(status) ((status)&0x7f)
#define WIFEXITED(status) (WTERMSIG(status) == 0)
#define WIFSTOPPED(status) (((status) & 0xff) == 0x7f)