---
title: "IODataQueuePeek(_:)"
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/1514649-iodataqueuepeek
---

# IODataQueuePeek(_:)

Used to peek at the next entry on the queue.

## Declaration

```swift
func IODataQueuePeek(_ dataQueue: UnsafeMutablePointer<IODataQueueMemory>!) -> UnsafeMutablePointer<IODataQueueEntry>!
```

## Parameters

- `dataQueue`: The IODataQueueMemory region mapped from the kernel.

## Return Value

Return Value Returns a pointer to the next IODataQueueEntry if one is available. Zero is returned if the queue is empty.

## Discussion

Discussion This function can be used to look at the next entry which allows the entry to be received without having to copy it with IODataQueueDequeue. In order to do this, call IODataQueuePeek to get the entry. Then call IODataQueueDequeue with a NULL data pointer. That will cause the head to be moved to the next entry, but no memory to be copied.

## See Also

### Miscellaneous

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