---
title: "IODataQueueWaitForAvailableData(_:_:)"
framework: IOKit
role: symbol
role_heading: Function
platforms: [iOS 18.4+, iPadOS 18.4+, Mac Catalyst 13.0+, macOS 10.0+, visionOS 2.4+]
path: iokit/1514696-iodataqueuewaitforavailabledata
---

# IODataQueueWaitForAvailableData(_:_:)

Wait for an incoming dataAvailable message on the given notifyPort.

## Declaration

```swift
func IODataQueueWaitForAvailableData(_ dataQueue: UnsafeMutablePointer<IODataQueueMemory>!, _ notificationPort: mach_port_t) -> IOReturn
```

## Parameters

- `dataQueue`: The IODataQueueMemory region mapped from the kernel.
- `notifyPort`: Mach port on which to listen for incoming messages.

## Return Value

Return Value Returns kIOReturnSuccess on success. Returns kIOReturnBadArgument if either dataQueue is 0 (NULL) or notiryPort is MACH_PORT_NULL. Returns the result of the mach_msg() listen call on the given port.

## Discussion

Discussion This method will simply wait for an incoming message on the given notifyPort. Once it is received, the return from mach_msg() is returned.

## See Also

### Miscellaneous

- [IODataQueueAllocateNotificationPort()](iokit/1514495-iodataqueueallocatenotificationp.md)
- [IODataQueueDataAvailable(_:)](iokit/1514386-iodataqueuedataavailable.md)
- [IODataQueueDequeue(_:_:_:)](iokit/1514287-iodataqueuedequeue.md)
- [IODataQueueEnqueue(_:_:_:)](iokit/1514482-iodataqueueenqueue.md)
- [IODataQueuePeek(_:)](iokit/1514649-iodataqueuepeek.md)
- [IODataQueueSetNotificationPort(_:_:)](iokit/1514301-iodataqueuesetnotificationport.md)
