After adding one module as insmod to the kernel space, the added driver tries to generate a SIGUSR1. At this time, I want to receive and process the SIGUSR1 signal of kernel space from user space, so what is the way to give the SIGUSR1 signal from kernel space to user space?
Thank you.
linux kernel
You can use send_sig().
send_sig(int sig, struct task_struct *p, int priv)
ex )
send_sig(SIGUSR1, my_task, 0);
send_sig(SIGUSR2, my_task, 0);
You can put a task structure to deliver a signal in my_task part, but I know the pidCotton
struct task_struct *my_task;
my_task = pid_task(find_vpid(process_pid), PIDTYPE_PID);
You can find out the task in the same way as above.
© 2024 OneMinuteCode. All rights reserved.