diff options
author | obrien <obrien@FreeBSD.org> | 2011-06-17 21:44:13 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2011-06-17 21:44:13 +0000 |
commit | d17521adb2543f02ad59e97921e87c7ad0201bb7 (patch) | |
tree | 3579be18eecbdf6b58fa1740cb4276052f4f4d87 | |
parent | 8a9fdbb838682bca3d92ebd804102b651699ab25 (diff) | |
download | FreeBSD-src-d17521adb2543f02ad59e97921e87c7ad0201bb7.zip FreeBSD-src-d17521adb2543f02ad59e97921e87c7ad0201bb7.tar.gz |
Add comment from CSRG rev 7.27 (1992/06/23 19:56:55; author: mckusick)
-rw-r--r-- | sys/kern/sys_process.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index a4c0069..ee36b35 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -829,6 +829,15 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) 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) { |