The inotify API: reading events
After events have occurred, each read() returns a buffer.
struct inotify_event {
int wd; /* Watch descriptor */
uint32_t mask; /* Mask describing event */
uint32_t cookie; /* Unique cookie associating related events (for rename()) */
uint32_t len; /* Size of name field */
char name[]; /* Optional null-terminated name */
};
Source Code: inotify/demo_inotify.c
from TLPI.