]> git.hungrycats.org Git - linux/commitdiff
[PATCH] tracer pid.
authorDave Jones <davej@codemonkey.org.uk>
Wed, 8 Jan 2003 10:55:25 +0000 (02:55 -0800)
committerLinus Torvalds <torvalds@home.transmeta.com>
Wed, 8 Jan 2003 10:55:25 +0000 (02:55 -0800)
Can't remember where this came from, but its been around
for quite a while. Prints the parent (tracer) pid if
its being traced.

fs/proc/array.c

index 4dae164bc85a59f3c51d63d92617341d8eea4649..fd826e15234cb9312552b35510b2635de9e1e542 100644 (file)
@@ -161,7 +161,8 @@ static inline char * task_state(struct task_struct *p, char *buffer)
                "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);