Skip to content
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
tklauser:masterfrom
xloem:largefiles
Open

changes for large file support on 32 bit systems#9
xloem wants to merge 2 commits into
tklauser:masterfrom
xloem:largefiles

Conversation

@xloem
Copy link
Copy Markdown

@xloem xloem commented Feb 20, 2021

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 stat struct, 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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

On 32bit OS, files greater than 2GB will not tar up correctly, leaving unusable tar ball.

1 participant