#include <IOKit/IOCircularDataQueue.h>

IOKit/IOCircularDataQueue.h Kernel.framework

includes: IOKit/IOLib.h
17 functions · 2 typedefs · 1 macro · 1 enum

macroIOGCCircularDataQueue_h

#define IOGCCircularDataQueue_h 

typedefIOCircularDataQueue

typedef struct IOCircularDataQueue IOCircularDataQueue

enumIOCircularDataQueueCreateOptions

IOCircularDataQueueCreate* options
underlying type unsigned int
kIOCircularDataQueueCreateConsumer1
kIOCircularDataQueueCreateProducer2

typedefIOCircularDataQueueCreateOptions

typedef enum IOCircularDataQueueCreateOptions IOCircularDataQueueCreateOptions;

functionIOCircularDataQueueCreateWithEntries

IOReturn IOCircularDataQueueCreateWithEntries(
	IOCircularDataQueueCreateOptions options,
	uint32_t numEntries,
	uint32_t entrySize,
	IOCircularDataQueue **pQueue
)
@function IOCircularDataQueueCreateWithEntries @abstract Function that creates a new IOCircularDataQueue instance with the specified number of entries of the given size. @discussion This method will create a new IOCircularDataQueue instance with enough capacity for numEntries of entrySize each. It does account for the IOCircularDataQueueEntryHeader overhead for each entry. Note that the numEntries and entrySize are simply used to determine the data region size. They do not actually restrict the number of enqueues to the queue since its a circular buffer and will eventually overwrite old data. At any time, the allocated data region can hold a maximum of numEntries queue entries. <br> This method allocates a new IOCircularDataQueue instance with the given numEntries and entrySize parameters. @param options IOCircularDataQueueCreateOptions. @param numEntries Number of entries to allocate space for. @param entrySize Size of each entry. @param pQueue Pointer to a queue handle. On return, this holds a handle to the newly allocated queue. @return - `kIOReturnSuccess` if the queue was succesfully intialized. - `kIOReturnBadArgument` if the parameters passed were invalid. - `kIOReturnNoMemory` if there was a memory allocation failure.
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu iokit/IOKit/IOCircularDataQueueImplementation.h, iokit/IOKit/IOCircularDataQueue.h
Creates a circular data queue with capacity for numEntries fixed-size entries of entrySize bytes each (kernel side). Rounds each entry up to 16-byte alignment plus the per-entry header, allocates a page-aligned IOBufferMemoryDescriptor in the kernel task with kIOMemoryKernelUserShared so the region can be mapped into a user process, attaches the queue description under kIOCircularQueueDescriptionKey as the descriptor's sharing context, resets the queue state and invalidates the cursor. The counts only size the data region; being circular, the queue eventually overwrites old data rather than limiting enqueues. Supports a single producer and zero or more consumers; a lagging consumer misses data. Returns kIOReturnBadArgument for a NULL pQueue, zero counts, or uint32_t overflow of the computed sizes; kIOReturnNoMemory on allocation failure.

functionIOCircularDataQueueCopyMemoryDescriptor

IOMemoryDescriptor * IOCircularDataQueueCopyMemoryDescriptor(IOCircularDataQueue *queue)
@function IOCircularDataQueueCopyMemoryDescriptor @abstract Returns a reference to the IOMemoryDescriptor for the queue's memory. @discussion Returns a reference to the IOMemoryDescriptor for the queue's memory. @param queue Queue handle. On return, this holds a handle to the newly allocated queue. @return IOMemoryDescriptor reference
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu iokit/IOKit/IOCircularDataQueueImplementation.h, iokit/IOKit/IOCircularDataQueue.h
Returns the queue's IOBufferMemoryDescriptor with an additional retain, suitable for return from an IOUserClient clientMemoryForType override so a user process can map the queue and attach with IOCircularDataQueueCreateWithConnection. Returns NULL if the queue holds no descriptor; the caller releases the reference.

functionIOCircularDataQueueDestroy

