get_task_struct()

From: Fabiano Ramos
Date: Sat Apr 17 2004 - 10:43:00 EST


Dear All,

Inside sys_ptrace, the function get_task_struct is invoked after
retrieving the child's task srtuct pointer. Why is it done? I have
tracked down the code and noticed that it is in fact an increment
on the (page?) counter. Can you help me understand it?

Is it necessary to call free_task_struct whenever its get counterpart
is called?


** arch/i386/kernel/ptrace.c
> read_lock(&tasklist_lock);
> child = find_task_by_pid(pid);
> if (child)
> get_task_struct(child);
> read_unlock(&tasklist_lock);

Thanks in advance,
Fabiano

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/