I tried to create a function ,in my module, that every time , when the system call sys_exit is called. So it will print the pid of the process that the user tried to stop (by press ctr+C, ctr+Z or something else).
asmlinkage long our_sys_exit(struct pt_regs *t)
{
printk("pid is %d \n",current->pid);
return older_sys_exit(t);
}
But I could not do it .