Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Jun 2011 21:44:13 +0000 (UTC)
From:      "David E. O'Brien" <obrien@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r223212 - head/sys/kern
Message-ID:  <201106172144.p5HLiDdP009295@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: obrien
Date: Fri Jun 17 21:44:13 2011
New Revision: 223212
URL: http://svn.freebsd.org/changeset/base/223212

Log:
  Add comment from CSRG rev 7.27 (1992/06/23 19:56:55; author: mckusick)

Modified:
  head/sys/kern/sys_process.c

Modified: head/sys/kern/sys_process.c
==============================================================================
--- head/sys/kern/sys_process.c	Fri Jun 17 21:41:06 2011	(r223211)
+++ head/sys/kern/sys_process.c	Fri Jun 17 21:44:13 2011	(r223212)
@@ -829,6 +829,15 @@ kern_ptrace(struct thread *td, int req, 
 
 	case PT_ATTACH:
 		/* security check done above */
+		/*
+		 * It would be nice if the tracing relationship was separate
+		 * from the parent relationship but that would require
+		 * another set of links in the proc struct or for "wait"
+		 * to scan the entire proc table.  To make life easier,
+		 * we just re-parent the process we're trying to trace.
+		 * The old parent is remembered so we can put things back
+		 * on a "detach".
+		 */
 		p->p_flag |= P_TRACED;
 		p->p_oppid = p->p_pptr->p_pid;
 		if (p->p_pptr != td->td_proc) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201106172144.p5HLiDdP009295>