I want to understand iosnoop. Therefor I wrote a small program to trace on. I expect to see something in iosnoop if I flush the cache. I don't see anything until I kill the application. What am I doing wrong.
#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#include <sys/types.h>
int main(){
pid_t pid = getpid();
printf("pid: %lun", pid);
FILE *file = fopen("hanswurst.txt", "a");
while(1){
fputs("Hello\n", file);
fflush(file);
sleep(1);
}
fclose(file);
return 0;
}