Returns the file descriptor associated with the specified channel.


dispatch_fd_t dispatch_io_get_descriptor(dispatch_io_t channel);



The channel whose file descriptor you want to retrieve.

Return Value

The file descriptor associated with the channel or -1 if the file descriptor is closed or not yet open.


If the path name associated with the channel has not yet been opened, calling this function does not normally open the corresponding file, with one exception. If you call the function from a barrier block scheduled on the channel, the function does open the file and return the resulting file descriptor.

See Also

Managing the File Descriptor


Sets the interval (in nanoseconds) at which to invoke the I/O handlers for the channel.


The type for flags used to specify the dispatch interval of a channel.


Sets the minimum number of bytes to process before enqueueing a handler block.


Sets the maximum number of bytes to process before enqueueing a handler block.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software