-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added an API call to check the connection status of a device handle #1456
base: master
Are you sure you want to change the base?
Conversation
This kind of API is prone to TOCTOU problems, so I'm not sure it's advisable to add. With multithreading and hotplug, the answer it gives can be incorrect an instant later. |
The TOCTOU issue is addressed by the fact that all other API calls will also report |
Yeah, sounds reasonable enough. Could you squash your commits? |
907c4f8
to
627ed30
Compare
I've squashed it |
627ed30
to
8c5c750
Compare
8c5c750
to
bf24f0d
Compare
It may be good to add this to one of the existing examples as well to make it easy to test the new function. |
bf24f0d
to
bbf2183
Compare
I've added a call to |
If there are no further comments or concerns regarding this PR can it please be merged? |
We will need to have the review and approval of the current active developers, basically @tormodvolden and/or @hjelmn. |
Aside from hot-plug events there is no good way to quickly check if a device handle is still attached to the system. I believe the only way to currently check if a device handle is still attached in a non-blocking manner is by attempting to claim an already claimed interface. This new API call adds a convenient method by which to check this.