From: Chuck Ebbert <76306.1226@compuserve.com> When delivering PTRACE_EVENT_VFORK_DONE, provide pid of the child process when tracer calls ptrace(PTRACE_GETEVENTMSG). This is already (accidentally) available when the tracer is tracing VFORK in addition to VFORK_DONE. Signed-off-by: Chuck Ebbert <76306.1226@compuserve.com> Cc: Daniel Jacobowitz Cc: Albert Cahalan Cc: Roland McGrath Signed-off-by: Andrew Morton --- kernel/fork.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff -puN kernel/fork.c~ptrace-make-pid-of-child-process-available-for kernel/fork.c --- a/kernel/fork.c~ptrace-make-pid-of-child-process-available-for +++ a/kernel/fork.c @@ -1387,8 +1387,10 @@ long do_fork(unsigned long clone_flags, if (clone_flags & CLONE_VFORK) { wait_for_completion(&vfork); - if (unlikely (current->ptrace & PT_TRACE_VFORK_DONE)) + if (unlikely (current->ptrace & PT_TRACE_VFORK_DONE)) { + current->ptrace_message = nr; ptrace_notify ((PTRACE_EVENT_VFORK_DONE << 8) | SIGTRAP); + } } } else { free_pid(pid); _