---
title: IODataQueueAllocateNotificationPort()
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/1514495-iodataqueueallocatenotificationp
---

# IODataQueueAllocateNotificationPort()

Allocates and returns a new mach port able to receive data available notifications from an IODataQueue.

## Declaration

```swift
func IODataQueueAllocateNotificationPort() -> mach_port_t
```

## Return Value

Return Value Returns a newly allocated mach port on success. On failure, it returns MACH_PORT_NULL.

## Discussion

Discussion This port is intended to be passed down into the kernel and into an IODataQueue to allow it to send the appropriate notification. The returned mach port is allocated with a queue limit of one message. This allows only one mach message to be queued up at a time. The IODataQueue code is written with the restriction in mind and will only queue up a message if no messages alread have been sent.

## See Also

### Miscellaneous

- [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)
- [IODataQueueWaitForAvailableData(_:_:)](iokit/1514696-iodataqueuewaitforavailabledata.md)
