<!--
{
  "availability" : [
    "DriverKit: 19.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "USBDriverKit",
  "identifier" : "/documentation/USBDriverKit/IOUSBHostDevice/Close",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "USBDriverKit"
    ],
    "preciseIdentifier" : "c:@S@IOUSBHostDevice@F@Close#*$@S@IOService#i#"
  },
  "title" : "Close"
}
-->

# Close

Closes the session to the host device.

```
virtual kern_return_t Close(IOService *forClient, IOOptionBits options);
```

## Parameters

`forClient`

The service object that is closing the session.

`options`

Options to use when closing the service. Specify `0` for this parameter.

## Return Value

<doc://com.apple.documentation/documentation/DriverKit/kIOReturnSuccess> on success, or another value if an error occurs. See <doc://com.apple.documentation/documentation/DriverKit/error-codes>.

## Discussion

This method closes a session to a device that you previously opened using the [`Open`](/documentation/USBDriverKit/IOUSBHostDevice/Open) method. The method acquires the service’s workloop lock, and aborts any I/O initiated by the client service. This method may call <doc://com.apple.documentation/documentation/kernel/iocommandgate/1573818-commandsleep> to allow for the processing of aborted I/O before returning.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)