---
title: "IODataQueueSetNotificationPort(_:_:)"
framework: IOKit
role: symbol
role_heading: Function
platforms: [iOS 4.0+, iPadOS 4.0+, Mac Catalyst 13.1+, macOS 10.5+, visionOS 1.0+]
path: iokit/1514301-iodataqueuesetnotificationport
---

# IODataQueueSetNotificationPort(_:_:)

Creates a simple mach message targeting the mach port specified in port.

## Declaration

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

## Parameters

- `dataQueue`: The IODataQueueMemory region mapped from the kernel created from an IOSharedDataQueue.
- `notifyPort`: The mach port to target with the notification message.

## Return Value

Return Value Returns kIOReturnSuccess on success. Returns kIOReturnBadArgument if either dataQueue is 0 (NULL).

## Discussion

Discussion This message is sent when data is added to an empty queue. It is to notify another user process that new data has become available. Please note that using this method without mapped memory create from an IOSharedDataQueue will result in undefined behavior.

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