Fixed crash on Linux when writing a Jay file and the disk is low on space #1838
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Apparently we need to call
posix_fallocate
to ensure that writes to mem-mapped file will succeed. This function is available on Linux, but not on MacOS.On MacOS the equivalent can be achieved with
fcntl
commandF_PREALLOCATE
(see https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/fcntl.2.html).Not adding any tests, because on Linux creating and mounting a size-restricted file system requires root privileges, and on MacOS even that is not possible. Testing can be done manually as described in the issue.
Closes #1837