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) {
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to