clinuxeventsstorageudev

Listen for harware change events from the linux kernel or udev


I need to run some code on storage device mounting and unmounting.
How can i listen for these events on linux?


Solution

  • You can use libudev or the more convenient, glib based gudev to monitor udev events in C.