[prev in list] [next in list] [prev in thread] [next in thread]
List: boost-users
Subject: [Boost-users] [process] distinguish normal exit from termination by signal - complete
From: Oliver Kowalke via Boost-users <boost-users () lists ! boost ! org>
Date: 2018-12-17 14:43:33
Message-ID: CA+wfc1-VTVfoVN18eb463uv0o3QeJ6MSjYBZmO4BPcALismsSQ () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Hello,
I'm evaluating boost.process. It seams to me that it is impossible to
distinguish a normal exit from a termination by a signal (for instance
SIGBUS etc.).
child::exit_code() calls eval_exit_status() that expands on POSIX to:
if (WIFEXITED(code)) {
return WEXITSTATUS(code);
} else if (WIFSIGNALED(code)) {
return WTERMSIG(code);
} else {
return code;
}
With the code above it is impossible if the returned exit_code is a
`exit-code` or the number of a signal.
Or do I miss something?
regards,
Oliver
[Attachment #5 (text/html)]
<div dir="ltr"><div>Hello,</div><div>I'm evaluating boost.process. It seams to me \
that it is impossible to distinguish a normal exit from a termination by a
signal (for instance <span class="" style="" id=":2sn.1" tabindex="-1">SIGBUS</span> \
etc.).</div><div>child::exit_code() calls <span class="" style="" id=":2sn.2" \
tabindex="-1">eval</span>_exit_status() that expands on <span class="" style="" \
id=":2sn.3" tabindex="-1">POSIX</span> to:</div><div><br></div><div>if (<span \
class="" style="" id=":2sn.4" tabindex="-1">WIFEXITED</span>(code)) {</div><div> \
return <span class="" style="" id=":2sn.5" \
tabindex="-1">WEXITSTATUS</span>(code);</div><div> } else if (<span class="" style="" \
id=":2sn.6" tabindex="-1">WIFSIGNALED</span>(code)) {</div><div> return <span \
class="" style="" id=":2sn.7" tabindex="-1">WTERMSIG</span>(code);</div><div>} else \
{</div><div> return code; <br></div><div>}</div><div><br></div><div>With the code \
above it is impossible if the returned exit_code is a `exit-code` or the number of a \
signal.</div><div>Or do I miss \
something?</div><div><br></div><div>regards,</div><div>Oliver<br></div></div>
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
https://lists.boost.org/mailman/listinfo.cgi/boost-users
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic