Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

find and fix other _FILE_OFFSET_BITS=64 unified headers breakage #333

Closed
enh opened this issue Mar 18, 2017 · 4 comments
Closed

find and fix other _FILE_OFFSET_BITS=64 unified headers breakage #333

enh opened this issue Mar 18, 2017 · 4 comments
Milestone

Comments

@enh
Copy link
Contributor

enh commented Mar 18, 2017

#332 had mmap, but anywhere where we have an #if defined(__USE_FILE_OFFSET64) around a function that doesn't have an __INTRODUCED_IN, we have a similar problem.

stdio.h:

int fgetpos(FILE*, fpos_t*);
int fsetpos(FILE*, const fpos_t*);
int fseeko(FILE*, off_t, int);
off_t ftello(FILE*);
...
FILE* funopen(const void*,
              int (*)(void*, char*, int),
              int (*)(void*, const char*, int),
              fpos_t (*)(void*, fpos_t, int),
              int (*)(void*));

sys/sendfile.h:

ssize_t sendfile(int out_fd, int in_fd, off_t* offset, size_t count);

unistd.h:

off_t lseek(int __fd, off_t __offset, int __whence);
@enh
Copy link
Contributor Author

enh commented Mar 18, 2017

actually, lseek is okay because lseek64 has been here forever too...

@enh
Copy link
Contributor Author

enh commented Mar 18, 2017

https://android-review.googlesource.com/354934 fixes sys/sendfile.h.

@enh
Copy link
Contributor Author

enh commented Mar 18, 2017

https://android-review.googlesource.com/354857 fixes stdio.h.

hubot pushed a commit to aosp-mirror/platform_bionic that referenced this issue Mar 20, 2017
Without this, setting __FILE_OFFSET_BITS to 64 and targeting pre-L
made sendfile entirely unavailable.

Bug: android/ndk#333
Test: builds
Change-Id: I82d326ff244473dd5443632ff6c19d726d5e29ee
hubot pushed a commit to aosp-mirror/platform_bionic that referenced this issue Mar 20, 2017
Without this, setting __FILE_OFFSET_BITS to 64 and targeting pre-L
made these functions entirely unavailable.

Bug: android/ndk#333
Test: builds
Change-Id: Id17ae3c070f8b2650a9bc9aa2aa2e92c5fcdf4ad
@DanAlbert DanAlbert added this to the r15 milestone Mar 24, 2017
@DanAlbert
Copy link
Member

Just a heads up: this is going to be in r15 but won't be in beta 1. We've got a bunch of new code in the headers (better FORTIFY support) that requires a Clang newer than the one we have in the NDK right now and the new Clang has some issues with arm5, so we're not taking that update just yet. We should have another update really soon, but it won't be in time for beta 1. Apologies for the inconvenience!

hubot pushed a commit to aosp-mirror/platform_bionic that referenced this issue Jul 10, 2017
We had several bugs filed saying "if I set _FILE_OFFSET_BITS=64 when
targeting an API < L, various functions are missing". Instead of
saying "yes, they are", we quietly just modified the header files to
expose the non-64-bit variants. This makes no sense. We can't just say
"oh, yeah, we don't have a version of this function that agrees with
your calling code about how large off_t is, but here's a version that
doesn't: I'm sure it'll be fine".

_FILE_OFFSET_BITS=64 on Android LP32 has always been a game of chance,
but that game should be "are all the functions my code needs available
at compile time?", not "will my code actually work at run time?".

Bug: android/ndk#449
Bug: android/ndk#442
Bug: android/ndk#333
Bug: android/ndk#332
Bug: android/ndk#324
Test: builds
Change-Id: Ib095251d3e21e77ed50cc3575388107fecec4ecd
sepehrst pushed a commit to spsforks/android-bionic-libc that referenced this issue Apr 22, 2024
We had several bugs filed saying "if I set _FILE_OFFSET_BITS=64 when
targeting an API < L, various functions are missing". Instead of
saying "yes, they are", we quietly just modified the header files to
expose the non-64-bit variants. This makes no sense. We can't just say
"oh, yeah, we don't have a version of this function that agrees with
your calling code about how large off_t is, but here's a version that
doesn't: I'm sure it'll be fine".

_FILE_OFFSET_BITS=64 on Android LP32 has always been a game of chance,
but that game should be "are all the functions my code needs available
at compile time?", not "will my code actually work at run time?".

Bug: android/ndk#442
Bug: android/ndk#333
Bug: android/ndk#332
Bug: android/ndk#324
Test: builds
Change-Id: Ib095251d3e21e77ed50cc3575388107fecec4ecd
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

No branches or pull requests

2 participants