signal misc
在user space注册信号处理函数
sigaction()函数prototype:
int sigaction(int signum, const struct sigaction *act,
struct sigaction *oldact);
struct sigaction sa_usr;
sa_usr.sa_flags = 0;
sa_usr.sa_handler = sig_usr;
sigaction(SIGTERM, &sa_usr, NULL);
在kernel space发送信号给user space进程
send_sig(int sig, struct task_struct *p, int priv)
sig即是signal num,比如SIGTERM,p是进程的task_struct,priv一般情况下传0即可