Closed yurivict closed 1 year ago
So this is used to detect holes. It makes copying images more efficient and is used to create Android sparse images. If you can life without these the easy solution is to just assume there are no holes. We already do that if the runtime detection fails.
Is there a compile-time option to disable these?
I think #204 should fix this. Can you try? I don't have any BSD to test this so I can only fake it a bit.
Thanks for fixing it.
Now it breaks like this:
util.c:475:7: warning: implicit declaration of function 'fallocate' is invalid in C99 [-Wimplicit-function-declaration]
if (fallocate(fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
^
util.c:475:21: error: use of undeclared identifier 'FALLOC_FL_PUNCH_HOLE'
if (fallocate(fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
^
util.c:475:44: error: use of undeclared identifier 'FALLOC_FL_KEEP_SIZE'
if (fallocate(fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
fallocate
is Linux-only. Can this be done with posix_fallocate
?
So posix_fallocate
does not have the same semantics. I've created #208 that just skips fallocate
and uses the existing fallback path. Can you test this?
... due to use of linux-specific headers:
Please consider porting to BSD.