Re: PTRACE_GET_THREAD_AREA

Linus Torvalds (torvalds@transmeta.com)
Fri, 20 Dec 2002 17:42:36 +0000 (UTC)


In article <200212200832.gBK8Wfg29816@magilla.sf.frob.com>,
Roland McGrath <roland@redhat.com> wrote:
>This patch vs 2.5.51 (should apply fine to 2.5.52) adds two new ptrace
>requests for i386, PTRACE_GET_THREAD_AREA and PTRACE_SET_THREAD_AREA.
>These let another process using ptrace do the equivalent of performing
>get_thread_area and set_thread_area system calls for another thread.

Looks fine, except I'd ask you to split up the get/set logic as separate
functions, instead of making that case-statement thing horribly big.

Big functions are bad.

So please make it look something like

case PTRACE_GET_THREAD_AREA:
ret = ptrace_get_area(addr, (struct user_desc *) data);
break;

case PTRACE_SET_THREAD_AREA:
ret = ptrace_set_area(addr, (struct user_desc *) data);
break;

instead, ok?

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