Skip to contentSkip to conversation

Print tracer PID in /proc/<pid>/status

trivial Daniel Jacobowitz 1 participant 1 message Sep 6, 2002 Proc filesystem

lore
Share & tools
lore
#0 lore raw

We've got a labeled field for showing which process is debugging this one, but we weren't filling it in. This is useful in working on the ptrace code... please apply.

===== array.c 1.26 vs edited =====

array.c renamed from fs/proc/array.c +2 -1
@@ -160,7 +160,8 @@
 		"Uid:\t%d\t%d\t%d\t%d\n"
 		"Gid:\t%d\t%d\t%d\t%d\n",
 		get_task_state(p), p->tgid,
-		p->pid, p->pid ? p->real_parent->pid : 0, 0,
+		p->pid, p->pid ? p->real_parent->pid : 0,
+		p->pid && p->ptrace ? p->parent->pid : 0,
 		p->uid, p->euid, p->suid, p->fsuid,
 		p->gid, p->egid, p->sgid, p->fsgid);
 	read_unlock(&tasklist_lock);	
Signature · 2 lines
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer