user-space notification of USB device attached/detached
I have a user-space application that needs to be notified when a USB device has just been attached or detached (hot plugged/unplugged). Can someone tell me how to setup or register for such a notification? I'm running embedded linux 2.6.
I want to be notified of any type of USB device. But just for starters, I'm using a USB Memory Stick. I've loaded all of the necessary drivers:
and when I attach or detach the USB Memory Stick, I do see debug traces indicating the attachment/detachment. I can also manually mount the device (/dev/sda1) and read and write files on it. Now, I just need my user-space app to automatically get the attach/detach notifications so it knows when it can read and write the USB Memory Stick.
Last edited by rhardy; 10-24-2006 at 03:03 PM.