Skip to content

Commit

Permalink
[PATCH] ptrace: make pid of child process available for PTRACE_EVENT_…
Browse files Browse the repository at this point in the history
…VFORK_DONE

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 <dan@debian.org>
Cc: Albert Cahalan <acahalan@gmail.com>
Cc: Roland McGrath <roland@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Chuck Ebbert authored and Linus Torvalds committed Aug 6, 2006
1 parent f9abd1a commit 9f59ce5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kernel/fork.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9f59ce5

Please sign in to comment.