I recently switched from using kqueue to GCD dispatch sources to monitor file changes. This has worked out well and resulted in a much simpler API. I documented my switch here.
You may change *dispatch_source_get_mask(source)* to *dispatch_source_get_data(source)*, as dispatch_source_get_mask(source) returns all the flags you passed in the creation of the handler instead of the event generated.