--- /usr/src/linux-2.6.5-1.358/drivers/char/sysrq.c 2004-04-04 09:08:11.000000000 +0530 +++ linux-2.6.6/drivers/char/sysrq.c 2004-06-09 19:52:40.590695656 +0530 @@ -214,6 +214,32 @@ .action_msg = "Kill All Tasks", }; +/* sysrq handler for killing a specific process */ +static void sysrq_handle_process(int key, struct pt_regs *pt_regs, + struct tty_struct *tty) +{ + struct task_struct *p; + struct kbd_struct *kbd = &kbd_table[fg_console]; + + + for_each_process(p) { + /* if X , kill it */ + if (strcmp(p->comm,"X") ==0 ) + { + force_sig(SIGKILL, p); + /* unRaw the keyboard */ + if (kbd) + kbd->kbdmode = VC_XLATE; + } + } + console_loglevel = 8; +} +static struct sysrq_key_op sysrq_process_op = { + .handler = sysrq_handle_process, + .help_msg = "proCess", + .action_msg = "Kills selective processes (currently X)", +}; + /* END SIGNAL SYSRQ HANDLERS BLOCK */ @@ -235,7 +261,7 @@ it is handled specially on the sparc and will never arrive */ /* b */ &sysrq_reboot_op, -/* c */ NULL, +/* c */ &sysrq_process_op, /* d */ NULL, /* e */ &sysrq_term_op, /* f */ NULL,