linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] easily tweakable comm length
@ 2005-01-11 10:17 pmeda
  0 siblings, 0 replies; only message in thread
From: pmeda @ 2005-01-11 10:17 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel


This change still keeps the comm length at 16, but allows easier patching for
local modifications, and also introduces a macro to use instead of magic 16,
where sizeof(comm) is not preferable to use.
Not able to use killall, pidof etc. effectively, when long process names are
used for scripts. Just changing the command length from 16 to 32 breaks a.out
coredump logic. Deamonise and get_task_comm helped in other places in 2.6.10.

Signed-off-by: Prasanna Meda <pmeda@akamai.com>

--- a/arch/sparc64/kernel/binfmt_aout32.c	Tue Jan 11 09:04:24 2005
+++ b/arch/sparc64/kernel/binfmt_aout32.c	Tue Jan 11 09:04:59 2005
@@ -95,7 +95,7 @@
 	set_fs(KERNEL_DS);
 	has_dumped = 1;
 	current->flags |= PF_DUMPCORE;
-       	strncpy(dump.u_comm, current->comm, sizeof(current->comm));
+       	strncpy(dump.u_comm, current->comm, sizeof(dump.u_comm));
 	dump.signal = signr;
 	dump_thread(regs, &dump);
 
--- a/fs/binfmt_aout.c	Tue Jan 11 09:11:56 2005
+++ b/fs/binfmt_aout.c	Tue Jan 11 09:14:32 2005
@@ -112,7 +112,7 @@
 	set_fs(KERNEL_DS);
 	has_dumped = 1;
 	current->flags |= PF_DUMPCORE;
-       	strncpy(dump.u_comm, current->comm, sizeof(current->comm));
+       	strncpy(dump.u_comm, current->comm, sizeof(dump.u_comm));
 #ifndef __sparc__
 	dump.u_ar0 = (void *)(((unsigned long)(&dump.regs)) - ((unsigned long)(&dump)));
 #endif
--- a/include/linux/sched.h	Tue Jan 11 09:23:56 2005
+++ b/include/linux/sched.h	Tue Jan 11 09:27:05 2005
@@ -121,6 +121,9 @@
 #define set_current_state(state_value)		\
 	set_mb(current->state, (state_value))
 
+/* Task command name length */
+#define TASK_COMM_LEN 16
+
 /*
  * Scheduling policies
  */
@@ -601,7 +604,7 @@
 	struct key *thread_keyring;	/* keyring private to this thread */
 #endif
 	unsigned short used_math;
-	char comm[16];
+	char comm[TASK_COMM_LEN];
 /* file system info */
 	int link_count, total_link_count;
 /* ipc stuff */

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-01-11 10:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-11 10:17 [patch] easily tweakable comm length pmeda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).