IOReturn IOCircularDataQueueDestroy(IOCircularDataQueue **pQueue)
@function IOCircularDataQueueDestroy @abstract Function that destroys a previously created IOCircularDataQueue instance (created with IOCircularDataQueueCreateWithEntries). @param pQueue Pointer to the queue handle. @return - `kIOReturnSuccess` if the queue was succesfully destroyed. - `kIOReturnBadArgument` if an invalid queue was provided.
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu iokit/IOKit/IOCircularDataQueueImplementation.h, iokit/IOKit/IOCircularDataQueue.h
Destroys a queue created with IOCircularDataQueueCreateWithEntries (or, in user space, IOCircularDataQueueCreateWithConnection): releases or unmaps the queue memory via destroyQueueMem, frees the IOCircularDataQueue structure, and clears *pQueue. Returns kIOReturnBadArgument if pQueue is NULL; kIOReturnSuccess otherwise, including when *pQueue is already NULL.

functionIOCircularDataQueueEnqueue

IOReturn IOCircularDataQueueEnqueue(
	IOCircularDataQueue *queue,
	const void *data,
	size_t dataSize
)
@function IOCircularDataQueueEnqueue @abstract Enqueues a new entry on the queue. @discussion This method adds a new data entry of dataSize to the queue. It sets the size parameter of the entry pointed to by the write index and copies the memory pointed to by the data parameter in place in the queue. Once that is done, it moves the write index to the next index. @param queue Handle to the queue. @param data Pointer to the data to be added to the queue. @param dataSize Size of the data pointed to by data. @return - `kIOReturnSuccess` on success. - `kIOReturnBadMedia` if the queue shared memory has been compromised. - `kIOReturnBadArgument` if an invalid queue was provided. - `kIOReturnBusy` if another thread is enqueing concurrently - `kIOReturnUnsupported` if the queue has not been configured to support fixed size entries. Variable size is currently not supported - Other values indicate an error.
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu iokit/IOKit/IOCircularDataQueueImplementation.h, iokit/IOKit/IOCircularDataQueue.h
Enqueues a new entry: copies dataSize bytes into the entry at the write index, stamps the entry header with the next sequence number and current generation, then advances the write index, overwriting the oldest entry once the queue wraps. Returns kIOReturnSuccess; kIOReturnBusy if another thread is enqueuing concurrently (single writer); kIOReturnBadArgument for a NULL queue or data, zero dataSize, or dataSize larger than the configured entry size; kIOReturnBadMedia if the shared memory sentinel check fails; kIOReturnUnsupported if the queue is not configured for fixed-size entries.

functionIOCircularDataQueueGetLatest

IOReturn IOCircularDataQueueGetLatest(
	IOCircularDataQueue *queue,
	void **data,
	size_t *size
)
@function IOCircularDataQueueGetLatest Access the latest entry data, also update the cursor position to the latest. No copy is made of the data. <br> Caller is supposed to call IOCircularDataQueueIsCurrentDataValid() to check data integrity after reading the data is complete. @param queue Handle to the queue. @param data A pointer to the data memory region for the latest entry data in the queue. @param size A pointer to the size of the data parameter. On return, this contains the actual size of the data pointed to by data param. @return - `kIOReturnSuccess` if the cursor position was updated. - `kIOReturnUnderrun` if nothing has ever been enqueued into the queue - `kIOReturnBadMedia` if the queue shared memory has been compromised. - `kIOReturnBadArgument` if an invalid queue was provided. - `kIOReturnTimeout` if the reader timed out when trying to read. This is possible if the writer overwrites the latest index a reader is about to read. The function times out if the read is unsuccessful after multiple retries. - Other values indicate an error.
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu iokit/IOKit/IOCircularDataQueueImplementation.h, iokit/IOKit/IOCircularDataQueue.h
Returns a pointer to the latest entry's data in shared queue memory, without copying, and moves the cursor to that entry. Caller should call IOCircularDataQueueIsCurrentDataValid after reading, since the writer may overwrite the entry in place. Returns kIOReturnSuccess; kIOReturnUnderrun if nothing has ever been enqueued; kIOReturnTimeout if repeated retries lost races with the writer; kIOReturnBadMedia on sentinel corruption; kIOReturnBadArgument for invalid parameters.

