Created
January 11, 2015 23:39
-
-
Save DanielG/b8e9e314af08c2abb1f9 to your computer and use it in GitHub Desktop.
uml-dir-fsync-bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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