开发者

Can I set the Linux SIGUSR1 from within the kernel?

开发者 https://www.devze.com 2022-12-15 14:07 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消