---
title: dispatch_source_get_handle
framework: dispatch
role: symbol
role_heading: Function
path: dispatch/dispatch_source_get_handle
---

# dispatch_source_get_handle

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

## Declaration

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

## Parameters

- `source`: This parameter cannot be NULL.

## Return Value

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:  mach port (mach_port_t) DISPATCH_SOURCE_TYPE_MACH_RECV:  mach port (mach_port_t) DISPATCH_SOURCE_TYPE_PROC: process identifier (pid_t) DISPATCH_SOURCE_TYPE_READ: file descriptor (int) DISPATCH_SOURCE_TYPE_SIGNAL: signal number (int) 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.

## See Also

### Getting Dispatch Source Attributes

- [dispatch_source_get_data](dispatch/dispatch_source_get_data.md)
- [dispatch_source_get_mask](dispatch/dispatch_source_get_mask.md)
- [dispatch_source_merge_data](dispatch/dispatch_source_merge_data.md)
- [dispatch_source_proc_flags_t](dispatch/dispatch_source_proc_flags_t.md)
- [dispatch_source_vnode_flags_t](dispatch/dispatch_source_vnode_flags_t.md)
- [dispatch_source_mach_recv_flags_t](dispatch/dispatch_source_mach_recv_flags_t.md)
- [dispatch_source_mach_send_flags_t](dispatch/dispatch_source_mach_send_flags_t.md)
- [dispatch_source_memorypressure_flags_t](dispatch/dispatch_source_memorypressure_flags_t.md)
