mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [patch] ptrace: make pid of child process available for PTRACE_EVENT_VFORK_DONE
@ 2006-08-01  5:52 Chuck Ebbert
  0 siblings, 0 replies; only message in thread
From: Chuck Ebbert @ 2006-08-01  5:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: Andrew Morton, Daniel Jacobowitz, Linus Torvalds, Albert Cahalan

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>

--- 2.6.18-rc3-32.orig/kernel/fork.c
+++ 2.6.18-rc3-32/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);
-- 
Chuck

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-08-01  5:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-01  5:52 [patch] ptrace: make pid of child process available for PTRACE_EVENT_VFORK_DONE Chuck Ebbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®