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

2015-09-14 Thread David Grayson
Good news! I figured out that I can simply use udev_device_get_is_initialized(). It does exactly what I want. I tried using a udev_monitor but it doesn't seem to report pre-existing devices (devices that were already connected to the system). It just reports changes. Thanks for the help. --Da

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

2015-09-14 Thread David Grayson
On Mon, Sep 14, 2015 at 12:04 PM, Greg KH wrote: > Start your program to listen and handle all devices that way through > udev iterators, that way will always work (for existing and new > devices). If by "existing devices", you mean devices that were connected to the computer before my program st

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

2015-09-14 Thread Greg KH
On Mon, Sep 14, 2015 at 11:55:17AM -0700, David Grayson wrote: > Hello, Greg. Thanks for the quick reply, and for all your > contributions to Linux. > > On Fri, Sep 11, 2015 at 6:01 PM, Greg KH wrote: > > Can't you wait for libudev to notify your application when the usb > > device is attached?

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

2015-09-14 Thread David Grayson
Hello, Greg. Thanks for the quick reply, and for all your contributions to Linux. On Fri, Sep 11, 2015 at 6:01 PM, Greg KH wrote: > 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?

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

2015-09-11 Thread Greg KH
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 wa

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

2015-09-11 Thread David Grayson
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 t