Getting data from a dispatch source

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.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值