Function

dispatch_io_get_descriptor

Returns the file descriptor associated with the specified channel.

Declaration

dispatch_fd_t dispatch_io_get_descriptor(dispatch_io_t channel);

Parameters

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.

Discussion

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

dispatch_io_set_interval

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

dispatch_io_interval_flags_t

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

dispatch_io_set_low_water

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

dispatch_io_set_high_water

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