I'm emulating a certain functionality of kqueue to handle events in my Centos box (I'm porting some code from FreeBSD), but I'm failing to understand the purpose of void *udata
in struct kevent
:
struct kevent {
uintptr_t ident; /* identifier for this event */
short filter; /* filter for event */
u_short flags; /* action flags for kqueue */
u_int fflags; /* filter flag value */
intptr_t data; /* filter data value */
void *udata; /* opaque user data identifier */
};
I've tried searching, but the longest form of literature I could find about this field is "Opaque user-defined value passed through the kernel unchanged." Which is not helping much.
Can anyone please explain to me clearly what this field is? And what someone could use it for?