SEEK_HOLE/DATA problem
https://github.com/banool/apue-exercises/blob/2ecce52040fdef5a27f42d51b1dcceca33416d70/code/04.06.c#L23
Not sure whether it works on other systems, but...
I am using ubuntu 18.04. lseek(fd, offset, SEEK_HOLE/SEEK_DATA) seems to change the file offset to the offset of the block that contains the hole or data.
For example, suppose I have a file containing "abc" followed by a hole with length 16*1024 bytes. If the file block size if 4096, lseek(fd, 0, SEEK_HOLE) would return 4096 instead of 3.
I realized I'm coming here 3 years late hahaha but I don't suppose you ever figured this out?
I realized I'm coming here 3 years late hahaha but I don't suppose you ever figured this out?
I need to refresh my memory, but it's very likely I didn't figure this out, otherwise, I would have closed the ticket 🤔
Okay cool, if I get time I can take a look into it. I probably won't though, so we can check back in in a few years hahahah.