[libhid-discuss] Re: rewriting the hid parser

Charles Lepple clepple at ghz.cc
Mon Feb 5 23:54:46 CET 2007


On Feb 4, 2007, at 1:29 PM, Peter Stuge wrote:

> On Sun, Feb 04, 2007 at 01:36:31PM +0100, Frederik Reiß wrote:
>> naturally hid_is_opened() and hid_is_initialised() should also be
>> present.
>
[...]
> Does hid_open() return -EBUSY or similar if the device is open
> already?

Currently, hid_is_opened() (called by hid_open()) only checks to see  
if the given hidif structure has been opened before.

So it sounds like you would not get a specific EBUSY error if you  
used two separate calls to open the device.

Then again, it is hard to distinguish between the kernel claiming the  
HID interface, and another program or thread claiming it through  
libhid or libusb, so not much has been done in that area. Keeping  
hid_open() and hid_force_open() as separate functions means that  
programmers have to think twice about what "busy" means, but I'll  
admit that this is not ideal. Patches are welcome.

-- 
Charles Lepple
clepple at ghz.cc





More information about the libhid-discuss mailing list