Re: How to know when udev rules are done being applied to a new USB device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 11, 2015 at 04:54:13PM -0700, David Grayson wrote:
> Hello.
> 
> In Linux, there seems to be a period of time when a newly-connected
> USB device will be detectable by libudev, but the udev rules governing
> its permissions have not been applied.  This is a problem for me
> because I want to write user-mode software that waits for a USB device
> to appear, and then opens a handle to it and performs I/O.  If I
> connect too early, I will end up getting a permission error.
> Specifically, I will get the EACCES error when I call open() on the
> USB device node (e.g. /dev/bus/usb/006/041).  What is the best way to
> solve this problem?  Is there any way to ask the system whether all of
> the udev rules have been applied for a particular device?

Can't you wait for libudev to notify your application when the usb
device is attached?  That should happen after the normal rules are run.
Have you tried that?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux