Function crosvm_control::crosvm_client_usb_list
source · #[no_mangle]
pub unsafe extern "C" fn crosvm_client_usb_list(
socket_path: *const c_char,
entries: *mut UsbDeviceEntry,
entries_length: ssize_t,
) -> ssize_t
Expand description
Returns all USB devices passed through the crosvm instance whose control socket is listening on
socket_path
.
The function returns the amount of entries written.
§Arguments
socket_path
- Path to the crosvm control socketentries
- Pointer to an array ofUsbDeviceEntry
where the details about the attached devices will be written toentries_length
- Amount of entries in the array specified byentries
Use the value returned by crosvm_client_max_usb_devices()
to determine the size of the input
array to this function.
§Safety
Function is unsafe due to raw pointer usage - socket_path
should be a non-null pointer to a C
string that is valid and for reads and not modified for the duration of the call. entries
should be a valid pointer to an array of UsbDeviceEntry
valid for writes that contains at
least entries_length
elements and is not externally modified for the duration of this call.