diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/posix/exec_sigmask.sh | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/posix/exec_sigmask.sh b/tests/posix/exec_sigmask.sh index e01c05e..d1192a4 100644 --- a/tests/posix/exec_sigmask.sh +++ b/tests/posix/exec_sigmask.sh @@ -1,4 +1,16 @@ # Regression test: restore the signal mask after fork() -test "$UNAME" = "Linux" || skip -bfs_diff /proc/self/status -exec grep '^SigBlk:' {} + +cd "$TEST" +mkfifo p1 p2 + +{ + # Get the PID of `sh` + read -r pid <p1 + # Send SIGTERM -- this will hang forever if signals are blocked + kill $pid +} & + +# Write the `sh` PID to p1, then hang reading p2 until we're killed +! invoke_bfs p1 -exec sh -c 'echo $$ >p1 && read -r _ <p2' {} + || fail + +wait |