---
title: "CFFileDescriptorCreateRunLoopSource(_:_:_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cffiledescriptorcreaterunloopsource(_:_:_:)"
---

# CFFileDescriptorCreateRunLoopSource(_:_:_:)

Creates a new runloop source for a given CFFileDescriptor.

## Declaration

```swift
func CFFileDescriptorCreateRunLoopSource(_ allocator: CFAllocator!, _ f: CFFileDescriptor!, _ order: CFIndex) -> CFRunLoopSource!
```

## Parameters

- `allocator`: The allocator to use to allocate memory for the new bag and its storage for values. Pass NULL or kCFAllocatorDefault to use the current default allocator.
- `f`: A CFFileDescriptor.
- `order`: The order for the new run loop (see doc://com.apple.corefoundation/documentation/CoreFoundation/CFRunLoopSourceCreate(_:_:_:)).

## Return Value

Return Value A new runloop source for f, or NULL if there was a problem creating the object. Ownership follows the The Create Rule.

## Discussion

Discussion The context for the new runloop (see CFRunLoopSourceCreate(_:_:_:)) is the same as the context passed in when the CFFileDescriptor was created (see CFFileDescriptorCreate(_:_:_:_:_:)).
