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 - a null pointer could be passed in. Usage of !raw_pointer.is_null() checks should prevent unsafe behavior but the caller should ensure no null pointers are passed.