On Thu, 3 Apr 2003 09:21:22 +0800, 
"Zhang, Sonic" <[EMAIL PROTECTED]> wrote:
>       The attachment is the patch for KDB command "kill".
>       usage:
>       kill <-signal> <pid>

You need to check the argument count in kdb_kill, otherwise kill with
no arguments will kill kdb :).

The test for valid numbers is wrong, you do not test endp against the
argument, you test is *endp is NUL.  See simple_strtol in kdb_md().
kdbgetularg() uses a different test because it has to handle
expressions.

Instead of coding all the signal handling yourself, can you use
kernel/signal.c:send_sig_info()?  send_sig_info handles all the cases
for stopped processes, run queues etc., using that routine means that
kdb is not sensitive to changes in signal code.  Do trylock on
t->sigmask_lock in kdb to see if you can get the process mask lock
before calling send_sig_info(), to avoid deadlock.


Reply via email to