functionIOCircularDataQueueCopyLatest

IOReturn IOCircularDataQueueCopyLatest(
	IOCircularDataQueue *queue,
	void *data,
	size_t *size
)
@function IOCircularDataQueueCopyLatest Access the latest entry data and copy into the provided buffer. Also update the cursor position to the latest. On a successful return, the function gaurantees that the latest data was successfully copied. In this case there is no need to call IOCircularDataQueueIsCurrentDataValid() after reading the data is complete, since the function returns a copy which cannot be overwritten by the writer. @param queue Handle to the queue. @param data Pointer to memory into which the latest data from the queue is copied. Lifetime of this memory is controlled by the caller. @param size Size of the data buffer provided for copying. On return, this contains the actual size of the data pointed to by data param. @return - `kIOReturnSuccess` if the cursor position was updated to latest and the data was successfully copied. - `kIOReturnUnderrun` if nothing has ever been enqueued into the queue - `kIOReturnBadArgument` if the buffer provided to copy the data is NULL or if an invalid queue was provided.. - `kIOReturnBadMedia` if the queue shared memory has been compromised. - `kIOReturnTimeout` if the reader timed out when trying to copy the latest data. This is possible if the writer overwrites the latest index a reader is about to copy. The function times out if the copy is unsuccessful after multiple retries. - Other values indicate an error.
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu iokit/IOKit/IOCircularDataQueueImplementation.h, iokit/IOKit/IOCircularDataQueue.h
Copies the latest entry's data into the caller-provided buffer and moves the cursor to that entry. size gives the buffer capacity on input and the entry's data size on return. Success guarantees a consistent copy, so IOCircularDataQueueIsCurrentDataValid is not needed. Returns kIOReturnUnderrun if nothing has ever been enqueued, kIOReturnOverrun if the buffer is too small, kIOReturnTimeout after repeated races with the writer, kIOReturnBadMedia on sentinel corruption, kIOReturnBadArgument for NULL parameters.

functionIOCircularDataQueueGetNext

IOReturn IOCircularDataQueueGetNext(IOCircularDataQueue *queue, void **data, size_t *size)
@function IOCircularDataQueueGetNext Access the data at the next cursor position and updates the cursor position to the next. No copy is made of the data. <br> Caller is supposed to call IOCircularDataQueueIsCurrentDataValid() to check data integrity after reading the data is complete. @param queue Handle to the queue. @param data A pointer to the data memory region for the next entry data in the queue. @param size A pointer to the size of the data parameter. On return, this contains the actual size of the data pointed to by data param. @return - `kIOReturnSuccess` if the cursor position was updated to the latest. - `kIOReturnAborted` if the cursor has become invalid, possibly due to a reset of the queue. - `kIOReturnUnderrun` if the cursor has reached the latest available data. - `kIOReturnOverrun` if the entry at the cursor position is no longer in the queue's buffer. Call IOCircularDataQueueGetLatest to get the latest data and cursor position. - `kIOReturnBadArgument` if an invalid argument is passsed. - `kIOReturnBadMedia` if the queue shared memory has been compromised. - Other values indicate an error.
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu iokit/IOKit/IOCircularDataQueueImplementation.h, iokit/IOKit/IOCircularDataQueue.h
Returns a pointer to the entry after the current cursor position, without copying, and advances the cursor. Caller should call IOCircularDataQueueIsCurrentDataValid after reading. Returns kIOReturnUnderrun when the cursor is already at the newest entry; kIOReturnOverrun when the reader has fallen behind and the next entry was overwritten (use IOCircularDataQueueGetLatest to resynchronize); kIOReturnAborted if the queue was reset; kIOReturnBadMedia on sentinel corruption; kIOReturnBadArgument for invalid parameters.

