Your
continue
instruction causes the most recent loop to execute another iteration; it doesn't have any effect on the outer loop.
So if your
if
condition is ever true, your loop will never execute the call to FAN_EVENT_NEXT and so the chances are it will process the same data over and over again.
At a guess, you want to remove the
continue
and add an
else
clause - but since we can't run your code we can't tell.
As for the problem the debugger is showing you, the most likely reason is that the buffer never gets filled -and since I doubt that your
fanotify_event_metadata
struct is 4096 bytes wide it's probably waiting for that much data before continuing:
read[
^]