I\'ve been developing an application that monitors the USB device tree using libusb_hotplug_register_callback()
. When a device that matches some criteria is attache
In general I do not recommend calling fork from an portable libusb program unless fork is immediately followed by exec. This is due to known issues with fork on OS X. The issue was discussed on the libusb-devel mailing list some time ago (2002) and it looks like I forgot to add this caveat to the documentation for libusb-1.0. I recommend using threads instead.
On Linux we inherit any fork caveats from libudev. I do not see anything in their documentation about fork so I do not know if it should work or not. You can always try with netlink by adding --disable-udev. This option is not recommended for production use but it might help isolate the problem.