functionIOCircularDataQueueCopyNext

IOReturn IOCircularDataQueueCopyNext(IOCircularDataQueue *queue, void *data, size_t *size)
@function IOCircularDataQueueCopyNext Access the data at the next cursor position and copy into the provided buffer. Also update the cursor position to the next. On a successful return, the function gaurantees that the next entry data was successfully copied. In this case there is no need to call IOCircularDataQueueIsCurrentDataValid() after reading the data is complete, since the function returns a copy which cannot be overwritten by the writer. @param queue Handle to the queue. @param data Pointer to memory into which the next data from the queue is copied. Lifetime of this memory is controlled by the caller. @param size Size of the data buffer provided for copying. On return, this contains the actual size of the data pointed to by data param. @return - `kIOReturnSuccess` if the cursor position was updated to next and the data was successfully copied. - `kIOReturnAborted` if the cursor has become invalid, possibly due to a reset of the queue. - `kIOReturnUnderrun` if the cursor has reached the latest available data. - `kIOReturnOverrun` if the entry at the cursor position is no longer in the queue's buffer. Call IOCircularDataQueueCopyLatest to get the latest data and cursor position. - `kIOReturnBadArgument` if an invalid argument is passsed. - `kIOReturnBadMedia` if the queue shared memory has been compromised. - Other values indicate an error.
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu iokit/IOKit/IOCircularDataQueueImplementation.h, iokit/IOKit/IOCircularDataQueue.h
Copies the entry after the current cursor position into the caller-provided buffer and advances the cursor; success guarantees a consistent copy. size is buffer capacity on input, data size on return. Returns kIOReturnUnderrun at the newest entry, kIOReturnOverrun when the entry was overwritten or the buffer is too small (use IOCircularDataQueueCopyLatest to resynchronize), kIOReturnAborted after a queue reset, kIOReturnBadMedia on sentinel corruption, kIOReturnBadArgument for invalid parameters.

functionIOCircularDataQueueGetPrevious

IOReturn IOCircularDataQueueGetPrevious(
	IOCircularDataQueue *queue,
	void **data,
	size_t *size
)
@function IOCircularDataQueueGetPrevious Access the data at the previous cursor position and updates the cursor position to the previous. No copy is made of the data. <br> Caller is supposed to call IOCircularDataQueueIsCurrentDataValid() to check data integrity after reading the data is complete. @param queue Handle to the queue. @param data A pointer to the data memory region for the previous entry data in the queue. @param size A pointer to the size of the data parameter. On return, this contains the actual size of the data pointed to by data param. @return - `kIOReturnSuccess` if the cursor position was updated to the previous. - `kIOReturnAborted` if the cursor has become invalid, possibly due to a reset of the queue. - `kIOReturnOverrun` if the entry at the cursor position is no longer in the queue's buffer. Call IOCircularDataQueueGetLatest to get the latest data and cursor position. - `kIOReturnBadArgument` if an invalid argument is passsed. - `kIOReturnBadMedia` if the queue shared memory has been compromised. - Other values indicate an error.
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu iokit/IOKit/IOCircularDataQueueImplementation.h, iokit/IOKit/IOCircularDataQueue.h
Returns a pointer to the entry before the current cursor position, without copying, and moves the cursor back. Caller should call IOCircularDataQueueIsCurrentDataValid after reading. Returns kIOReturnOverrun when the previous entry is no longer in the queue's buffer (overwritten by newer data; use IOCircularDataQueueGetLatest to resynchronize); kIOReturnAborted if the cursor became invalid, e.g. after a queue reset; kIOReturnBadMedia on sentinel corruption; kIOReturnBadArgument for invalid parameters.

functionIOCircularDataQueueCopyPrevious

