summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2004-09-13 17:48:01 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-09-13 17:48:01 -0700
commit90d4cd4f856b2ed48fc667e1c46fc9da3bc97a2f (patch)
tree9cc3ab0a2445a7d60fe6bb8cea975536453ac3aa /include/linux
parent975e9d9918bed608ddfdddfbdd9473adde751f89 (diff)
[PATCH] Add prctl to modify current->comm
This patch adds a prctl to modify current->comm as shown in /proc. This feature was requested by KDE developers. In KDE most programs are started by forking from a kdeinit program that already has the libraries loaded and some other state. Problem is to give these forked programs the proper name. It already writes the command line in the environment (as seen in ps), but top uses a different field in /proc/pid/status that reports current->comm. And that was always "kdeinit" instead of the real command name. So you ended up with lots of kdeinits in your top listing, which was not very useful. This patch adds a new prctl PR_SET_NAME to allow a program to change its comm field. I considered the potential security issues of a program obscuring itself with this interface, but I don't think it matters much because a program can already obscure itself when the admin uses ps instead of top. In case of a KDE desktop calling everything kdeinit is much more obfuscation than the alternative. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/prctl.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/prctl.h b/include/linux/prctl.h
index c8b69670e2d6..54333c98e532 100644
--- a/include/linux/prctl.h
+++ b/include/linux/prctl.h
@@ -50,4 +50,6 @@
process timing */
+#define PR_SET_NAME 15 /* Set process name */
+
#endif /* _LINUX_PRCTL_H */