-
Notifications
You must be signed in to change notification settings - Fork 255
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
TCSANOW not defined correctly in unified headers #441
Comments
ugh. when i wrote
but apparently the NDK had this instead:
only half of which was been cleaned up when we added this bug gives me such deja vu that i'm sure i've been through |
So when targeting android-21 or later with unified headers, so that the inline versions in
And when targeting earlier versions than android-21, the situation is reversed and only work on mips ? |
@fornwall look likely, but I must confess that I never tried any of these in real life. |
no, it'll work fine for all architectures [>=21] because the implementation is compiled against those headers, so the implementation will be looking for the implementation-specific value of TCSANOW, whatever that is. |
proposed fix: https://android-review.googlesource.com/429041 it's a little bit ugly, which is probably where i ground to a halt last time, but having two different implementations is [demonstrably] worse. |
Before this change we have the old NDK inline termios functions with the modern constants. Unfortunately the old NDK inline functions relied on hacking the constants. Fix things by sharing the implementation between the platform and the NDK headers. Bug: android/ndk#441 Test: ran tests Change-Id: I2773634059530bc954167f29c4783413a2294d5a
Description
Both
platforms/android-14/arch-arm/usr/include/termios.h
andplatforms/android-14/arch-x86/usr/include/termios.h
redefine TCSANOW to TCSETS, which is 0x5402. But for uniform headers, it is only redefined for MIPS.As a result,
tcsetattr(fd, TCSANOW, &cfg)
fails with EINVAL on ARM with APP_PLATFORM=android-14, see https://stackoverflow.com/questions/44870554/ndk-15-breaks-serial-port-library.I believe this will not work even for android-21 and higher, where
tcsetattr
is part of libc, but I don't have a proof.Environment Details
The text was updated successfully, but these errors were encountered: