Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SEEK_HOLE/DATA problem #1

Open
miluchen opened this issue Mar 29, 2020 · 3 comments
Open

SEEK_HOLE/DATA problem #1

miluchen opened this issue Mar 29, 2020 · 3 comments

Comments

@miluchen
Copy link

marker = lseek(source, curr, SEEK_HOLE);

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.

@banool
Copy link
Owner

banool commented Apr 11, 2023

I realized I'm coming here 3 years late hahaha but I don't suppose you ever figured this out?

@miluchen
Copy link
Author

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 🤔

@banool
Copy link
Owner

banool commented Apr 11, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants