Commit bf36f91f authored by Prasanna Meda's avatar Prasanna Meda Committed by Linus Torvalds

[PATCH] easily tweakable comm length

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: default avatarPrasanna Meda <pmeda@akamai.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 88464d1b
......@@ -95,7 +95,7 @@ static int aout32_core_dump(long signr, struct pt_regs *regs, struct file *file)
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);
......
......@@ -112,7 +112,7 @@ static int aout_core_dump(long signr, struct pt_regs * regs, struct file *file)
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
......
......@@ -121,6 +121,9 @@ extern unsigned long nr_iowait(void);
#define set_current_state(state_value) \
set_mb(current->state, (state_value))
/* Task command name length */
#define TASK_COMM_LEN 16
/*
* Scheduling policies
*/
......@@ -612,7 +615,7 @@ struct task_struct {
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 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment