Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个可加载的 linux 模块,它控制一些硬件。我需要在软重启之前运行一些代码,但是,我注意到在这种情况下似乎没有调用模块析构函数,所以我想知道如何在重启发生之前通知驱动程序。
你想要register_reboot_notifier()。例如,您可以在此处查看:请参见第 181、142、129 行。
register_reboot_notifier()