Events

You interact with kqueues using kevents, which describe which entities and filters you are interested in. struct kevent works on all Mac OS X systems starting with 10.3:

s​t​r​u​c​t​ ​k​e​v​e​n​t​ ​{​ ​ ​ ​ ​u​i​n​t​p​t​r​_​t​ ​ ​ ​ ​ ​i​d​e​n​t​;​ ​ ​ ​ ​ ​ ​ ​/​*​ ​i​d​e​n​t​i​f​i​e​r​ ​f​o​r​ ​t​h​i​s​ ​e​v​e​n​t​ ​*​/​ ​ ​ ​ ​i​n​t​1​6​_​t​ ​ ​ ​ ​ ​ ​ ​f​i​l​t​e​r​;​ ​ ​ ​ ​ ​ ​/​*​ ​f​i​l​t​e​r​ ​f​o​r​ ​e​v​e​n​t​ ​*​/​ ​ ​ ​ ​u​i​n​t​1​6​_​t​ ​ ​ ​ ​ ​ ​f​l​a​g​s​;​ ​ ​ ​ ​ ​ ​ ​/​*​ ​g​e​n​e​r​a​l​ ​f​l​a​g​s​ ​*​/​ ​ ​ ​ ​u​i​n​t​3​2​_​t​ ​ ​ ​ ​ ​ ​f​f​l​a​g​s​;​ ​ ​ ​ ​ ​ ​/​*​ ​f​i​l​t​e​r​-​s​p​e​c​i​f​i​c​ ​f​l​a​g​s​ ​*​/​ ​ ​ ​ ​i​n​t​p​t​r​_​t​ ​ ​ ​ ​ ​ ​d​a​t​a​;​ ​ ​ ​ ​ ​ ​ ​ ​/​*​ ​f​i​l​t​e​r​-​s​p​e​c​i​f​i​c​ ...

Get Advanced Mac OS X Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.