aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorPrasanna Meda <pmeda@akamai.com>2005-01-04 05:32:17 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-01-04 05:32:17 -0800
commite2901099e350a5f069e65ddba778fe0707bc13f7 (patch)
treecedcaecf7c4c1fb875f2958376bdb837c9c1b16b /kernel
parent4ffd90a18b735aa4924740d10a2fe06a6c9d4f55 (diff)
downloadhistory-e2901099e350a5f069e65ddba778fe0707bc13f7.tar.gz
[PATCH] Add PR_GET_NAME
A while back we added the PR_SET_NAME prctl, but no PR_GET_NAME. I guess we should add this, if only to enable testing of PR_SET_NAME. Signed-off-by: Prasanna Meda <pmeda@akamai.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sys.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/sys.c b/kernel/sys.c
index fdc29f17ac939d..1561c2787cc7cb 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -1689,6 +1689,15 @@ asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3,
set_task_comm(me, ncomm);
return 0;
}
+ case PR_GET_NAME: {
+ struct task_struct *me = current;
+ unsigned char tcomm[sizeof(me->comm)];
+
+ get_task_comm(tcomm, me);
+ if (copy_to_user((char __user *)arg2, tcomm, sizeof(tcomm)))
+ return -EFAULT;
+ return 0;
+ }
default:
error = -EINVAL;
break;