This repository was archived by the owner on Jun 28, 2022. It is now read-only.
changes for large file support on 32 bit systems#9
Open
xloem wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
fixes #3
I've tested this only with https://github.com/xloem/streamtar, which doesn't use the whole api. streamtar is working fine on 32-bit and 64-bit platforms with this change, when _FILE_OFFSET_BITS=64 is set.
Explanation:
When large file support is enabled, autoconf sets the _FILE_OFFSET_BITS=64 preprocessor define. Posix-conforming systems will then make off_t 64 bits instead of 32 bits, and reference 64 bit file access functions instead of 32 bit file access functions. This mostly matters for the
statstruct, which is in both the header file and the source file, where the define could differ. The posix defines I check at the top of the header file are set if the size of off_t and other values is 32 bits. This will result in corruption of large file sizes in tars, so a compile-time warning is emitted. The warning will show up if libtar is configured to disable large file support, or if libtar is used with large file support disabled.