#include int main() { int res; #if defined(HAVE_FDATASYNC) printf("fdatasync \n"); res= fdatasync(fd); #elif defined(HAVE_FSYNC) printf("fsync \n"); res= fsync(fd); #else printf("error \n"); res= 0; /* No sync (strange OS) */ #endif return 0; }