Created
July 27, 2016 21:30
-
-
Save kiryl/2b344b51da1fd2725be420a996b10d22 to your computer and use it in GitHub Desktop.
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 _GNU_SOURCE | |
#include <fcntl.h> | |
#include <limits.h> | |
#include <sys/ioctl.h> | |
#include <sys/stat.h> | |
#include <sys/types.h> | |
#include <linux/fs.h> | |
int main(int argc, char **argv) | |
{ | |
struct file_dedupe_range file_dedupe_range = { | |
.dest_count = USHRT_MAX, | |
}; | |
int fd; | |
fd = open("/tmp/", O_TMPFILE | O_RDWR, S_IRUSR | S_IWUSR); | |
ioctl(fd, FIDEDUPERANGE, &file_dedupe_range); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment