<!--
{
  "availability" : [
    "DriverKit: -",
    "iOS: -",
    "iPadOS: -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "DriverKit",
  "identifier" : "/documentation/DriverKit/IOCommandPool/gatedGetCommand",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "DriverKit"
    ],
    "preciseIdentifier" : "c:@S@IOCommandPool@F@gatedGetCommand#**$@S@IOCommand#b#"
  },
  "title" : "gatedGetCommand"
}
-->

# gatedGetCommand

```
virtual kern_return_t gatedGetCommand(IOCommand **command, bool blockForCommand);
```

## Parameters

`command`

A pointer to a pointer to an IOCommand object where the returned
command will be stored.

`blockForCommand`

A bool that indicates whether to block the request until a command
becomes available.

## Return Value

kIOReturnNoResources if no command is available and the client
doesn’t wish to block until one does become available.
kIOReturnSuccess if the vCommand argument is valid.

## Discussion\discussion The gatedGetCommand method is used to serialize the extraction of a
command from the pool synchronized with the pool’s queue.

---

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)