IOReturn IOCircularDataQueueCopyPrevious(
	IOCircularDataQueue *queue,
	void *data,
	size_t *size
)
@function IOCircularDataQueueCopyPrevious Access the data at the previous cursor position and copy into the provided buffer. Also update the cursor position to the previous. On a successful return, the function gaurantees that the previous entry data was successfully copied. In this case there is no need to call IOCircularDataQueueIsCurrentDataValid() after reading the data is complete, since the function returns a copy which cannot be overwritten by the writer. @param queue Handle to the queue. @param data Pointer to memory into which the previous data is copied. Lifetime of this memory is controlled by the caller. @param size Size of the data buffer provided for copying. On return, this contains the actual size of the data pointed to by data param. @return - `kIOReturnSuccess` if the cursor position was updated to the previous and the data was successfully copied. - `kIOReturnAborted` if the cursor has become invalid, possibly due to a reset of the queue. - `kIOReturnOverrun` if the entry at the cursor position is no longer in the queue's buffer. Call IOCircularDataQueueCopyLatest to get the latest data and cursor position. - `kIOReturnBadArgument` if an invalid argument is passsed. - `kIOReturnBadMedia` if the queue shared memory has been compromised. - Other values indicate an error.
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu iokit/IOKit/IOCircularDataQueueImplementation.h, iokit/IOKit/IOCircularDataQueue.h
Copies the entry before the current cursor position into the caller-provided buffer and moves the cursor back; success guarantees a consistent copy. size is buffer capacity on input, data size on return. Returns kIOReturnOverrun when the entry was overwritten or the buffer is too small (use IOCircularDataQueueCopyLatest to resynchronize), kIOReturnAborted if the cursor became invalid, kIOReturnBadMedia on sentinel corruption, kIOReturnBadArgument for invalid parameters.

functionIOCircularDataQueueIsCurrentDataValid

IOReturn IOCircularDataQueueIsCurrentDataValid(IOCircularDataQueue *queue)
@function IOCircularDataQueueIsCurrentDataValid Verify if the data at the current cursor position is the same as the data when the cursor was first updated to this position. Call this function after having read the data at the current cursor position from the queue, since the queue entry could potentially have been overwritten by the writer while being read by the caller. <br> @param queue Handle to the queue. @return - `kIOReturnSuccess` if the data at the cursor position is unchanged. - `kIOReturnOverrun` if the entry at the cursor position is no longer the same and is potentially overwritten. Call IOCircularDataQueueGetLatest to get the latest data and cursor position. - `kIOReturnAborted` if the cursor has become invalid, possibly due to a reset of the queue. - `kIOReturnBadArgument` if an invalid param was passed. - `kIOReturnBadMedia` if the queueMemory is corrupted. - Other values indicate an error.
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu iokit/IOKit/IOCircularDataQueueImplementation.h, iokit/IOKit/IOCircularDataQueue.h
Verifies that the entry at the current cursor position still holds the same data as when the cursor was set. Call after reading data in place via the Get variants, since the writer may overwrite an entry while it is being read. Returns kIOReturnSuccess if unchanged; kIOReturnOverrun if the entry was potentially overwritten (use IOCircularDataQueueGetLatest to resynchronize); kIOReturnAborted if the cursor became invalid, e.g. after a queue reset; kIOReturnBadMedia if the queue memory is corrupted; kIOReturnBadArgument for invalid parameters.

functionIOCircularDataQueueSetCursorLatest

IOReturn IOCircularDataQueueSetCursorLatest(IOCircularDataQueue *queue)
@function IOCircularDataQueueSetCursorLatest Set the current cursor position to the latest entry in the queue. This only updates the cursor and does not read the data from the queue. If nothing has been enqueued into the queue yet, this returns an error. @param queue Handle to the queue. @return - `kIOReturnSuccess` if the cursor position was updated to the latest. - `kIOReturnUnderrun` if nothing has ever been enqueued into the queue since there is no latest entry. - `kIOReturnAborted` if the queue is in an irrecoverable state. - `kIOReturnBadArgument` if an invalid argument is passsed. - `kIOReturnBadMedia` if the queue shared memory has been compromised. - Other values indicate an error.
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu iokit/IOKit/IOCircularDataQueueImplementation.h, iokit/IOKit/IOCircularDataQueue.h
Sets the cursor to the latest entry in the queue without reading data. Returns kIOReturnUnderrun if nothing has ever been enqueued, kIOReturnAborted if the queue is in an irrecoverable state, kIOReturnBadMedia on sentinel corruption, kIOReturnBadArgument for invalid parameters.

