Created
July 22, 2016 03:28
-
-
Save glennklockwood/3dd935b004c311587697af58db84d66d to your computer and use it in GitHub Desktop.
Drop a file from page cache
This file contains hidden or 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
#define _XOPEN_SOURCE 600 | |
#include <unistd.h> | |
#include <fcntl.h> | |
int main(int argc, char *argv[]) { | |
int fd; | |
fd = open(argv[1], O_RDONLY); | |
fdatasync(fd); | |
posix_fadvise(fd, 0,0,POSIX_FADV_DONTNEED); | |
close(fd); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment