As you say, you're not even supposed to be here when exit_signal = -1,
except for the ptrace case. This logic exists for the non-CLONE_THREAD
clone case, i.e. ->exit_signal != SIGCHLD and != -1.
That seems OK to me.
That's all still possible, it's just no longer common.
i.e. clone(SIGUSR1|CLONE_VM, ...) or whatnot (no CLONE_THREAD).
I suspect not, but I'm not quite sure. That is, it makes sense to me that
a ptracer should always get its tracees in all waits. That is consistent
with not having to use WUNTRACED, for example. But I'm not really sure any
more what the historical behavior of this has been. The code in GDB uses
__WALL and __WCLONE in various places, clearly assuming that just ptrace
alone is not enough for every wait4 call to catch every tracee. It seems
likely that this method was necessary in the past and that's why the code
is like that.
Thanks,
Roland
--