svn commit: r223212 - head/sys/kern

David E. O'Brien obrien at FreeBSD.org
Fri Jun 17 21:44:13 UTC 2011


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) {


More information about the svn-src-head mailing list