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

Fallback on posix_fallocate if fallocate fail #28

Open
Celelibi opened this issue Mar 12, 2022 · 2 comments
Open

Fallback on posix_fallocate if fallocate fail #28

Celelibi opened this issue Mar 12, 2022 · 2 comments

Comments

@Celelibi
Copy link

Not every FS support the fallocate system call. Falling back to posix_fallocate would allow more compatibility at the expense of some performance penalty. But I think it's worth it. Maybe with a one-time warning?

@unbrice
Copy link
Owner

unbrice commented Mar 12, 2022

Which OS do you have in mind? On GNU/Linux, posix_fallocate is implemented using fallocate (see posix_fallocate.c), so that wouldn't increase compatiblity.

@Celelibi
Copy link
Author

In the glibc posix_fallocate is implemented using the fallocate syscall first. But falls back onto an emulated implentation if the syscall fail with EOPNOTSUPP. This implementation should work on almost every file system.

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