Reject the call if “sig” is too large (but why not if negative?? “kill” does not check this parameter before passing it to “psignal”. Admittedly the “kill” command could only result in a positive value for “sig” ...);
If the current value of “p_sig” is NOT set to “SIGKILL”, then overwrite it (i.e. once a process has been “killed outright” there is no way to revive it.);
Seems to be an error here ... for “p_stat” read “p_pri” ... improve the priority of the process if it is not too good;
If the process is waiting for a non-kernel event i.e. it called “sleep” (2066) with a positive priority, then set it running again.