Skip to content

Fix fallocate on Apple platforms. - #1708

Merged
sunfishcode merged 1 commit into
mainfrom
sunfishcode/fallocate-macos
Oct 26, 2026
Merged

sunfishcode merged 1 commit into
mainfrom
sunfishcode/fallocate-macos

Conversation

@sunfishcode

@sunfishcode sunfishcode commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Fix fallocate on Apple platforms.

Always use F_ALLOCATEALL on Apple platforms to avoid partial success.

Also, don't bother trying F_ALLOCATECONTIG, as that's not necessary to fulfill the fallocate contract.

And, document fallocate's behavior on Apple platforms, which lack posix_fallocate. Rustix in general doesn't like to be in the business of trying to provide portability abstractions like this, but it's awkward to change this particular function at this point.

Fixes #1682.

@sunfishcode
sunfishcode force-pushed the sunfishcode/fallocate-macos branch 2 times, most recently from 0e687fe to 1892bf6 Compare October 15, 2026 20:05
Always use `F_ALLOCATEALL` on Apple platforms to avoid partial success.

Also, don't bother trying `F_ALLOCATECONTIG`, as that's not necessary
to fulfill the `fallocate` contract.

And, document `fallocate`'s behavior on Apple platforms, which lack
`posix_fallocate`. Rustix in general doesn't like to be in the business
of trying to provide portability abstractions like this, but it's
awkward to change this particular function at this point.
@sunfishcode
sunfishcode force-pushed the sunfishcode/fallocate-macos branch from 1892bf6 to 5d59062 Compare October 15, 2026 20:20
@sunfishcode
sunfishcode marked this pull request as ready for review October 15, 2026 20:31
@sunfishcode
sunfishcode merged commit b3d81bd into main Oct 26, 2026
51 checks passed
@sunfishcode
sunfishcode deleted the sunfishcode/fallocate-macos branch October 26, 2026 23:52
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

Successfully merging this pull request may close these issues.

Apple fallocate can return Ok after only a partial F_PREALLOCATE allocation

1 participant