mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chuck Ebbert <76306.1226@compuserve.com>
To: linux-kernel <linux-kernel@vger.kernel.org>
Cc: Andrew Morton <akpm@osdl.org>, Daniel Jacobowitz <dan@debian.org>,
	Linus Torvalds <torvalds@osdl.org>,
	Albert Cahalan <acahalan@gmail.com>
Subject: [patch] ptrace: make pid of child process available for PTRACE_EVENT_VFORK_DONE
Date: Tue, 1 Aug 2006 01:52:32 -0400	[thread overview]
Message-ID: <200608010154_MC3-1-C6A9-2893@compuserve.com> (raw)

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

                 reply	other threads:[~2006-08-01  5:59 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200608010154_MC3-1-C6A9-2893@compuserve.com \
    --to=76306.1226@compuserve.com \
    --cc=acahalan@gmail.com \
    --cc=akpm@osdl.org \
    --cc=dan@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®