- compile the test program with
gcc -o test-zsh main.c
- run it as
test-zsh no-subreaper|subreaper|subreaper-reap
There are 3 modes:
- no-subreaper: do not invoke the program with
PR_SET_CHILD_SUBREAPER
, so the child process of zsh will be reaped by something else ( either zsh? or PID 1) - subreaper: set
PR_SET_CHILD_SUBREAPER
, but doesnt reap child processes when receiving SIGCHLD