开发者

How do I detect reboot/shutdown from a linux driver

I have a loadable linux module which controls some hardware. I need to run some code before a soft reboot, however, I noticed the module destructor does not seem to be called in开发者_如何学Go this situation, so I'm wondering how to have the driver informed before the reboot occurs.


You want register_reboot_notifier(). For an example you can look here: see lines 181, 142, 129.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