Skip to content
Snippets Groups Projects
Commit 57298d06 authored by Josh Triplett's avatar Josh Triplett
Browse files

Add W_STOPCODE to construct a stop code


On Linux, `sys/wait.h` defines a `W_STOPCODE` macro to construct a stop
code from the signal number of a stopping signal. Provide an equivalent
function.

Suggested-by: default avatarIvan Tham <pickfire@riseup.net>
parent 631da86c
No related branches found
No related tags found
No related merge requests found
...@@ -1258,6 +1258,10 @@ f! { ...@@ -1258,6 +1258,10 @@ f! {
(ret << 8) | sig (ret << 8) | sig
} }
pub fn W_STOPCODE(sig: ::c_int) -> ::c_int {
(sig << 8) | 0x7f
}
pub fn QCMD(cmd: ::c_int, type_: ::c_int) -> ::c_int { pub fn QCMD(cmd: ::c_int, type_: ::c_int) -> ::c_int {
(cmd << 8) | (type_ & 0x00ff) (cmd << 8) | (type_ & 0x00ff)
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment