compat.c - dedup - deduplicating backup program
HTML git clone git://bitreich.org/dedup/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/dedup/
DIR Log
DIR Files
DIR Refs
DIR Tags
DIR README
DIR LICENSE
---
compat.c (334B)
---
1 #ifdef __linux__
2 #define _GNU_SOURCE
3 #include <fcntl.h>
4
5 int
6 punchhole(int fd, off_t offset, off_t len)
7 {
8 int mode;
9
10 mode = FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE;
11 return fallocate(fd, mode, offset, len);
12 }
13 #else
14 #include <sys/types.h>
15 #include <unistd.h>
16
17 int
18 punchhole(int fd, off_t offset, off_t len)
19 {
20 return -1;
21 }
22 #endif