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 上监听这些事件?
您可以使用libudev或更方便的、基于 glib 的gudev来监视 C 中的 udev 事件。
你必须听“ uevent ”信号。将回调附加到此信号并等待通知。