From owner-svn-src-head@FreeBSD.ORG Fri Jun 17 21:44:13 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2765106566C; Fri, 17 Jun 2011 21:44:13 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B269E8FC0A; Fri, 17 Jun 2011 21:44:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5HLiDfo009297; Fri, 17 Jun 2011 21:44:13 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5HLiDdP009295; Fri, 17 Jun 2011 21:44:13 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201106172144.p5HLiDdP009295@svn.freebsd.org> From: "David E. O'Brien" Date: Fri, 17 Jun 2011 21:44:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223212 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2011 21:44:13 -0000 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) {