From: Nathan H. <hj...@un...> - 2002-12-18 17:33:14
|
On Wed, 18 Dec 2002, Pete Bentley wrote: > On Wed, Dec 18, 2002 at 12:17:41PM +0100, Beat Birkhofer wrote: > > I try to get sane/libusb working on OSX. > > > > I get quite far but then the there's a fork() in the sane backend > > (plustek) I use and then I loose the connection to the IOService. > > > > Any ideas how to solve this problem? I'm quite clueless. > > I suspect this may be rather tricky to solve... > > On most Unixes, the device_handle t libusb uses to communicate > with the device is a file handle, which will get inherited > by the child of a fork() call. > > On OS X, the IOKit functions that are used to implement libusb > seem to use mach ports for communicating with the kernel rather > than file handles... I don't know the semantics of ports well, > but I'm guessing they don't get shared across a fork() call > (or at least not without a lot of extra work) From what I understand, you are correct, ports are not shared across fork calls. I am not sure what can be done to fix the problem except by using threads rather than forks (though, i am not entirely sure that will work either). I am open to suggestions/ideas on how to attack this within libusb so developers dont have to change their code. -nathan |