23 lines
509 B
C
23 lines
509 B
C
#include <sys/ioctl.h>
|
|
#include <linux/fs.h>
|
|
#include <errno.h>
|
|
|
|
int fideduperange_errno_value = 0;
|
|
|
|
int fideduperange( int src_fd, struct file_dedupe_range *arg) {
|
|
fideduperange_errno_value = 0;
|
|
int r = ioctl( src_fd, FIDEDUPERANGE, arg);
|
|
fideduperange_errno_value = errno;
|
|
return r;
|
|
}
|
|
|
|
int fideduperange_errno() {
|
|
return fideduperange_errno_value;
|
|
}
|
|
|
|
void fideduperange_consts( int config[3]) {
|
|
config[0] = FIDEDUPERANGE;
|
|
config[1] = FILE_DEDUPE_RANGE_SAME;
|
|
config[2] = FILE_DEDUPE_RANGE_DIFFERS;
|
|
}
|