1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 22:07:35 +00:00

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

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)