您的位置:首页 > 其它

Getting data from a dispatch source

2014-08-29 16:18 489 查看
Function

Description

dispatch_source_-get_handle

This function returns the underlying system data type that the dispatch sourcemanages.

For a descriptor dispatch source, this function returns an
int
type containingthe descriptor associated with the dispatch source.

For a signal dispatch source, this function returns an
int
type containing thesignal number for the most recent event.

For a process dispatch source, this function returns a
pid_t
data structurefor the process being monitored.

For a Mach port dispatch source, this function returns a
mach_port_t
datastructure.

For other dispatch sources, the value returned by this function is undefined.

dispatch_source_-get_data

This function returns any pending data associated with the event.

For a descriptor dispatch source that reads data from a file, this functionreturns the number of bytes available for reading.

For a descriptor dispatch source that writes data to a file, this function returnsa positive integer if space is available for writing.

For a descriptor dispatch source that monitors file system activity, this functionreturns a constant indicating the type of event that occurred. For a list ofconstants, see the
dispatch_source_vnode_flags_t
enumerated type.

For a process dispatch source, this function returns a constant indicating thetype of event that occurred. For a list of constants, see thedispatch_source_proc_flags_t
enumerated type.

For a Mach port dispatch source, this function returns a constant indicatingthe type of event that occurred. For a list of constants, see thedispatch_source_machport_flags_t
enumerated type.

For a custom dispatch source, this function returns the new data value createdfrom the existing data and the new data passed to thedispatch_source_merge_data
function.

dispatch_source_-get_mask

This function returns the event flags that were used to create the dispatchsource.

For a process dispatch source, this function returns a mask of the events thatthe dispatch source receives. For a list of constants, see thedispatch_source_proc_flags_t
enumerated type.

For a Mach port dispatch source with send rights, this function returns a maskof the desired events. For a list of constants, see the
dispatch_source_-mach_send_flags_t
enumerated type.

For a custom OR dispatch source, this function returns the mask used to mergethe data values.

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