Merged
Conversation
e6fa7d1 to
5b2ab89
Compare
eb027db to
15c5aeb
Compare
This change was cherry-picked from an updated version of the sysdep folder contents, we're still shipping an outdated and incomplete set of files.
While musl decided to hard-wire off_t to a 64bit quantity, glibc is much older and defaults to 32bit offsets and offers some -64 suffixed versions of I/O functions. There's a weird mix-up of types: sometimes off_t is used, sometimes not, sometimes it's defined as a signed quantity and sometimes as an unsigned one, but we'll sort this problem later.
They return c_int and not isize.
This is needed to catch any possible problem with executables linking to 32bit glibc.
Let's follow the libc/kernel convention and use an i64 for offsets, we bitcast as needed and avoid the useless conditional casts.
It turns out that nothing in the test suite was exercising preadv/pwritev and so the previous commits silently broke them. Adding tests revealed readvAll and preadvAll were also broken and not covered by any test.
Use the same order as Clang (and, by extension, GCC) for the three most important libc components: lm comes first, followed by lpthread and then lc.
The kernel interface expects the offset as a low+high pair even on BE systems.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This change allows our test suite (at least the parts I've tested) to successfully run on 32bit targets linked w/ glibc.