Can I set the Linux SIGUSR1 from within the kernel?
I might be approaching this all wrong but...
I have a linux kernel device driver that handles an external interrupt and currently performs a printk() when it occurs.
What I would like to do is tell a user space app that this event has occ开发者_如何学运维urred so it can wake up and do some stuff.
Is it possible (/simple /good practice) to set the SIGUSR1 from within the kernel and then capture it from user space via
signal (SIGUSR1, <handler function>);
Thanks
This doesn't sound like a very good idea. If it is even possible, you'd have to somehow give the driver the process id of the user-space guy so the driver could finagle getting a signal to it.
I would create a /dev/xxx, open it, and the driver could make the file descriptor active when the event occurs. Maybe even provide more information.
精彩评论