Skip to content

Instantly share code, notes, and snippets.

@DanielG
Created January 11, 2015 23:39
Show Gist options
  • Save DanielG/b8e9e314af08c2abb1f9 to your computer and use it in GitHub Desktop.
Save DanielG/b8e9e314af08c2abb1f9 to your computer and use it in GitHub Desktop.
uml-dir-fsync-bug
#include <sys/types.h>
#include <dirent.h>
#include <stdio.h>
#include <stdlib.h>
int main()
{
DIR* d = opendir("/");
int fd = dirfd(d);
if(fd < 0)
exit(1);
int rv = fsync(fd);
if(rv != 0) {
perror("fsync");
exit(1);
}
printf("OK");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment