<!--
{
  "availability" : [
    "iOS: 5.0.0 -",
    "iPadOS: 5.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.7.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "XPC",
  "identifier" : "/documentation/XPC/xpc_dictionary_dup_fd(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "XPC"
    ],
    "preciseIdentifier" : "c:@F@xpc_dictionary_dup_fd"
  },
  "title" : "xpc_dictionary_dup_fd(_:_:)"
}
-->

# xpc_dictionary_dup_fd(_:_:)

Creates a file descriptor from a dictionary directly.

```
func xpc_dictionary_dup_fd(_ xdict: xpc_object_t, _ key: UnsafePointer<CChar>) -> Int32
```

## Parameters

`xdict`

The dictionary object which is to be examined.

`key`

The key whose value is to be obtained.

## Return Value

A new file descriptor created from the value for the specified key. You are responsible for closing this descriptor. -1 if the value for the specified key is not a file descriptor value or if there is no value for the specified key.

## Discussion

---

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)