Skip to content

Commit

Permalink
LibC: Add WSTOPSIG macro
Browse files Browse the repository at this point in the history
This macro can be used on the "status" output from sys$waitpid() to
find out which signal caused the waitee process to stop.

Fixes SerenityOS#794.
  • Loading branch information
awesomekling committed Jan 27, 2020
1 parent 5163c5c commit 65961d3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Libraries/LibC/sys/wait.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 65961d3

Please sign in to comment.