<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.6.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Dispatch",
  "identifier" : "/documentation/Dispatch/dispatch_source_get_handle",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Dispatch"
    ],
    "preciseIdentifier" : "c:@F@dispatch_source_get_handle"
  },
  "title" : "dispatch_source_get_handle"
}
-->

# dispatch_source_get_handle

Returns the underlying system handle associated with the specified dispatch source.

```
extern uintptr_t dispatch_source_get_handle(dispatch_source_t source);
```

## Parameters

`source`

This parameter cannot be NULL.

## Discussion

### Return Value

The return value should be interpreted according to the type of the dispatch source, and can be one of the following:

- [`DISPATCH_SOURCE_TYPE_MACH_SEND`](/documentation/Dispatch/DISPATCH_SOURCE_TYPE_MACH_SEND):  mach port (`mach_port_t`)
- [`DISPATCH_SOURCE_TYPE_MACH_RECV`](/documentation/Dispatch/DISPATCH_SOURCE_TYPE_MACH_RECV):  mach port (`mach_port_t`)
- [`DISPATCH_SOURCE_TYPE_PROC`](/documentation/Dispatch/DISPATCH_SOURCE_TYPE_PROC): process identifier (`pid_t`)
- [`DISPATCH_SOURCE_TYPE_READ`](/documentation/Dispatch/DISPATCH_SOURCE_TYPE_READ): file descriptor (`int`)
- [`DISPATCH_SOURCE_TYPE_SIGNAL`](/documentation/Dispatch/DISPATCH_SOURCE_TYPE_SIGNAL): signal number (`int`)
- [`DISPATCH_SOURCE_TYPE_VNODE`](/documentation/Dispatch/DISPATCH_SOURCE_TYPE_VNODE): file descriptor (`int`)
- `Dispatch Source Memory Pressure Event Flags`: file descriptor (`int`)

## Discussion

The handle returned is a reference to the underlying system object being monitored by the dispatch source.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)