[Toybox] Reading/copying sparse files.

Rob Landley rob at landley.net
Tue Aug 9 18:10:54 PDT 2016


Judgement call: lseek(SEEK_HOLE) was added in commit 982d816581ee in
2011, which was in the run-up to the linux-3.0 release. So any 3.x
kernel should have it, but 2.x kernels wouldn't.

That's 5 years ago and my rule of thumb for expecting something to be
ubiquitous is 7 years, but this is a useful feature I'd like to
implement and don't really want a compile-time probe to config it out.
(Nor do I want to use the older FIEMAP if I don't have to, which
presumably won't work on network filesystems anyway.)

I could also just say that any >4k run of zeroes counts as sparse,
although that's probably more CPU intensive to implement...

Rob


More information about the Toybox mailing list