functionIOCircularDataQueueGetCurrent

IOReturn IOCircularDataQueueGetCurrent(
	IOCircularDataQueue *queue,
	void **data,
	size_t *size
)
@function IOCircularDataQueueGetCurrent Access the data at the current cursor position. The cursor position is unchanged. No copy is made of the data. <br> Caller is supposed to call IOCircularDataQueueIsCurrentDataValid() to check data integrity after reading the data is complete. @param queue Handle to the queue. @param data A pointer to the data memory region for the next entry data in the queue. @param size A pointer to the size of the data parameter. On return, this contains the actual size of the data pointed to by data param. @return - `kIOReturnSuccess` if the cursor position was updated. - `kIOReturnAborted` if the cursor has become invalid, possibly due to a reset of the queue. - `kIOReturnUnderrun` if nothing has ever been enqueued into the queue hence there is no entry at the current position.. - `kIOReturnOverrun` if the entry at the current cursor position is no longer in the queue's buffer. Call IOCircularDataQueueGetLatest to get the latest data and cursor position. - `kIOReturnBadArgument` if an invalid argument is passsed. - `kIOReturnBadMedia` if the queue shared memory has been compromised. - Other values indicate an error.
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu iokit/IOKit/IOCircularDataQueueImplementation.h, iokit/IOKit/IOCircularDataQueue.h
Returns a pointer to the entry at the current cursor position without copying; the cursor is unchanged. Caller should call IOCircularDataQueueIsCurrentDataValid after reading. Returns kIOReturnUnderrun if nothing has ever been enqueued; kIOReturnOverrun if the entry at the cursor was overwritten (use IOCircularDataQueueGetLatest to resynchronize); kIOReturnAborted if the cursor became invalid, e.g. after a queue reset; kIOReturnBadMedia on sentinel corruption; kIOReturnBadArgument for invalid parameters.

functionIOCircularDataQueueCopyCurrent

IOReturn IOCircularDataQueueCopyCurrent(
	IOCircularDataQueue *queue,
	void *data,
	size_t *size
)
@function IOCircularDataQueueCopyCurrent Access the data at the current cursor position and copy into the provided buffer. The cursor position is unchanged. If successful, function gaurantees that the data returned is always valid, hence no need to call IOCircularDataQueueIsCurrentDataValid(). @param queue Handle to the queue. @param data Pointer to memory into which the previous data is copied. Lifetime of this memory is controlled by the caller. @param size Size of the data buffer provided for copying. On return, this contains the actual size of the data pointed to by data param. @return - `kIOReturnSuccess` if the cursor position was updated. - `kIOReturnAborted` if the cursor has become invalid, possibly due to a reset of the queue. - `kIOReturnUnderrun` if nothing has ever been enqueued into the queue hence there is no entry at the current position.. - `kIOReturnOverrun` if the entry at the current cursor position is no longer in the queue's buffer. Call IOCircularDataQueueCopyLatest to get the latest data and cursor position. - `kIOReturnBadArgument` if an invalid argument is passsed. - `kIOReturnBadMedia` if the queue shared memory has been compromised. - Other values indicate an error.
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu iokit/IOKit/IOCircularDataQueueImplementation.h, iokit/IOKit/IOCircularDataQueue.h
Copies the entry at the current cursor position into the caller-provided buffer; the cursor is unchanged and success guarantees a consistent copy. size is buffer capacity on input, data size on return. Returns kIOReturnUnderrun if nothing has ever been enqueued, kIOReturnOverrun if the entry was overwritten or the buffer is too small, kIOReturnAborted if the cursor became invalid, kIOReturnBadMedia on sentinel corruption, kIOReturnBadArgument for invalid parameters.

functionIOCircularDataQueueGetLatestWithBlock

IOReturn IOCircularDataQueueGetLatestWithBlock(
	IOCircularDataQueue * queue,
	void (^handler)(const void *data, size_t size)
)
@function IOCircularDataQueueGetLatestWithBlock Access the latest entry data, also update the cursor position to the latest. Calls the provided block with the data at the cursor position. No copy is made of the data. <br> Optionally the caller can call IOCircularDataQueueIsCurrentDataValid() to check data integrity after reading the data is complete in the block. Additionally the function also returns an error if the data has been overwritten after the block completion @param queue Handle to the queue. @param handler Block to call -param data Pointer to the latest data in the queue that the block is called with. -param size Size of the data pointed to by data that the block is called with. @return - `kIOReturnSuccess` if the cursor position was updated to the latest. - `kIOReturnUnderrun` if nothing has ever been enqueued into the queue - `kIOReturnBadMedia` if the queue shared memory has been compromised. - `kIOReturnBadArgument` if an invalid queue was provided. - `kIOReturnAborted` if the queue was reset. - Other values indicate an error.

functionIOCircularDataQueueGetNextWithBlock

IOReturn IOCircularDataQueueGetNextWithBlock(
	IOCircularDataQueue * queue,
	void (^handler)(const void *data, size_t size)
)
@function IOCircularDataQueueGetNextWithBlock Access the data at the next cursor position and updates the cursor position to the next. Calls the provided block with the data at the cursor position. No copy is made of the data. <br> Optionally the caller can call IOCircularDataQueueIsCurrentDataValid() to check data integrity after reading the data is complete in the block. Additionally the function also returns an error if the data has been overwritten after the block completion. @param queue Handle to the queue. @param handler Block to call -param data A pointer to the data memory region for the next entry data in the queue that the block is called with. -param size Size of the data pointed to by data that the block is called with. @return - `kIOReturnSuccess` if the cursor position was updated to next. - `kIOReturnAborted` if the cursor has become invalid, possibly due to a reset of the queue. - `kIOReturnUnderrun` if the cursor has reached the latest available data. - `kIOReturnOverrun` if the entry at the cursor position is no longer in the queue's buffer. Call IOCircularDataQueueGetLatest to get the latest data and cursor position. - `kIOReturnBadArgument` if an invalid argument is passsed. - `kIOReturnBadMedia` if the queue shared memory has been compromised. - Other values indicate an error.

functionIOCircularDataQueueGetPreviousWithBlock

IOReturn IOCircularDataQueueGetPreviousWithBlock(
	IOCircularDataQueue * queue,
	void (^handler)(const void *data, size_t size)
)
@function IOCircularDataQueueGetPreviousWithBlock Access the data at the previous cursor position and updates the cursor position to the previous. Calls the provided block with the data at the cursor position. No copy is made of the data. <br> Optionally the caller can call IOCircularDataQueueIsCurrentDataValid() to check data integrity after reading the data is complete in the block. Additionally the function also returns an error if the data has been overwritten after the block completion. @param queue Handle to the queue. @param handler Block to call -param data A pointer to the data memory region for the previous entry data in the queue that the block is called with. -param size Size of the data pointed to by data that the block is called with. @return - `kIOReturnSuccess` if the cursor position was updated to previous. - `kIOReturnAborted` if the cursor has become invalid, possibly due to a reset of the queue. - `kIOReturnUnderrun` if the entry at the cursor position is no longer in the queue's buffer. Call IOCircularDataQueueGetLatest to get the latest data and cursor position. - `kIOReturnBadArgument` if an invalid argument is passsed. - `kIOReturnBadMedia` if the queue shared memory has been compromised. - Other values indicate an error.